Sandcastle is a TypeScript library that runs AI coding agents inside isolated sandboxes and merges their branch changes back into a project. It is used to run agents in parallel, build review pipelines, or coordinate agent work through providers such as Docker, Podman, or Vercel.
Borrowing it
Nothing to install: this file belongs to mattpocock/sandcastle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/mattpocock/sandcastle/main/CLAUDE.mdgit clone --depth 1 https://github.com/mattpocock/sandcastleWrote 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.
[](https://agentmods.dev/instructions/mattpocock/sandcastle/claude-md)<a href="https://agentmods.dev/instructions/mattpocock/sandcastle/claude-md"><img src="https://agentmods.dev/badge/instructions/mattpocock/sandcastle/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.
<a href="https://agentmods.dev/instructions/mattpocock/sandcastle/claude-md"><img src="https://agentmods.dev/badge/instructions/mattpocock/sandcastle/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01286 | $0.01286 |
| Opus 5.5 | $0.00514 | $0.00514 |
| Sonnet 5.5 | $0.00257 | $0.00257 |
| Haiku 4.5 | $0.00129 | $0.00129 |
Grade A, and why
sandcastle CLAUDE.md scanned grade A with 0 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 3d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 42 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Use npm run typecheck for type checking. Before you finish a change, run npm test, then the verify skill on the agent × sandbox combination it touches.
tsc is TypeScript 7 (the @typescript/native alias of typescript@7). The typescript package name is an alias of @typescript/typescript6, because TypeScript 7 has no JS API and tsup's declaration build still requires one. Don't import typescript in our own code, and drop the alias once tsup no longer needs it.
Releasing: before merging the changesets Version Packages PR, run npm run test:local (real Docker and Podman; CI never runs it). See docs/agents/releasing.md.
Check ./GLOSSARY.md for terminology questions.
For user-facing changes, add a changeset to .changeset. Check all changesets there first to see if there are duplicates. We use @changesets/cli, but you can create/edit the file manually. Make all bugfixes patch, all new features or breaking changes minor (since we're pre-1.0). Use package.json#name for the name.
When changing public-facing behavior, check the user docs in docs/guide/ to see if they need updating.
User docs
The user docs are the markdown pages in docs/guide/. aihero.dev/sandcastle renders them as a docs site, and README.md links to them.
- One page per major term in
GLOSSARY.md, atdocs/guide/<slug>.md, with its related terms folded in. The file name is the page's URL:docs/guide/prompts.mdisaihero.dev/sandcastle/prompts. The first line is the page's# Title, and its sections are##and below. - A term page opens with a short runnable example, then the details, then a
## Related termslist of links. It does not repeat definitions: those live on one page. docs/guide/glossary.md(last in theReferencegroup) defines each user-facing term for readers, one## Termentry each, in alphabetical order. It is hand-written, not copied:GLOSSARY.mdstays the agents' source, and each entry's name must be a termGLOSSARY.mddefines. When a term is added, renamed or changes meaning inGLOSSARY.md, update its entry.- On every other guide page, the first mention of each glossary term links to its entry (
[worktrees](./glossary.md#worktree)). A mention is the entry's name, whole word, case-insensitive, plural allowed (-s,-es,-yto-ies), outside code, headings and other links; a hyphen joins words, sono-sandboxis not a mention ofsandbox, and a longer term wins, soagent provideris not a mention ofagent. If a word is a mention by these rules but means something else (an interactive "prompt"), reword it. - Explain each term once in the guide, at its home: its first mention on the earliest page in
toc.jsonorder that mentions it. Weave one or two plain sentences into the prose there (keep the link); every other page only links it. Each glossary entry endsFirst explained in [<Page title>](./<page>.md). - Never reference ADRs from the user docs (
docs/guide/,README.md): nodocs/adr/links, no "ADR 0018". Keep any reasoning a reader needs in plain words. - The
toc.jsongroups followGLOSSARY.md's groups. The start page (getting-started) and theReferencegroup (run, everyRunOptionsoption and result field,cli, andglossary) are not term pages. Each option is explained on its term page, and listed once in the reference. docs/guide/toc.jsonorders and groups the pages for the sidebar.startis the page a new reader opens first.groupslists every other page as{ "title": "...", "pages": ["slug", ...] }, in sidebar order.- To add a page, write
docs/guide/<slug>.md, add its slug to a group intoc.json, and link it from the Documentation list inREADME.md. Renaming or removing a page touches the same three places. - Link between pages with relative paths (
./prompts.md#built-in-prompt-arguments), and to other repo files relative to the page (../../src/sandboxes/docker.ts). tests/docs-guide.test.tsfails when the three drift apart: a page missing fromtoc.jsonorREADME.md, a listed page with no file, a page without its# Title, a glossary entry whose nameGLOSSARY.mddoes not define, aglossary.md#…link anywhere indocs/or the README to an entry that does not exist, a first mention of a glossary term that is not linked, a glossary entry whoseFirst explained inline does not name its home, an ADR reference in the user docs, or a relative link to a file or a guide heading that does not exist.
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.
- 3d ago Changed · +8 lines · +616 tokens per session 4f1867925d79
- 4d ago Changed · +10 lines · +328 tokens per session 0367df8ef70f
- 5d ago Changed · +2 lines · +83 tokens per session 3cc34d00da43
- 6d ago Changed · +26 tokens per session b3721a780eba
- 2mo ago First seen · 22 lines · 233 tokens per session scan A 336a6442a970
sandcastle CLAUDE.md is an instructions file published in the GitHub repository mattpocock/sandcastle (8,876 stars, last pushed yesterday), licensed MIT. It adds 1,286 tokens to every session, about $0.0051 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
sandcastle CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| sandcastle CLAUDE.mdmattpocock/sandcastle | Instructions file | 8.9k | yesterday | MIT | A | 1,286 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |