● refactoringbuilding/projects/cstack · v0.1
cstack
open source · MITOne set of rules, hooks and skills shared by six coding agents: Claude Code, Codex, OpenCode, DeepSeek, Kimi and Grok Build. It is the setup I run every day, and which model does which job is decided by benchmarks, not habit.
6
coding agents, one layer
2.7×
cheaper per task, low vs extra-high effort
The problem
I run several agent sessions on the same repos at once, across more than one coding agent. Each tool wants its own rules file, its own skills and its own hooks, and several copies kept in step by hand drift apart. Sessions could edit the same file without knowing about each other. And subagents inherited whatever effort the session ran at, so tokens went on the most expensive setting without anyone deciding they should.
The fix
cstack keeps one copy of everything. Claude Code links the rules and skills directly; a sync script writes each of the other agents its own rules file, links the same skills and points it at the same hooks, so a guardrail learned in one session applies in all of them. Then I measured: a routing benchmark built from real work with planted bugs, and a bake-off on real commits from one app. Most of the routing rules in the README come from those runs.
System shape
rules/one source rules file; each agent gets its copy from it
hooks/claims, queues, guardrails, memory recall, alerts
skills/_core/token economy, tool scoping, and a loader for the rest
scripts/sync-agents.pywrites the other agents their AGENTS.md, skills and hooks
scripts/second_opinion.pycalls outside models, sandboxed and policy-checked
bakeoff/run the same model bake-off on your own repo
The rule that holds it together: rules, skills and hooks live once, and every agent gets them by link or by generated file. Changing a rule means changing one file and running the sync.
Engineering details
measured routing over one model for everything
Subagents run Opus at low effort, always pinned. In the routing benchmark, Opus 5 at low effort scored 96-100% on every task, against 100% at extra-high, for $0.33 a task instead of $0.90. Coding that a test can judge goes to cheaper models. Most rules in the table come from these runs; the README marks the few that are estimates.
reviews on the diff over a reviewer that explores the repo
Every code change gets an outside review before it counts as done. Codex does the review, so it costs almost no Claude usage. The script sends only the git diff with a findings-only brief, which keeps the reviewer from wandering the repo.
file claims between sessions over hoping two sessions never collide
Several agent sessions often work on one repo at once. A hook claims each file a session edits and blocks a second session from editing it in the same worktree. Status notes and their history show what was already done or tried.
hooks that fail open over hooks that can block work
A broken script never stops a session. The cost is that a fresh install has to be checked by hand, which the README says plainly.
Stack
AgentsClaude Code · Codex · OpenCode · DeepSeek · Kimi · Grok Build
CodePython · Shell
InframacOS launchd · sandbox-exec · kitty