SandCastle
TypeScript library by Matt Pocock for running Claude Code agents in parallel across isolated git worktrees and sandboxed containers. The production-grade implementation of the AFK parallelization pattern from the lean agentic workflow. GitHub: https://github.com/mattpocock/sandcastleWhat It Does
SandCastle manages the full parallel agent loop:Branch Strategy Taxonomy
SandCastle formalizes three deployment strategies as first-class parameters:
This is the first tool to formalize branch strategy as a parameter rather than a convention. Compare to Branch Strategy for Agents.
Provider Abstraction
Supports Docker, Podman, and Vercel sandbox environments. Designed so implementation agents run in container isolation without hitting the Anthropic ToS constraint that blocks Claude Code subscription keys in containers. Pocock’s workaround: run Claude Code on the host (subscription key), have SandCastle manage the worktree isolation. The containers are for tool execution, not the Claude process itself. Contrast with Dangeresque, which takes the host-native approach entirely.IterationUsage Telemetry
Each iteration reports token usage:Relation to Existing Wiki
- Lean Agentic Coding Workflow — SandCastle implements the AFK parallel pattern described there
- Dangeresque — host-native alternative; simpler setup, no container dependency
- Agent Harness — SandCastle is a harness implementation
- Ralph Loop — same loop pattern, different implementation
- Branch Strategy for Agents — branch strategy as a parameter
- Verification Pipeline — reviewer agent = verification gate