Skip to content

About

Plan with your best model, execute with your cheapest. A Project Manager + Programmer agent pair bound by a strict handoff contract.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

manager-worker-agents — plan with your best model, execute with your cheapest

manager-worker-agents

Plan with your best model. Execute with your cheapest.
Two agents and one hard contract — so the cheap model can't wander.

License: MIT Dependencies: none Harness: OpenCode + Claude Code PRs welcome


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.

The problem

  • 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 fix: a contract, not a vibe

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.

Two agents

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

Pick your tier — honestly

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.

Quick start

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-run to preview, --force to 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

⚠️ Then set two models — required

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.

Enforced, not just requested

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.

A round, end to end

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.

One source of truth

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.

Contributing

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.

License

MIT © 2026 Irhamullah

About

Plan with your best model, execute with your cheapest. A Project Manager + Programmer agent pair bound by a strict handoff contract.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages