Adds a two-line Docker Sandboxes status line to Claude Code (host, cwd, git branch, model, contex...
90
Adds a two-line Docker Sandboxes status line to Claude Code (host, cwd, git branch, model, context %, memory, load, cost). Ships ~/.claude/statusline.sh and sets the statusLine key in ~/.claude/settings.json, merging so every other setting is preserved (an existing statusLine is intentionally replaced, since installing this status line is the point of the kit).
| Type | Required | Description | |
|---|---|---|---|
com.docker.sandbox/lifecycle@1 | Required | — | |
com.docker.sandbox/agent-context@1 | Required | — | |
claude, deb/jqsbx run <agent> --kit docker/sbx-kit-claude-sbx-statusline:latestRun the following command to install sbx on your machine.
brew install docker/tap/sbxwinget install Docker.sbxNote
Experimental: Sandbox Kit v3This kit uses the experimental Sandbox Kit specification, specifically v3. The format and runtime behavior may change before v3 is stable.
A two-line Claude Code status line
for Docker Sandboxes. Compose this mixin onto the built-in claude agent and every
session renders a compact dashboard of where you are and what the session is costing:
* dirty marker).The kit ships the script to ~/.claude/statusline.sh and registers it under statusLine
in ~/.claude/settings.json — merging into the file so the claude base image's other
settings are preserved. Only the statusLine key is written; if the file already had one,
it is replaced with this kit's script (that's the point of installing the kit), and every
other key is left as-is.
🐳🏖️ Docker Sandboxes · my-sandbox · /home/agent/workspace (main*)
Claude Opus 4.8 · ctx 32%/200k · mem 1.2/8.0G · load 0.41 · $0.87
Segments are omitted when there's nothing to show (e.g. the git segment is blank outside a repo, the context segment is blank early in a session). Memory reads the cgroup v2 limit so it reflects the sandbox's allocation, not the host's.
Pair the mixin with the claude agent via --kit, from its published OCI artifact on Docker Hub:
sbx run claude --kit "docker.io/docker/sbx-kit-claude-sbx-statusline:latest" .
Or pull it straight from this repo over git (pinned by ref):
sbx run claude --kit "git+https://github.com/docker/sbx-kits-contrib.git#dir=claude-sbx-statusline" .
Or with a local clone of this repo:
sbx run claude --kit ./claude-sbx-statusline .
files/home/.claude/statusline.sh is baked into the kit's overlay at
/home/agent/.claude/statusline.sh, so it arrives with the image rather than
being written per sandbox. (Under v2 it was packed from the files/home/ tree
and copied in at create time; v3 has no files/ convention — a mixin's layers
are its content — so the recipe COPYs
it. The source stays in place so the mapping is still legible.) The install hook
below still chmod +xes it, which is belt-and-braces now that COPY carries
the mode — without the executable bit Claude Code silently renders no status
line. The script receives the session JSON on stdin and prints the two lines.
The install hook (run as root) merges the statusLine block into
~/.claude/settings.json with jq:
{
"statusLine": { "type": "command", "command": "~/.claude/statusline.sh" }
}
It creates the file if missing and leaves every other key untouched — only statusLine
is set (replacing a prior one if present) — then chowns back to the agent user exactly
the paths it touched: ~/.claude, ~/.claude/settings.json, and ~/.claude/statusline.sh.
The chown is deliberately not recursive — ~/.claude holds runtime-managed content this
kit doesn't own, so a chown -R over the parent would claim ownership of paths outside the
kit's control. Re-running is idempotent. The temp file is created inside ~/.claude
so the final mv is an atomic same-filesystem rename rather than a cross-device copy.
Note that the script does not perform any checks to verify that you are indeed inside a sandbox. Care should be taken to not put this status line to your host's Claude Code installation as it would then incorrectly state that you are inside a sandbox when you are not.
The script and the install merge both use jq, which is present on the claude-code base
image. It also uses git, awk, and hostname — all standard on the base image.
Pulls:
3
Last week