sandcastle (mattpocock/sandcastle)
Searching Database…
9.2K ·GitHub
What is this?
Sandcastle is a TypeScript library for orchestrating AI coding agents, like Claude Code, inside isolated sandboxes: you kick off a run with a single sandcastle.run() call and the resulting commits get merged back to your repo automatically.
Is this a library I call from code, or a standalone CLI app?
It is mainly a TypeScript library you call programmatically with run(), interactive(), or createSandbox(); the only CLI part is the init scaffolder that sets up config files for you.
How do I get it running?
Install the package, run npx @ai-hero/sandcastle init to scaffold a .sandcastle directory, fill in your tokens in .sandcastle/.env, then run .sandcastle/main.ts with npx tsx.
What do I need installed before I start?
You need Git plus a sandbox provider such as Docker Desktop, Podman, or Vercel's Firecracker microVMs, and either a CLAUDE_CODE_OAUTH_TOKEN (from claude setup-token) or an Anthropic API key.
Can I skip the sandbox entirely if I don't want container isolation?
Yes, the noSandbox() provider lets the agent run directly on the host instead of inside a container, which is convenient but drops the isolation safety net the project is built around.
What built-in sandbox providers does it ship with?
Docker, Podman, and Vercel (Firecracker microVMs via @vercel/sandbox) are built in, and you can create your own using createBindMountSandboxProvider or createIsolatedSandboxProvider.
What's the point of createSandbox() instead of just run()?
createSandbox() spins up one container you reuse across multiple agent runs on the same branch, keeping installed dependencies and build artifacts alive between calls, while run() is for a single one-shot invocation.
How do changes from the agent get back into my repo?
Commits made in the sandbox on its branch merge back to the host repo; using await using triggers automatic cleanup, preserving the worktree if changes are uncommitted or removing it when clean.
What are similar projects?
ruflo, agentbox, open-multi-agent, trueforge, open-swe, deer-flow, eve, mission-control
Which topics is it in?
vercel, harness, javascript-library, sandbox, ci, orchestration, git, agent-orchestration, devops, cloud, anthropic, coding-agent