agentbox: Instructions file for Claude Code

CLAUDE.md

agentbox CLAUDE.md is an instructions file for Claude Code from madarco/agentbox. It costs 7,562 tokens per session, scanned B, original, MIT.

Repository instructions for AgentBox, an npm command-line tool that gives coding agents isolated sandboxes so they cannot directly change the host system. They describe its container and cloud sandbox backends, architecture, testing, and conventions.

In plain words
What is it for?
Use them when developing AgentBox commands, sandbox providers, agent communication, isolated worktrees, previews, credentials, or verification procedures.
Why use it?
They provide the context needed to change infrastructure that runs code in separate environments. This helps preserve isolation and the behavior shared across different sandbox providers.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is madarco/agentbox's own configuration. It tells Claude Code how to work on agentbox itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agentbox configures →

Reuse

Borrowing it

Nothing to install: this file belongs to madarco/agentbox. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/madarco/agentbox/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/madarco/agentbox

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentbox CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/madarco/agentbox/claude-md/github.svg)](https://agentmods.dev/instructions/madarco/agentbox/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/madarco/agentbox/claude-md"><img src="https://agentmods.dev/badge/instructions/madarco/agentbox/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agentbox CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/madarco/agentbox/claude-md"><img src="https://agentmods.dev/badge/instructions/madarco/agentbox/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7,562 This file is loaded in full into every session.
When invoked 7,562 The same file — it is already loaded in full.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.07562 $0.07562
Opus 5.5 $0.03025 $0.03025
Sonnet 5.5 $0.01512 $0.01512
Haiku 4.5 $0.00756 $0.00756

Measured 26d ago against content hash 1b4a58484eb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

agentbox CLAUDE.md scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **vercel** (cloud): one Vercel Sandbox (Firecracker microVM, Amazon Linux 2023) per box. Workspace seeded the same way (git bundle + stash + untracked tar). Boots from a Vercel snapshot baked once by `agentbox prepare

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- For hetzner-cloud work: the base-snapshot id is recorded at `~/.agentbox/hetzner-prepared.json` (written by `agentbox prepare --provider hetzner`); per-box SSH keys live under `~/.agentbox/boxes/<sandboxId>/ssh/` (priv
CLAUDE.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AgentBox — context for Claude Code

agentbox is an npm CLI that spins up isolated sandboxes ("boxes") for coding agents (Claude Code, Codex, others) to work in, so they can't touch the host. Seven backends share one provider abstraction: Docker (the default — one local container per box, isolated by per-box git branch in an in-container worktree against the bind-mounted host .git/), Daytona Cloud (--provider daytona — a managed remote sandbox seeded from a host git bundle + per-agent credential volumes, reached via SSH-token attach and an in-sandbox bridge relay), Hetzner Cloud (--provider hetzner — a bare VPS per box, pure OpenSSH ControlMaster comms, locked-down Hetzner Cloud Firewall, baked from a one-time agentbox prepare --provider hetzner snapshot), Vercel Sandbox (--provider vercel — a Firecracker microVM per box, persistent snapshots, public HTTPS preview URLs; nested containers (in-box docker) now supported and baked in, no SSH, baked from a one-time agentbox prepare --provider vercel snapshot), E2B Sandbox (--provider e2b — a Firecracker microVM per box, SDK-only comms, public HTTPS preview URLs, persistent pause/resume; uniquely among the cloud providers, E2B builds its base template directly from a Dockerfile via Template.build() — agentbox prepare --provider e2b runs the build), and Remote Docker (--provider remote-docker, spelled agentbox docker:<host> … — one container per box on a machine the user already owns, reached over an OpenSSH ControlMaster and driving that machine's docker engine. Cloud-shaped despite being docker: a bind mount can't cross a network, so the workspace is synced (git clone + carried-over stash/untracked) exactly as for the clouds, while the image (Dockerfile), checkpoints (docker commit) and DinD stay docker-shaped. No credential — it connects as you, over your own ~/.ssh/config).

Architecture overview

  • Boxes — one isolated sandbox per agent run. The shape differs by provider but the abstraction is one Provider interface (packages/core/src/provider.ts):
    • docker: container agentbox-<id|name>; /workspace is the in-container git worktree on branch agentbox/<box-name>; host's .git/ is bind-mounted RW so commits land on the host immediately. Boxes pause/unpause for cheap context switching and survive stop/start; destroy wipes the container + per-box volumes. The base image (agentbox/box:dev) is pulled from GHCR on first use (tagged by build-context fingerprint, see pullOrBuild/registryRefForSha in image.ts) and only built locally on a pull miss; --build / box.imageRegistry="" force a local build. See docs/development.md → "Image: pull vs rebuild". One agent per box: the base image carries NO agents; agentbox claude derives agentbox/box:dev-claude (FROM the base + the agent's install recipe) and mounts only that agent's config volume + credentials. agentbox openclaw is the same shape for a service agent — a daemon the box hosts, published on the box web URL, with no TUI to attach to. See docs/agents.md.
    • daytona (cloud): Daytona sandbox with /workspace seeded from a host git bundle create (incl. stash + untracked carry-over for the user's local state). Lifecycle goes through the Daytona SDK; agent credentials (~/.claude, ~/.codex, ~/.config/opencode) live in shared per-org volumes seeded from the host. Host↔box comms go through a per-box bridge URL (CloudFront preview) that the host relay's CloudBoxPoller long-polls.
    • hetzner (cloud): one Hetzner VPS per box (default cx23 / nbg1). Workspace seeded the same way (git bundle + stash + untracked tar). Per-box ed25519 SSH key minted on the host into ~/.agentbox/boxes/<sandboxId>/ssh/ and injected via cloud-init. Per-box Hetzner Cloud Firewall auto-locked to the host's egress IP (multi-probe fail-loud). All comms (exec, scp, port forwards, attach) flow over one persistent ssh -fNT -M ControlMaster per box; previewUrl(port) mints ssh -O forward on demand. No agent credentials volume — credentials pushed via scp at create time (Hetzner has no shared-volume primitive). agentbox prepare --provider hetzner bakes a one-time base snapshot since Hetzner can't build images from a Dockerfile.
    • vercel (cloud): one Vercel Sandbox (Firecracker microVM, Amazon Linux 2023) per box. Workspace seeded the same way (git bundle + stash + untracked tar). Boots from a Vercel snapshot baked once by agentbox prepare --provider vercel (no Dockerfile build). Persistent sandboxes auto-snapshot on stop and auto-resume on Sandbox.get({ resume: true }) → pause/resume for free. Comms via the SDK: exec runs as vscode (root → sudo -u vscode); previewUrl(port) returns the public sandbox.domain(port) (HTTPS, no token), so the host relay's CloudBoxPoller reaches the in-box bridge directly. In-box docker (DinD) is baked into the base snapshot and dockerd is auto-started on create/resume (launchDockerd:true, via the shared agentbox-dockerd-start) — Vercel Sandbox now supports nested containers. No SSH (attach is a custom attach-helper.js tmux bridge over the SDK). Max 4 exposed ports, region iad1 only.
    • e2b (cloud): one E2B Sandbox (Firecracker microVM, Debian 12) per box. Workspace seeded the same way (git bundle + stash + untracked tar). Key differentiator from Vercel/Hetzner: E2B builds its base image directly from a Dockerfile via the SDK's Template.build() — agentbox prepare --provider e2b drives the build and pins the resulting template id to box.imageE2b. Sandbox.pause/Sandbox.connect (auto-resume) gives free pause/resume; Sandbox.createSnapshot is the reusable, id-addressed checkpoint primitive (same shape as Vercel). Comms via the SDK: exec runs as vscode; previewUrl(port) returns the public {port}-{sandboxId}.e2b.app URL (HTTPS, no token; constructed locally so it doesn't wake a paused sandbox). In-box docker (DinD) is baked into the base template and dockerd auto-starts on create/resume (launchDockerd:true) — E2B microVMs support nested containers (full root + cap_sys_admin, verified 2026-06-23), contrary to the original "same as Vercel" assumption. No SSH — attach is a custom attach-helper.cjs SDK-streaming PTY bridge over pty.create. 1-hour platform session cap on the Hobby tier (the attach helper caps at 55 minutes for headroom).
  • In-box supervisor (@agentbox/ctl) — reads /workspace/agentbox.yaml and runs the declared tasks/services under a DAG scheduler. Ships as agentbox-ctl inside every box (docker, daytona, hetzner, vercel, e2b).
  • Host relay (@agentbox/relay) — a host node process boxes call for things they have no credentials for (git push, checkpoint capture, cp/download) and to push status events. Keeps SSH keys out of the box. The cloud path drives the same relay via CloudBoxPoller + executeCloudAction.
  • Checkpoints — docker commit (+ periodic FROM scratch flatten) for docker; Daytona snapshots (sb._experimental_createSnapshot) for daytona; Hetzner create_image snapshots (no-pause default — matches docker commit) for hetzner; Vercel sb.snapshot() (id-addressed; stores the snapshot id in the cloud-checkpoint manifest) for vercel; E2B Sandbox.createSnapshot (id-addressed template, same shape as Vercel) for e2b. All flow through provider.checkpoint.create. box.defaultCheckpoint is the cross-provider fallback; box.defaultCheckpointDocker / box.defaultCheckpointDaytona / box.defaultCheckpointHetzner / box.defaultCheckpointVercel / box.defaultCheckpointE2b override per provider.
  • The full design — file-handling rationale, the checkpoint model, pause/resume strategy, what we explicitly rejected — lives in docs/architecture.md and docs/create-and-checkpoints.md. Each cloud provider's shape and its known caveats live in docs/cloud-providers.md. Read them before making non-trivial changes to the lifecycle code.

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago Changed · +3 lines · +407 tokens per session 1b4a58484eb6
  2. 1mo ago Changed · +13 lines · +556 tokens per session 18805d4ff7d2
  3. 1mo ago Changed · +2 lines · +399 tokens per session 7b61d8c39a5d
  4. 1mo ago Changed · +4 lines · +489 tokens per session f7f69996d7be
  5. 1mo ago First seen · 129 lines · 5,711 tokens per session scan B c1a9b667be9c

Subscribe to this mod's changes

agentbox CLAUDE.md is an instructions file published in the GitHub repository madarco/agentbox (538 stars, last pushed 11d ago), licensed MIT. It adds 7,562 tokens to every session, about $0.0302 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,257 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,159 tokens