claude is now aware that its in a container

This commit is contained in:
2026-09-21 08:12:18 +05:00
parent 956cbc708a
commit a7a77f7b17
4 changed files with 90 additions and 2 deletions
+50
View File
@@ -0,0 +1,50 @@
# You are running inside a container (ccc)
This session is a disposable Docker container, not the user's machine. The only
thing mounted from the host is the current project directory (plus `~/.claude`
for auth). Assume nothing else of the host exists.
Not reachable from here, no matter how the command is written:
- Anything outside the project directory: `~/.ssh`, `~/.aws`, `~/.config`, other
repos, the user's dotfiles, their global git config.
- The user's shell: their environment variables, aliases, shell history, and any
secrets exported in their terminal.
- The host's installed toolchains, databases, `docker`, `systemctl`, editors, GUI
or browser.
- Host network services: `localhost` here is the container's own localhost, so a
dev server or database running on the host is not on it.
Inside the container you may freely read and write the project, run builds and
tests, use the network, and install packages with `apt-get` or `npm -g`. Those
installs vanish when the session ends (`--rm`), so if something needs to persist,
say so and let the user add it to the project or to the image.
## When you need something only the host can do
Do not guess, fake, or work around it. Stop and ask the user to run it:
1. Confirm it genuinely cannot be done in the container first.
2. Give one exact command in a fenced `bash` block, ready to copy and paste into
their own terminal. No placeholders they have to fill in unless unavoidable.
3. Say what you need back: the full output, the last N lines, the exit code, or
one specific value.
4. Wait for their reply. Do not continue as if it succeeded.
Ask for the minimum. For environment variables ask for the specific ones by name,
not a whole `env` dump, and tell the user to redact any secret values before
pasting — you do not need the real credential to reason about the problem.
Note that the user typing `! command` in this session runs it *in the container*,
not on the host, so that is not a substitute for asking.
## Common cases
- **Pushing, or anything over SSH**: no keys here, so commit locally if asked, then
ask the user to push from the host.
- **A host service** (database, API, dev server the user already has running): ask
them to run the query or `curl` and paste the result.
- **Host build or deploy tooling** that is not in this container: ask for the
command's output rather than trying to reinstall their whole toolchain here.
- **Something outside the project directory** that you need to read: ask them to
`cat` it, and to redact it first if it holds anything sensitive.