SpecAgent: multi-session Claude Code pipeline with measured 3x context cost savings

AdOtherwise9458 · reddit · 2026-11-05

A developer open-sourced SpecAgent, an Apache 2.0 project template for Claude Code targeting large multi-package projects where one context window can't hold the work. Instead of subagents, each role (spec writer, planner, critic, builders, verifier, judge) runs as its own background session with its own context window, worktree, sandbox and transcript; stages advance only when code checks pass, findings require proof, plan-caused issues route back to the planner, and sessions hand off via written notes so a watcher can restart crashed sessions from files.

Measured findings: unrestricted context grew calls to 500-740k tokens at 3x the cost of fresh sessions (now compacting near 197k); after ten calls a session hit 81k tokens with 84% being tool results; prompt caching is byte-exact — keeping a role's prompt prefix identical yields 98% cached input, while changing one byte invalidates everything after it. The template built itself in one run: 22 sessions, 3h12m, one in-run fix, 1,874 tests passing. Repo: github.com/ghvinashvili/specagent

Original post →

More from coding & agent

coding & agent channel →