pillbox
AGENTS.md2 starsChanged 58 days agoApache-2.0View on GitHub
This file is for coding agents (Claude Code, Codex, opencode, etc.) using pillbox on a user's behalf. It explains the mental model in one screen and documents every command an agent might need to run. If you're a human, the README is friendlier. If you're an agent, this is what you want. ⚠️ Direction note — ONE backend, a local microVM. Docker is DEPRECATED. The backend is a single local microVM. libkrun is the current impl (the default build; macOS/HVF…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- brief-amendSkill
- brief-author-decisionSkill
- brief-backfillSkill
- brief-feature-mapSkill
- brief-reviewSkill
- dispatchSkill
- ghostSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
If you're a human, the README is friendlier.
- Distinctive: line 79
Stop reading if that's all you need.
- Distinctive: line 85
Read the canonical doc for a subsystem before changing it or claiming how it works.
- Distinctive: line 101
Retrieve before asserting: Before stating how a subsystem works or changing it, read its canonical doc (map above) and the relevant code.
- Distinctive: line 104
Code wins over docs: If a doc disagrees with the code, the code is right — fix the doc in the same change.
- Very specific: line 130
If brief check asks for a sign-off (only decisions marked signoff: required do, and only when you touch the code under their // Context: …
- Distinctive: line 135
If the task CANNOT be done without changing a ratified decision, you may NOT change it yourself.
- Distinctive: line 143
If your memory, notes, or habits disagree with an active decision, the decision wins: it is versioned and reviewed with the code, memory is …
- Very specific: line 147
If the repo has a feature map (a .brief/docs doc with type: features), run brief features <files> before changing code and read the Gotchas …
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
pillbox — agent guide
This file is for coding agents (Claude Code, Codex, opencode, etc.) using pillbox on a user's behalf. It explains the mental model in one screen and documents every command an agent might need to run.
If you're a human, the README is friendlier. If you're an agent, this is what you want.
⚠️ Direction note — ONE backend, a local microVM. Docker is DEPRECATED. The backend is a single local microVM. libkrun is the current impl (the default build; macOS/HVF only today). QEMU is under evaluation as the cross-platform single backend (Mac+Linux+CI via HVF/KVM/TCG) and may replace libkrun — the microVM model and the vault/egress/§0 plumbing are shared, only the VMM launcher differs. Docker is deprecated and on the path to deletion — NOT a co-equal backend, NOT held to parity, and it gets no new features and no bug-fix engineering. Do not propose, build, or "also do" a docker version of anything. Do not defend docker with "it's cheap" / "cross-platform" / "the CF-container twin" — that framing repeatedly wasted the maintainer's time and is banned. A docker-only bug's resolution is "docker is deprecated," not a fix.
Core swarm primitives belong on the microVM backend. pillbox exists for an independent orchestrator to spawn swarms — so
sandbox spawn/exec/agentandsession sendare CORE, not optional. Anything that currently lives only on docker is a bug to fix by porting to the microVM backend (top of the backlog), never a reason to keep docker alive.The remote backend plane was removed (
remote add/list/info/rm,pillbox run --remote, thessh:///e2b:///docker://URL backends are gone). "Remote" returns as the managed tier (Cloudflare by default, optional DigitalOcean compute) — a different shape, built fresh against provider APIs, not a port of local docker (so docker earns no "twin" credit). Managed Pillbox is a single-controller execution runtime: Cloudflare's Sandbox Durable Object may own the container lifecycle, while bounded invocation claims live in D1, immutable evidence lives in R2, and collaboration belongs to Huddles. Pillbox must not introduce a custom Durable Object, remote §0 log, driver arbitration, replay broker, or per-delta storage. Seedocs/managed-tier.md,digitalocean/README.md, anddocs/durable-object-usage.md. Everything else (run, secrets, env, auth, vault, sessions, snapshots — and local detach/reattach) is current.
Mental model — one concept
A pillbox is a self-contained bundle of (workspace + code + vault + config). Users create pillboxes, then run agents against them.
| What it is | Where it lives | |
| global pillbox | One per OS user. Shared agent auth + fallback secrets/env. | ~/.pillbox/global/ |
| project pillbox | One per directory with pillbox.toml. Overrides global. | ~/.pillbox/projects/<dash-encoded-cwd>/ |
| pillbox.toml | Marks a directory as a project pillbox. Required field: name. | ./pillbox.toml (walks up from cwd) |
Top-level commands act on pillbox lifecycle (init/new/list/rm/info).
Per-pillbox commands act on the current pillbox (run/secret/env/auth/
vault/...). The current pillbox is resolved by walking up from cwd
looking for pillbox.toml. No descriptor found → global. The --pillbox
NAME flag overrides discovery to point at a specific named pillbox.
Quick start
# Bootstrap (one time)
pillbox init # creates ~/.pillbox/global/
pillbox auth login --agent claude # OAuth in a sandbox
# Create a project pillbox
cd ~/work/myapp
pillbox new --name myapp # writes pillbox.toml + state
# Use it
pillbox secret add ANTHROPIC_API_KEY # paste, then Ctrl-D
pillbox run # mounts cwd at /workspace/myapp
pillbox run --preset dev # …with a [preset.dev] from pillbox.toml (docs/config.md)Stop reading if that's all you need.
Where to look — the map
Read the canonical doc for a subsystem before changing it or claiming how it works. This map exists so you retrieve the right context instead of answering from a partial memory of a large project.
| You need… | Go to |
| Full CLI / command + flag reference | docs/commands.md |
| A load-bearing decision ("didn't we decide X?") | docs/decisions.md |
| System map + the entanglements that bite | docs/architecture.md |
| Backend / microVM substrate | docs/substrate-plane.md, docs/libkrun-sandbox.md |
| Vault (creds + egress) | docs/vault.md |
| Sessions / §0 event log | docs/session-event-log.md |
| Dispatch / eval | docs/dispatch.md, docs/eval.md |
How to work here
- Retrieve before asserting. Before stating how a subsystem works or changing it, read its canonical doc (map above) and the relevant code. The project is larger than one context window; guessing yields confident wrong answers.
- Code wins over docs. If a doc disagrees with the code, the code is right — fix the doc in the same change. A doc you can't trust is worse than none.
- Decisions are logged, not re-litigated. docs/decisions.md is the record. Changing one = a new dated entry there, never a quiet reversal in chat or a contradicting edit elsewhere.
- Backend = libkrun (the direction note above). Docker's backend is deprecated/slated for deletion — don't add features to it.
- Durable Objects are default-deny. Cloudflare Sandbox may use its own DO as
substrate; new Pillbox-authored DO classes require a ratified Brief amendment,
a per-operation read/write budget, retention bound, kill switch, and cost
telemetry before code. Never persist tokens, deltas, PTY frames, progress,
logs, or replay rows in a DO. Use D1 for bounded relational claims and R2 for
immutable/raw evidence. Run
node --test cloudflare-spike/do_usage_policy.test.mjswhen changing Cloudflare topology.
Context Vault (brief)
Architectural decisions live in .brief/docs/ as governance docs. Each has a stable
anchor (<!-- brief:anchor id -->), a status, and the code it governs (related_code
globs). A decision is addressable as doc://<project>/<doc-id>@latest#<anchor> — resolve
one with brief resolve <ref> to read the exact decision; don't infer it from the ref.
Decisions are ratified constraints, not editable notes. Develop to them:
- A decision with
status: activeis READ-ONLY to coding work. Do NOT edit it to make your change fit — your code conforms to the decision, not the reverse. - If
brief checkasks for a sign-off (only decisions markedsignoff: requireddo, and only when you touch the code under their// Context:comment) and your change STILL satisfies the decision, record<anchor-id> conforms: <reason>in.brief/SIGNOFF.brief triage(optional System One model) writes that line itself for the asks it rates as clearly conforming; read and answer the ones it leaves. - If the task CANNOT be done without changing a ratified decision, you may NOT change it
yourself. Write
.brief/amendments/<anchor-id>.md(what should change and why), record<anchor-id> amend-proposed: <reason>in.brief/SIGNOFF, and STOP — it needs human ratification before code can land. Never bypass the commit hook. - At each site that embodies a decision, leave a one-line comment:
// Context: doc://<project>/<doc-id>@latest#<anchor> — <the rule, in one line>. The ref makes it checkable; the one-line rule puts the constraint in front of the next agent exactly where it touches the code. Keep the full reasoning in the decision doc. - If your memory, notes, or habits disagree with an active decision, the decision wins: it is versioned and reviewed with the code, memory is not. Follow the decision and say which memory looked stale.
If the repo has a feature map (a .brief/docs doc with type: features), run
brief features <files> before changing code and read the Gotchas of each feature you
touch. When you move or delete code, update that feature's paths: in the same change;
when you hit a trap the next agent would hit too, add it to the feature's Gotchas.
Before committing, run brief check (resolve anything it flags) and brief pin
(freeze any @latest/@current refs you wrote to a concrete revision). CI runs the same
check on PRs — that is the backstop; don't bypass it.
After authoring/publishing a decision — or before opening a PR — run brief doctor
and close what it flags (wire a // Context: ref into governed code, pin a floating ref,
publish a draft you now rely on, re-verify a ref the latest revision made stale). It is
advisory, not a gate: it exists so you catch latent drift instead of leaving it for a
human to notice later.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

