Dispatch Economy
A dispatch is one Agent call that starts a sub-agent. The toolkit prices each dispatch by the work it needs, and a hook checks the price before the dispatch starts. Watch one dispatch below. The long tables and the dated measurements are on Dispatch Economy Reference.
- OrchestratorPlans the dispatch
It names the role, the work and the size.
- JevPicks the price
DECIDED OR UNSUREdecide.pyanswers for a producer. - price-gate.pyChecks the call
A denied dispatch is not paid for.
DENY, SWAP OR ALLOW - Sub-agentRuns and reports
It works inside its bounds.
- OrchestratorChecks the result
unit-check.pycompares the work with the pick.
Where the money goes
Every turn re-reads the whole context of the agent. So cache reads are almost all of the spend, and a turn costs its context.
Share of spend, 2026-10-17
Share of spend, 2026-10-29
One dispatch, step by step
Two steps can stop a dispatch: the price gate before it starts, and the check of the definition of done (DoD) after it ends.
1. Plan and pick
The role decides who sets the price.- ProducerAsk Jev with
decide.py.DECIDEDgives sourcejev. AfterUNSURE, use the tables, with sourceself. - ReviewerThe lens table sets the model and effort. There is no Pick line and no Jev question.
- Ops or research
ft-ops, orgeneral-purposeonsonnet.
- ProducerAsk Jev with
2.
The check runs before the dispatch is paid for.price-gate.pychecks- DenyThe denial names every missing item. Fix the dispatch and send it again.
- SwapThe dispatch runs with a changed model.
tier-ab.jsonllogs it. - AllowThe dispatch runs as sent.
3. The agent runs
It reports when it stops.turn-guard.pysaves the final report of a coding leaf.4. Check the DoD
unit-check.pyruns the check and writes it to the journal.- MetThe unit is done.
- Not metOne repair on the same model, then a fresh dispatch one model up.
The Jev question, and what happens after a failed unit
python3 ~/.claude/hooks/decide.py --kind tier,effort,split "<state of unit 1>" "<state of unit 2>"
Size:, Raise: and Pick: lines.- The check counts new files too, with
git status --porcelain.git diffalone does not show them. - A model that failed twice on a unit gets no third try.
- The orchestrator honours a
TIER_RAISEfrom the agent without argument. - If the brief was wrong, the work goes back to the plan. A stronger model does not fix a wrong brief.
The rules are in Escalation.
Terms on this page
- A producer is a sub-agent that writes: a coding agent, or
ft-ui-ux-design. - A reviewer is a read-only sub-agent:
verifier,ft-test-adversaryorft-architecture-audit. - A lane is one running top-level orchestrator.
- A unit is one bounded piece of work for a coding agent.
- A Pick line is the line in a producer brief that names the model, the effort and their sources.
- Jev is the external decision model. See Decision model (Jev).
Model and effort: two picks on every dispatch
Every producer dispatch names both values. A missing value would pay the default of the agent, so the gate denies the dispatch.
Model: how much the brief leaves open
- haikuThe brief specifies everything: named files and symbols, a precedent to copy, at most 3 files and ~60 lines.
- sonnetStandard work in one module: a new class on a known pattern, branching logic, more than ~60 lines.
- opusNo precedent, concurrency, a security surface, contract design, several modules, or behaviour the brief cannot state.
Effort: how much reasoning the unit needs
- lowTranscription: the brief names every edit and the precedent.
- mediumOrdinary choices inside a known pattern. This is the default when you are unsure.
- highReasoning: interacting conditions, failure paths, ordering, an open design choice.
The picks are independent
A wide mechanical change issonnet/low. A three-line fix to a retry condition is small buthigh.Start at haiku
Move up only for a signal you can cite: afile:line, a section of the design brief, a count.An opus signal goes straight to opus
Security or contract design never goes through a cheaper model to see whether it fails.The ends of the scale
fableis refused except for a session the owner lists infable-exception.jsonbefore itsuntiltime (only the owner edits that file): the owner's live fable window was retired on 2026-11-06, about 2x the cost with no measured gain (~/.local/state/ft-ai-toolkit/run/2026-11-06-fable-ab-final.md).xhighandmaxrun only when you ask for them.
Size: files <n> · lines ~<n>
Raise: <the signals that make the receiver stop and return TIER_RAISE: <model> - <signal>>
Pick: <model>/<effort> - <model source>/<effort source>
jev, self or override. A self adds (unsure: <tier|model|effort>). An override adds : <cited signal>. Example: Pick: sonnet/medium - jev/self (unsure: effort).How large one unit may be
Size: line, unless it says atomic.ft-developer, pays only from this number up.Bounds for each model
Slices run one after another on the same working tree. The rest is in Unit size.
Review dispatches: priced by the lens
A review dispatch names a model and an effort too. The table decides, and price never removes a reviewer.
| Pass | Lenses | Model | Effort |
|---|---|---|---|
| Judgment, first pass | Security, Correctness, Requirements-coverage, Performance, Visual/UX, and the test adversary | opus | high |
| Mechanical, first pass | API-contract, FT-standard or Architecture conformance, Clarity, Test-plan adequacy | sonnet | medium |
| Re-check | A lens that already ran reads the objection delta | The model of its first pass, never cheaper | medium |
A material revision re-runs lenses as first passes. A CRITICAL change raises a mechanical lens to opus. You still send opus on a judgment-lens re-check. The hook may lower it to sonnet only on a DECIDED sonnet from Jev, as Swaps shows.
Four rules that cut review rounds
- Round 1 runs the whole lens set. No lens waits for a later round.
- A revision closes the class. The re-check brief carries
<ID> closed · fix · siblings · prose · cellfor each objection. - The gate list comes from grep. It adds every test class that references a touched package or scans source trees.
- One pass, every finding. Only a
blockingID refutes. The orchestrator fixes every open ID of the round in one batch.
The full text is in Review dispatches.
What context costs, and when it shrinks
The orchestrator itself is the largest single cost. Each kind of agent has its own lines. Open a bar to see what happens at that line.
Main loop
A standing rule, and no hook enforces it. Rebases, merges and CI checks go to one ft-ops. Approvals and design choices stay with the main loop.
The gate adds a note to a main-loop dispatch, once per 50K of growth. It asks you to type /compact. In Terminal.app, main-compact.py types the command for you. The details.
The setting autoCompactWindow governs the main loop and the sub-agents. No setting reaches the main loop alone.
Lane
A resumed instance reads its HANDOFF block and only the files its entry stage needs. The target applies at its first dispatch.
The gate adds a note to the next dispatch. From then on, the trigger of every boundary holds. FT_RESET_CTX sets the line.
Leaf
The gate denies a continuation. Dispatch a fresh agent on the same model, with the delta and the path of the saved report. Four orchestrators and general-purpose are exempt.
/compact keep: running agents with their ids, approvals waiting on the owner, open questions
How a lane sheds its context
1. Work
The instance runs until it reaches a boundary.2. Trigger
9 dispatches by this instance, or the 250K note. Boundary A also opens after two design rounds.3. Save
Everything that the next stage reads is a file. The HANDOFF block names each path.4. Return
The instance returnsCONTEXT_RESET - <journal path>and retires.Exit Atresets 2, or earlier when the run is too big for one instance (over 9 dispatches at A, or one reset already spent), it returnsSPLIT - <journal>at A or C. Each pending unit group then runs in its own fresh group instance, and one merge instance follows when every group is back.- A fresh instance resumes from the journal: back to step 1
The five boundaries, in run order
- D
Design rounds
Between checkpoint-D rounds. The revised design brief is written.
- A
Approved
Stage 5 is approved, before the first Stage 6 dispatch.
- C
Between units
Inside Stage 6. The last report is saved, with no open repair.
- B
Diff frozen
The diff is frozen, before checkpoint F.
- R
Review rounds
Between checkpoint-F rounds. The repair batch is collected.
Which run may reset, and at which boundary
| Run | D | A | C | B | R |
|---|---|---|---|---|---|
| Architecture-led | yes | yes | yes | yes | yes |
| TDD-led | yes | with a checkpoint F | with a checkpoint F | ||
| Simple addition |
may reset only when the run has a checkpoint F
The launch prompt must say Resets: handled, and /ft-dev adds that line. The gate denies a relaunch whose HANDOFF shows resets 3 or more. A bugfix lane keeps its cap of 3. A group instance and the merge instance start their own count at resets 0 and reset at most twice (Reset budget: 2, FT_GROUP_RESETS). The merge instance enters at Stage 7 (boundary T), so the assembled diff still gets its baseline gate, simplicity pass and test adversary before the freeze. A lineage holds at most 10 instances (FT_LINEAGE_MAX) and a declared budget of at most 30 agent-runs, lifted only by a launcher's raise line. The full rules are in The orchestrator's own context and Lineage bounds.
Checkpoint D ends at round 3
The gate denies round 4 or later. Each open blocker becomes a checkpoint-F cell or a Stage 5 question. A redesign is a new run.A one-hour cache for long waiters
Orchestrators,ft-ops and coding agents wait longer than five minutes. Each cache expiry rewrites their whole context.Leaves carry no unused tools
Coding leaves declaredisallowedTools. The Skill listing alone is about 8K tokens.What was measured, and what it saved
Every figure here is a dated measurement at notional list prices. None is a current value. Four tests closed for sonnet, and one closed for opus.
Median cost: opus against sonnet
Other changes, before and after
- ~$20 an hour~$3.8 an hourCache rewrites in one session after the one-hour cache, 2026-10-14.
- $0.27 a turn$0.08 a turnA main loop at about 540K against a fresh one at about 150K, 2026-10-23.
- $42.1$8.2Median orchestrator past approval, opus against sonnet, 12 runs each. DONE was 1 against 4, 2026-10-20.
- 23.4K12.4KFirst turn of a sub-agent without the
Skilllisting. A probe, 2026-10-14.
Three cases set the limits. Eight oversized units cost $229 on 2026-10-27. One coder grew to 564K tokens and cost $43. One lane grew from 113K to 711K tokens during its design rounds.
Every number with its method is in Evidence and in deploy/evals/dispatch-economy-evidence.md.
When the price gate denies your call
The denial names what is missing, and the dispatch is not paid for. Find your denial, make the change, and send the call again.
No model or effort → name both on the call
The pricing checks act when ft-developer or bugfix-agent dispatches. A review dispatch needs both values too. haiku is never valid on a review role.
No Size:, Raise: or Pick: line → paste the lines
The denial ends with the lines to paste. Fill the placeholders. The model and the effort in Pick: must equal the call.
Never called decide.py → ask Jev first
Run decide.py, or cite the answer of an earlier instance with (recorded: <journal path>). A model override to haiku is denied too.
Size: over the unit cap → split it
Split by file set, with tests in each part. A set that does not build half-applied is one unit, and its line says atomic: <why>.
A judgment lens below opus → model: opus
The same holds for the test adversary, from any caller. The adversary leaves opus only with a Pick: line that cites a Jev answer. In a session the owner granted in fable-exception.json, a lens or the adversary may also run on fable; outside a granted session fable stays denied.
A re-check with no closure line → add one per objection
Write <ID> closed · fix <file:line> · siblings ... · prose ... · cell <test>. A lens with nothing of its own to re-check says Closure: n/a - <reason>, the reason one of first pass of this lens, no objection of yours is open, SOUND in round <n>, re-run because the revision touched <area>.
Too many lanes → FT_MAX_LANES
The gate denies a new top-level orchestrator while 6 are running. Start it when a lane hands back, or raise the setting. The lane cap.
Checkpoint D, round 4 → stop the rounds
No ruling extends the cap. Turn each open blocker into a checkpoint-F cell or a Stage 5 question.
First Stage 6 unit denied → CONTEXT_RESET
The boundary-A trigger holds on an opus instance. Reset there. The denial comes once, so the same dispatch passes on a second send if a reset is not allowed.
A relaunch at resets 3 → drop Resets: handled
Let the instance finish without a reset, or split the work. A launcher never raises the cap. A group or merge instance is denied past more than 2 resets.
Denied: run-cost exhausted → Run-cost raise: <new total> · by <who>
The lineage has used its agent-run budget. Reviews are never denied. Only the launcher raises the budget, with the line that the denial prints. The number is the new TOTAL, never the increment: budget 30 plus 24 more runs is Run-cost raise: 54. Send it on its own line to the agent id of the ft-developer. If the line is a no-op, is unparsable, has a list marker or emphasis before it, or targets an agent that is not a top-level ft-developer, the hook refuses the message and prints the corrected line. A mid-line or >-quoted mention is only noted. A line that a sub-agent sends changes nothing. If a raise is recorded, the denial says “raised total N”, or “it lifted nothing”.
SendMessage to a leaf over 200K → dispatch a fresh one
Use the same model and effort. Send only the delta and the path of the saved report. Describe it as <unit> repair (fresh).
Ops work on the wrong agent → ft-ops
A general-purpose ops batch, or 3 or more merged branches in a coding or bugfix lane, goes to ft-ops. Send ft-ops with no model. An Integration: <why> line keeps a merge in one lane.
opus on a search or batch → sonnet
A general-purpose or Explore on opus needs a line Opus: <why> in the brief.
A MAJOR or CRITICAL bug → /ft-fix
The main loop sends it through /ft-fix, hosted by ft-fix-host. A lane that is really MINOR says MINOR in its brief.
A large Mode: change → /ft-dev
ft-ui-ux-design sent from the main loop is one unit and needs a Size: line within the cap. A larger build goes to /ft-dev.
All 29 checks, by kind
problemsboundary_areset_caplane_capdesign_capreview_caplineage_chargeops_opusinteg_batchadversary_modellens_modelmajor_routehost_routeops_routeux_changecontinuation_captier_abrepair_aborchestrator_abbugfix_abrefactor_abrecheck_abmech_lenshost_abinherit_pickcontext_notemain_notetouch_notelane_noteA swap lets the dispatch through with a changed model, and the first swap that applies wins. A note adds context and denies nothing. Each check, with its setting, is in Every check, in the order it runs.
Swaps: the model that really runs
- opussonnet
tier_ab: a coding first dispatch that the orchestrator picked itself afterUNSURE, or a Jevopusunder 0.9. A failed unit still gets its opus attempt. - opussonnet
repair_ab,host_ab,mech_lens: a fresh coding repair, a non-CRITICALft-fix-host, a mechanical lens. - opusJev's pick
orchestrator_ab,bugfix_ab,refactor_ab: Jev picks the model of a whole run.UNSUREgivessonnet. - opussonnet
recheck_ab: a judgment-lens re-check, only on aDECIDED sonnet. Security and a CRITICAL brief stay onopus. - no modelsonnet
inherit_pick: ageneral-purposeorExplorethat names no model.
The triggers and settings are in Swaps. tier-ab.jsonl keeps every pick, and deploy/evals/tier-ab-report.py reads it.
Questions about the dispatch economy
The questions that remain after a denial or a high bill.
Can a swap remove a reviewer?
No. A swap changes the model of a dispatch. It never changes which lenses run.
What happens when the gate itself fails?
The gate fails open: an error of its own denies nothing, except for the trivial fix and the delta fix, whose admission checks fail closed to FIX_LANE. python3 ~/.claude/hooks/price-gate.py --selftest runs its cases offline.
Why compact, and not a fresh session?
Background agents report to the session that launched them. Compacting keeps that session, and a fresh session loses them.
Can main-compact.py hit my draft?
main-compact.py hit my draft?It types nothing while you typed within the last 30 seconds. It reads the idle time once. If you start typing in the 4 seconds that follow, the two Enter keys submit your draft.
Why does the gate deny the lane that the nudge asks for?
The cap of 6 counts top-level orchestrators. The target in lanes <running>/<target> counts every running background agent. Set FT_MAX_LANES to at least the number of orchestrators that you want.
How do I turn a swap off?
FT_TIER_AB=0 turns off six swaps. FT_REPAIR_AB=0, FT_HOST_AB=0 and FT_MECH_LENS=0 turn off the other three.
Related pages
Each page holds the part that this page only names.