What is boxer
Install boxer into your coding agent once. Every workstream gets its own sandbox, automatically.
boxer gives every agent workstream its own sandbox and runs the agent's commands in it. A workstream is a git worktree by default, or a single agent session or subagent. A sandbox is a microVM by default, or a container. Install boxer into your agent once, then work as usual.
Why
Codex and Claude Code create worktrees themselves, and orchestrators like Conductor run a task per worktree. Each worktree has its own files, but every task still shares your machine. Dev servers fight over ports, one task's install breaks another's, and every command runs against your own system. boxer gives each workstream its own sandbox:
- A sandbox per workstream: per worktree by default, including worktrees the agent or an orchestrator creates, or per session or subagent.
- Your agent doesn't change. A hook runs
npm testin the sandbox instead of on your machine. - No port clashes. Each worktree's dev servers get their own ports, or named URLs like
https://fix-ui.myapp.localhost. - A real boundary. A microVM with its own kernel by default, or a docker, podman or Apple container. It sees only the worktree.
- Fast. 33 ms per command, about the same as
docker exec. See Benchmarks. - Local. No account, no upload. See how it compares.
Do I need boxer?
Probably, if either of these is true:
- You run more than one agent at a time. Each one gets its own dev server, ports and installed tools, so they stop breaking each other.
- You let an agent run commands on its own. Its builds, tests and installs run in the
sandbox instead of on your machine. Programs not on the
interceptlist, likerm, still run on your machine unless you add them.
boxer does not protect the code in your project. The sandbox works on your real files, so an agent that deletes them deletes them. See Security.
The terms, in one line each. A sandbox is a separate place for commands to run. A microVM is a small virtual computer with its own operating system, which is what boxer uses by default. A container is a lighter kind of sandbox that shares your machine's operating system core (its kernel). An image is the starting contents of a sandbox, such as Node on Linux. A worktree is an extra checkout of your git repository, so two tasks can edit the same project at once. Agents and orchestrators create worktrees for you. A hook is a script your agent runs before each command, which is how boxer steps in. An MCP server gives an agent extra tools. The Glossary has more.
Find your path
| You are | Start here |
|---|---|
| Using Claude Code or Codex | Quickstart |
| Running an orchestrator like Conductor or T3 Code | Quickstart step 1, then Orchestrators |
| Already managing containers with your own scripts and hooks | Coming from your own scripts |
| Set on Docker, or bringing your own images, services and devcontainer | Bring your Docker setup |
| New to all of this | Quickstart |
| Building your own tools on top | Build on boxer |
What happens while your agent works
Once boxer is installed into your agent, this happens on its own:
- A session starts in a worktree. boxer's
SessionStarthook creates that worktree's sandbox. It boots the image, runs yoursetup(such asnpm ci) and starts your dev server. Then it tells the agent that commands run in a sandbox, which ones stay on the host, and where its dev server is. - The agent runs a command. It types
npm testas usual. boxer'sPreToolUsehook rewrites it toboxer run -c 'npm test'before the shell runs it. The command runs in the sandbox, and the agent gets the normal output and exit code. - A new worktree appears. It does not matter who creates it:
codex --worktree, Claude Code'sEnterWorktree,git worktree addfrom the agent's shell, or an orchestrator. boxer picks the sandbox from the directory each command runs in. The first command in the new worktree creates its sandbox, with the samesetupandstart. Two worktrees never share a sandbox. - A worktree is deleted. boxer removes its sandbox. Any command that uses a sandbox starts this cleanup in the background, at most every 6 hours (
auto_reclaim).boxer gcruns it now.
git, gh and ssh always run on your machine, with your credentials. Everything in the
intercept list (npm, node, python, go, make, cargo and more) runs in the sandbox.
What boxer install sets up
boxer install <harness> writes the files your agent reads. For Claude Code:
| Piece | What it does | Enforces |
|---|---|---|
Hooks, in .claude/settings.json | create the sandbox at session start, and rewrite each shell command into it | yes |
MCP server, in .mcp.json | gives the agent a boxer_run tool and a live description of its sandbox | in tool mode |
Skill, in .claude/skills/boxer/ | explains to the agent how commands run here and what to do if one is refused | no |
Subagent, in .claude/agents/boxed.md | a subagent that runs everything through boxer | no |
The hooks do the work. The other pieces tell the agent how the sandbox works.
How boxer connects to each agent
boxer uses the strongest integration each agent supports:
| Level | How it works | Used for |
|---|---|---|
| Hook rewrite | a hook changes the command before the shell runs it | Claude Code, Codex, Gemini CLI, Copilot CLI, Grok |
| Plugin or extension | the same, from inside the agent's process | OpenCode, pi |
| Tool mode | the hook blocks the shell, so the agent runs commands with boxer_run | Kimi Code, DSH |
| Inside mode | the agent itself runs in the sandbox, so nothing runs on your machine | fx, any agent without hooks, or when you want the agent off your machine too |
| PATH shims | files named npm, node and so on that forward to the sandbox | an extra layer, or agents without hooks |
| Skill and MCP tool only | the agent is asked to use boxer, and nothing forces it | agents boxer has no integration for |
boxer install sets up the level for your agent. Kimi Code and DSH also need one line in
boxer.toml to turn on tool mode. Inside mode is the strictest, but the agent's login and config
have to reach the sandbox, so it is opt-in. Integration levels has
the details, and where each level can be bypassed.
The default sandbox is a smolvm microVM. Apple container, docker and
podman also work, with less isolation. See Backends. boxer runs on macOS on Apple
Silicon, and Linux on x86-64 or arm64. On an Intel Mac, use docker or podman as the backend.