Plan with your best model. Execute with your cheapest.
Two agents and one hard contract — so the cheap model can't wander.
Your agent burns most of its tokens doing — editing files, running commands — not thinking. This repo pays your strongest model to think, and your cheapest model to do. Between them sits a contract that stops the cheap one from guessing.
If your worker costs about as much as your planner, you've lost the point.
- Execution is the bill. Planning is a sliver of the tokens; the mechanical edits are the bulk.
- A cheap model left alone leaks. Give it a vague task and it greps the repo to find the file, invents its own test, and drifts outside the work — burning exactly what you tried to save.
- One strong model for everything is expensive precisely where it doesn't need to be smart.
The Project Manager hands the Worker two things and nothing else:
Allowed Files: <exact paths> # touch nothing else
Verify Command: <one command> # run exactly this, report its exit code
The worker touches nothing outside that list, runs exactly that one command, and returns evidence — it can never approve its own work. If either field is missing, it stops instead of scanning. That single rule is where the savings come from.
| Role | Agent | Model class | Does |
|---|---|---|---|
| Planner | project-manager |
strongest reasoning | architecture, spec, delegation, verification, approve/reject |
| Worker | worker |
cheapest, fastest | edits the allowed files, runs one verify command, reports evidence |
Full rules → CONTRACT.md · Worked round (with a BLOCKED case) →
examples/delegation-round.md
| Tier | Harness | What you get |
|---|---|---|
| 1 | OpenCode · Claude Code | a real subagent split, a different model per role → cost win |
| 2 | any harness that reads AGENTS.md |
the contract as discipline only → no cost win |
Tier 1 is where the money is saved — a second model actually runs the work. Tier 2 gives you the discipline and nothing else. Be honest about which one you have.
Zero dependencies — bash and POSIX tools only. One command, then set two models.
git clone https://github.com/irhamullah/manager-worker-agents
cd manager-worker-agents
bash scripts/install.sh opencode # -> ~/.config/opencode/
bash scripts/install.sh claude-code # -> ~/.claude/
bash scripts/install.sh generic # -> ./AGENTS.md (Tier 2)--dry-runto preview,--forceto overwrite an existing agent file.- The installer never clobbers silently: collisions are backed up, and re-running is idempotent.
Per-harness notes:
opencode ·
claude-code ·
generic
Nothing pays off until you do. Put your strongest reasoning model on the manager and your
cheapest fast model on the worker → docs/models.md.
On OpenCode the contract is bound at the harness level through agent permissions: the
project-manager may reach only the worker subagent, and worker may reach no
subagent at all. The rule holds even when the model forgets it. Where a harness has no such
mechanism, the contract stands on discipline alone — see
Enforcement.
Manager -> TASK: Fix pagination off-by-one
Allowed Files: src/pagination.ts, tests/pagination.test.ts
Verify Command: npm test -- pagination
Worker -> STATUS: DONE
Files changed: src/pagination.ts — fixed the slice offset
Verify: npm test -- pagination -> exit 0
Output: 4 passed
Manager -> APPROVE — verify green, scope matches
At most one review pass. No cosmetic rounds — those are the leak this pattern exists to close.
CONTRACT.md and roles/*.md are canonical; everything under harnesses/ is generated from
them by scripts/build-adapters.sh, with a --check drift guard. The shipped agents can never drift
from the rules.
See CONTRIBUTING.md. Definition of done: bash scripts/test-all.sh green and
bash scripts/build-adapters.sh --check clean. Release checklist: docs/smoke-test.md.
MIT © 2026 Irhamullah