Agent orchestration engine for Claude Code. Makes AI coding sessions more disciplined, verified, and continuous across sessions.
- Context window cliff. Complex features hit context limits around task 7-8. Everything learned is lost.
- No verification loop. Claude Code declares success based on self-assessment. No external typecheck/test/lint enforcement.
- No structured retry. When tasks fail, humans manually reconstruct context.
Four layers, each delivering standalone value. Built bottom-up.
Layer 3: Rust Daemon ← subprocess management, queue, HTTP API, parallel via worktrees
Layer 2: CLI Orchestrator ← multi-task plans, dependency ordering, sequential execution
Layer 1: Session Wrapper ← external verification, retry with model escalation, state tracking
Layer 0: Claude Code Plugin ← hooks, skills, agents, rules — inside Claude Code itself
Layer 0 is shipped and dogfooded. Layers 1-3 are planned.
Requires Claude Code.
# In Claude Code:
/plugin marketplace add si-klyde/foundry
/plugin install foundry@foundryFor local development:
claude --plugin-dir /path/to/foundry/packages/layer0Migrating from legacy install.sh? Run bash packages/layer0/migrate.sh first.
| Hook | Trigger | What it does |
|---|---|---|
| SessionStart | Session open/resume | Injects rules, progress state, handoff notes from previous session |
| PostToolUse | After Write/Edit | Typecheck on .ts edits, quality gates (console.log/debugger), session logging |
| PreToolUse | Before Write/Edit | Scope enforcement against active plan, warns on out-of-scope edits |
| Stop | Session end | Session audit, auto-handoff note, doc gardening sweep |
| Skill | Purpose |
|---|---|
/foundry-init |
Initialize Foundry in a project (config + optional cascading docs) |
/foundry-plan |
Structured planning workflow |
/foundry-verify |
Run verification pipeline (typecheck/lint/test) |
/foundry-progress |
Track tasks, decisions, blockers across sessions |
/foundry-checkpoint |
Atomic: verify + review + commit + progress update |
/foundry-handoff |
End-of-session handoff with context preservation |
/foundry-status |
Project overview (plan progress, changed files, decisions) |
/foundry-codemap |
Generate project structure map |
/foundry-context |
Smart context loading for unfamiliar code areas |
/foundry-learn |
Extract reusable patterns to .foundry/learned/ |
/foundry-compact |
Strategic compaction at phase boundaries |
/foundry-parallel |
Git worktree for parallel work streams |
/foundry-benchmark |
Session effectiveness metrics |
/foundry-review |
Code review via subagent |
/foundry-clean |
Cleanup pass via refactorer subagent |
| Agent | Role |
|---|---|
foundry-planner |
Read-only planning and decomposition |
foundry-verifier |
Run verification checks only |
foundry-reviewer |
Code review against criteria |
foundry-context-builder |
Build context summaries |
foundry-refactorer |
Cleanup with write access |
workflow.md · scope.md · quality.md · context.md · git.md · delegation.md · integration.md (conditional)
Start session → rules + progress injected automatically
→ /foundry-plan (design before coding)
→ implement (TDD, continuous typecheck)
→ /foundry-checkpoint (verify + commit + update, repeat)
→ /foundry-handoff (end session, preserve context)
- The system runs the model, not the reverse. The harness controls what task, what context, what verification, when to stop.
- File-system-as-state. Progress persists to files, not in any agent's context window.
- External verification is non-negotiable. The agent's opinion about whether code works is irrelevant.
- No API key dependency. Everything goes through
claude --print. NoANTHROPIC_API_KEYneeded. - Context engineering is the primary cost and quality lever. What you put in the prompt matters more than which model you use.
foundry/
├── .claude-plugin/ ← marketplace manifest
├── packages/layer0/ ← Claude Code plugin (hooks, skills, agents, rules)
├── docs/
│ ├── foundry-harness-prd-v3.md
│ ├── progress.md
│ └── decisions.md
└── CLAUDE.md ← project context router
| Milestone | Status |
|---|---|
| Layer 0 — Claude Code plugin | Done, dogfooded |
| Cascading context system | Done |
| Superpowers integration | Done |
| Plugin packaging | Done |
| Layer 1 — Session wrapper CLI | Planned |
| Layer 2 — Plan orchestrator | Planned |
| Layer 3 — Rust daemon | Planned |
Personal project by Growgami.