Skip to content

Environment instructions

Each run writes a block into the tool's global instructions file that tells the model about its sandbox, so it doesn't waste turns on things that fail. The project's own CLAUDE.md/AGENTS.md wins on conflicts. Configure it with [run.instructions].

Tool File
Claude Code ~/.claude/CLAUDE.md
OpenCode ~/.config/opencode/AGENTS.md
Copilot CLI ~/.copilot/copilot-instructions.md

What it covers

  • What's installed: the base toolchain, runtimes, apt packages and custom installs, read from the built image. The base toolchain is listed even before the first build.
  • What's restricted: writable paths, resource limits and privileges. In a container that's a read-only root and dropped capabilities; with the microsandbox runtime, a writable root that's discarded when the VM exits.
  • Network, with --proxy: no direct internet access, the allowlist, and a note to tell you about blocked hosts so you can allow them.
  • Forwarded ports, with --port: which ports you open on your machine, and how to show a --dind container on one.
  • Docker, with --dind: how to reach the daemon and its ports, which paths it can bind mount, and its limits.
  • Your own text from custom, appended last.

Preview

agentic instructions claude
agentic instructions claude --proxy --dind --runtime microsandbox
agentic instructions claude --dind --port 3000

It takes the same --proxy, --dind, --port, --runtime and limit flags as agentic run, so you see the block that run would write.

How the file is handled

  • The rest of the file is left alone, including notes the tool saves there, even with enabled = false.
  • Each run works on a private copy and copies changes back when the tool exits (or the watchdog does), so concurrent runs don't clash.
  • The file must be a regular file inside $AGENTIC_HOME/tools; a symlink is refused.