> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boxd.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding agents

> Claude Code, Codex, and OpenCode come preinstalled on every machine, already configured to work with boxd.

Every boxd machine ships with three coding agents: **Claude Code** (`claude`), **Codex** (`codex`), and **OpenCode** (`opencode`). Type the command from any directory and go. Forks and fresh machines have them too, since the agents are part of the image.

<Frame caption="claude starts already logged in on a fresh machine.">
  <video autoPlay muted loop playsInline src="https://mintcdn.com/azin/psRZbQh2QwMUVL3U/videos/claude-in-boxd-2.mp4?fit=max&auto=format&n=psRZbQh2QwMUVL3U&q=85&s=4e26a265d271127b2d16cca8c3120f9a" data-path="videos/claude-in-boxd-2.mp4" />
</Frame>

## Already configured for boxd

Each machine carries an instructions file that every agent reads through its own convention: `~/.claude/CLAUDE.md` for Claude Code, `~/.codex/AGENTS.md` for Codex, and `~/.config/opencode/AGENTS.md` for OpenCode. It tells the agent about the environment: the in-VM `boxd` CLI, the default proxy on port 8000, and how to create sibling machines, manage proxies, and clean up. You skip the part where you explain the platform, because the agent already knows it.

A repo-level `CLAUDE.md` or `AGENTS.md` merges on top, so your project conventions come for free as well.

The in-VM `boxd` CLI is pre-authenticated ([how](/guides/vm-to-vm)), so any of the three agents can create machines, exec into them, and expose ports without a token or key setup.

## Logins

* **Claude Code** is keyed to your boxd account. Sign in once on any machine, and every machine you touch afterwards already has you logged in. Forks, resets, and new machines included. The credential is stored encrypted on your account and injected at boot, and you can revoke it from the console.
* **Codex and OpenCode** need a one-time `codex` / `opencode` login per machine. The login persists on the machine's disk and carries into its forks. A brand new machine asks again.

Prefer an API key over a subscription? Set `ANTHROPIC_API_KEY` (or the equivalent for the other agents) as an [env var or secret](/guides/env-secrets) and the same binaries use it.

<Note>
  On shared org machines, personal agent logins are wiped by design, so a teammate can never read your tokens. See [VM sharing](/guides/share-a-vm).
</Note>

## Use them

Interactive:

```bash theme={"theme":"github-dark"}
boxd connect myapp
cd my-project
claude        # or codex, or opencode
```

Non-interactive, delegated from your laptop:

```bash theme={"theme":"github-dark"}
boxd machine exec myapp 'claude -p "Add a /health endpoint" --dangerously-skip-permissions'
boxd machine exec myapp 'codex exec "Add a /health endpoint"'
boxd machine exec myapp 'opencode run "Add a /health endpoint"'
```

Sessions live on the machine's persistent disk, so you can delegate a job and take over interactively later:

```bash theme={"theme":"github-dark"}
boxd connect myapp
claude --resume <session-id>
```

## An agent that is always available

The machine keeps running when you disconnect, so an agent session that lives on the machine outlives your laptop. Three pieces make it permanent: `tmux` keeps the terminal session alive on the machine, Claude Code runs inside it, and remote control connects the session to your Claude account so you can drive it from anywhere.

```bash theme={"theme":"github-dark"}
boxd connect myapp
tmux
claude
```

Inside Claude Code, turn on remote control:

```text theme={"theme":"github-dark"}
/remote-control
```

<Frame caption="tmux keeps the session on the machine, and remote control makes it reachable from anywhere.">
  <video autoPlay muted loop playsInline src="https://mintcdn.com/azin/psRZbQh2QwMUVL3U/videos/always-on-agent-2.mp4?fit=max&auto=format&n=psRZbQh2QwMUVL3U&q=85&s=bb320e2db006128cf07108af34247e1a" data-path="videos/always-on-agent-2.mp4" />
</Frame>

Now close the terminal whenever you like. The session keeps running on the machine, and you can check progress or reply from the Claude mobile app, the desktop app, or [claude.ai](https://claude.ai). Reattaching from a shell is `boxd connect myapp` followed by `tmux attach -t agent`.

<Note>
  A long-running session that works quietly can look idle to the machine's [network idle timers](/guides/suspend-resume). For an agent that must keep going unattended, disable hibernation: `boxd machine config set myapp auto-hibernate.timeout 0`.
</Note>

## Many agents at once

One agent on one machine is the starting point. To fan a problem out across many agents in parallel, each on its own machine with a lead agent merging the results, see [Agent swarm intelligence](/use-cases/agent-swarm-intelligence).

## FAQ

<AccordionGroup>
  <Accordion title="Do sessions survive a reboot?">
    Yes. Session state lives on the persistent disk. Resume after a reboot with `claude --resume <session-id>`, and the same holds for the other agents' session storage.
  </Accordion>

  <Accordion title="Where does the Claude Code auth live?">
    On your boxd account, encrypted, injected into the machine at boot. Revoke it from the console at any time.
  </Accordion>

  <Accordion title="Can the agents run Docker, systemd, anything?">
    Yes. A boxd machine is a full VM with its own kernel, so anything you'd do on a Linux server, the agent can do here. See [Run Docker](/guides/run-docker).
  </Accordion>

  <Accordion title="Which instructions file wins when a repo has its own?">
    The repo-level `CLAUDE.md` or `AGENTS.md` merges on top of the boxd-provided one, so the agent keeps the platform context and adds your conventions.
  </Accordion>
</AccordionGroup>
