How to add a Claude agent in an sbx sandbox
This guide shows how to add Claude (Claude Code, through its ACP adapter claude-agent-acp) as a Sidekicks agent that runs inside a Docker sandbox (sbx). Claude then works in its own folder, isolated from the rest of your computer, and Sidekicks shows its files and a terminal like for any other agent. It assumes sbx is installed and that you have an Anthropic API key.
A ready-made example is in the repository: agents/snippets/claude-acp.
A kit provided by a third party
The sandbox is built from the docker.io/sbx/claude-acp kit. This kit is provided by a third party, not by Sidekicks: what it contains (Claude Code, claude-agent-acp), its updates (the sandbox pulls latest each time it is created) and whether it stays available depend on that third party. Sidekicks only creates the sandbox from the sbxenv.yaml that names it and starts claude-agent-acp inside it. If the kit changes or disappears, the sandbox may no longer be created, or Claude may no longer start: the Log tab then shows what sbx said.
What you need
| Role | |
|---|---|
A folder for the agent, e.g. /Users/me/agents/claude-acp |
holds the sandbox's sbxenv.yaml and the workspace/ folder Claude works in. |
The docker.io/sbx/claude-acp kit |
the sandbox's image, with Claude Code and claude-agent-acp installed. |
| Your Anthropic API key, stored in sbx | sbx adds it to Claude's requests to Anthropic: it is written neither in the sandbox nor in Sidekicks' configuration. |
The simplest way: with the assistant
- Prepare the folder: copy
agents/snippets/claude-acp(itssbxenv.yamlandworkspace/) to where the agent will live, e.g./Users/me/agents/claude-acp, or write them as in steps 1 and 2 below. Changename:in thesbxenv.yamlif you want another sandbox name. - Give your Anthropic API key to sbx (step 3 below).
- In the Agents panel, click + Add an agent. Fill in Name shown (
Claude) and, if you like, an icon (📙). - Where does it run? Choose In an sbx sandbox, then drop the
sbxenv.yamlon Recreate the sandbox when it is gone (optional) (or click Choose an sbxenv.yaml…). The sandbox, the agent's folder (…/workspace) and thesbx envcommands are filled in from it. - Program:
claude-agent-acpis chosen for you, fromagent: claudein thesbxenv.yaml(otherwise choose it in the list; it is offered in an sbx sandbox only). Leave Arguments empty. - Click Add the agent, then start Claude (step 5 below).
By hand
The same result, step by step — or to adapt an existing sandbox.
-
Create the agent's folder with an empty
workspace/inside:mkdir -p /Users/me/agents/claude-acp/workspace -
Write the sandbox's
sbxenv.yamlin/Users/me/agents/claude-acp:schemaVersion: "1" name: claude-acp agent: claude # The folder Claude works in, relative to this file. workspace: ./workspace kits: - docker.io/sbx/claude-acp:latest # sbx injects the Anthropic key into the requests to these domains. bindings: anthropic: apiKey: domains: - api.anthropic.com - console.anthropic.com sandboxOptions: pullPolicy: alwaysnameis the name of the sandbox: Sidekicks uses the same one. -
Give your Anthropic API key to sbx, so that it can inject it (the
bindingsabove). The key is kept by sbx, on this computer, never in a file of the folder. Seesbx secret --helpfor the exact command of your sbx version. -
Add the agent with the assistant: in the Agents panel, click + Add an agent, then:
- Title
Claude, an icon if you like (📙). - Where does it run? In an sbx sandbox.
- Drop
/Users/me/agents/claude-acp/sbxenv.yamlon the Recreate the sandbox when it is gone (optional) area (or click Choose an sbxenv.yaml…). The sandbox (claude-acp), the agent's folder (/Users/me/agents/claude-acp/workspace) and thesbx envcommands are filled in. - Program: type
claude-agent-acp. Leave Arguments empty. - Click Add the agent.
Or in Settings, add this entry under
agents:and save:- name: claude title: Claude icon: "📙" command: sbx args: [exec, -i, claude-acp, claude-agent-acp] workspace: /Users/me/agents/claude-acp/workspace runtime: type: sbx sandbox: claude-acp lifecycle: folder: /Users/me/agents/claude-acp create: [sbx, env, create, --force] stop: [sbx, stop, claude-acp] remove: [sbx, env, rm, --force]workspaceis the folder Claude works in, on this computer; sbx shares it with the sandbox at the same path.lifecycle.folderis the folder of thesbxenv.yaml, where thesbx envcommands run. - Title
-
Start Claude from the Agents panel (▶), or write to it. The first time, the sandbox does not exist yet: the Log tab shows
sandbox claude-acp not found: creating it, then the kit being pulled — this can take a minute or two. Then Claude answers.
Check that it works
- Ask Claude to write a file, e.g. "Write
notes/hello.mdwith a greeting". The file appears in the agent's Files tab (📂) and in/Users/me/agents/claude-acp/workspaceon this computer. - In the Terminal tab,
lsshows the same folder, from inside the sandbox. - When Claude asks for permission to change a file or run a command, Sidekicks shows the request and waits for your answer.
Variants
- Another name for the sandbox: change
name:in thesbxenv.yamland, in the agent's entry, the sandbox name inargs,runtime.sandboxandlifecycle.stop. All of them must be the same. - Several Claude agents: one folder, one
sbxenv.yamland one sandbox name each, and a differentnamefor each agent (claude,claude-docs…). - Claude answers with an authentication error (see the Log tab): the key is not stored in sbx, or not where the
bindingsexpect it. Store it again, then 🗑 Remove the sandbox and start the agent: the sandbox is created again with the key. - Sidekicks opened from the Finder does not find
sbx: write its full path incommand(seewhich sbx), as in How to run an agent in an sbx sandbox. - Start from scratch: 🗑 Remove the sandbox in the agent's header removes it; the files of
workspace/stay on this computer.
See also
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|