# Coding agents in a computer

A computer is a good place for a coding agent to work: a machine of its own, with a disk that lasts, that keeps running when you close the browser, and that can't touch anything outside its project. A computer made **with Claude Code** comes with it, and with Alf's tools for its project; any computer can have Claude Code, Codex or opencode added.

## A coding agent in it

A computer made **with Claude Code** has it set up by itself. For any computer, **Claude Code**, **Codex** and **opencode** install with one button under **Agent & tools** at the top of its page. They go into `/workspace`, so they're still there after the container is replaced, and you run `claude`, `codex` or `opencode` in the shell.

Each one needs to be signed in. Either put its provider key in the field under it — kept as a secret of the computer, so the agent finds it in its environment — or leave it empty and sign in from the shell the way you would anywhere else.

The computer shows what each command printed, whether it worked or not. If an install or a setup command fails, the output is there and you can run it yourself in the shell.

**Installs and updates can't leave a broken agent.** Each one is downloaded whole, checked, and only then put in place, in one step, into `~/.local/bin`. A restart or a closed terminal in the middle leaves the version you had, still working. Claude Code updates itself the same way; Codex and opencode get their newest version with **Install again**, which also clears away anything a half-finished install left behind. An agent only shows as installed once it actually runs.

## Giving an agent Alf's tools

**Alf's tools**, in **Agent & tools**, points an agent in the computer at Alf's own MCP endpoint, so it can deploy, watch and undo for you. A computer made with Claude Code has this done for its own project as it starts.

Choose **which project** it may touch — the computer's own to begin with, another one, or the whole organization — and whether it may change things or only look. It gets an [agent token](/docs/agents) of its own, scoped to exactly that, and the usual [approvals and limits](/docs/agent-safety) apply.

The token is kept as a secret of the computer and reaches the agent as an environment variable. **It is never written into a config file**: what's written names the variable. Giving the tools from the dashboard restarts the computer once, so every shell has the token and an agent that was already running starts again with it.

## For coding agents

| Tool | What it does |
| --- | --- |
| `create_computer` | Makes one, in the token's project (or a new one), and returns its `computer_id` |
| `exec` with `service_id` (the `computer_id`) and `live: true` | Runs a command in it, where each command sees what the last one left |
| `list_computers` | What's there, with state and expiry |
| `extend_computer` | Keeps one longer, a week at most |
| `delete_computer` | Deletes it and its disk (needs a token that may delete) |
| `exec` running `alf share 3000` | Shares a port it started, and prints the address |

A token limited to one project makes computers in that project and only sees those. See [agent safety](/docs/agent-safety).
