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.

  1. OrchestratorPlans the dispatch

    It names the role, the work and the size.

  2. JevPicks the price

    decide.py answers for a producer.

    DECIDED OR UNSURE
  3. price-gate.pyChecks the call

    A denied dispatch is not paid for.

    DENY, SWAP OR ALLOW
  4. Sub-agentRuns and reports

    It works inside its bounds.

  5. OrchestratorChecks the result

    unit-check.py compares 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.

87%of orchestrator spendCache reads. Measured on 2026-10-16 and 2026-10-17.
$0.15one main-loop turn at 300KThe estimate of the hook on opus: $0.50 per million tokens of context.
~30Ktokens to start one agentThe fixed entry price of a dispatch. Measured on 2026-10-13.
n²cost of a run of n turnsA rough rule. Split long work, and never split short work.

Share of spend, 2026-10-17

ft-developer33%
verifier20%
Java coding leaves18%
Main loop7%
Stack-neutral leaves7%
bugfix-agent6%
Measured$2152 in 20.5 hours, at notional list prices. The six roles shown make 91%.

Share of spend, 2026-10-29

verifier21%
bugfix-agent19%
ft-developer15%
Coding leaves14%
Main loop10%
ft-ui-ux-design10%
Measured$1351 in 23 hours, 81% on opus. The work differed between the two windows, so the change is no measured saving. All windows.

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. 1. Plan and pick

    The role decides who sets the price.
    • ProducerAsk Jev with decide.py. DECIDED gives source jev. After UNSURE, use the tables, with source self.
    • ReviewerThe lens table sets the model and effort. There is no Pick line and no Jev question.
    • Ops or researchft-ops, or general-purpose on sonnet.
  2. 2. price-gate.py checks

    The check runs before the dispatch is paid for.
    • DenyThe denial names every missing item. Fix the dispatch and send it again.
    • SwapThe dispatch runs with a changed model. tier-ab.jsonl logs it.
    • AllowThe dispatch runs as sent.
  3. 3. The agent runs

    It reports when it stops. turn-guard.py saves the final report of a coding leaf.
  4. 4. Check the DoD

    unit-check.py runs 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

bash
python3 ~/.claude/hooks/decide.py --kind tier,effort,split "<state of unit 1>" "<state of unit 2>"
Replace each state with the fixed template of its unit. The brief then carries the Size:, Raise: and Pick: lines.
  • The check counts new files too, with git status --porcelain. git diff alone does not show them.
  • A model that failed twice on a unit gets no third try.
  • The orchestrator honours a TIER_RAISE from 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-adversary or ft-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

  1. haikuThe brief specifies everything: named files and symbols, a precedent to copy, at most 3 files and ~60 lines.
  2. sonnetStandard work in one module: a new class on a known pattern, branching logic, more than ~60 lines.
  3. opusNo precedent, concurrency, a security surface, contract design, several modules, or behaviour the brief cannot state.

Effort: how much reasoning the unit needs

  1. lowTranscription: the brief names every edit and the precedent.
  2. mediumOrdinary choices inside a known pattern. This is the default when you are unsure.
  3. highReasoning: interacting conditions, failure paths, ordering, an open design choice.
  • The picks are independent

    A wide mechanical change is sonnet/low. A three-line fix to a retry condition is small but high.
  • Start at haiku

    Move up only for a signal you can cite: a file: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

    fable is refused except for a session the owner lists in fable-exception.json before its until time (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). xhigh and max run only when you ask for them.
Three lines in every producer brief
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>
Each source is 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

~400lines, or 10 filesThe hard cap per unit, except a set that does not build half-applied.
500lines, or 12 filesThe gate denies a larger Size: line, unless it says atomic.
~15tool callsBelow this prediction, nothing is split. Merge it instead.
8leaf dispatchesA slice, a child ft-developer, pays only from this number up.

Bounds for each model

haiku25 calls, 10 min
sonnet40 calls, 20 min
opus60 calls, 30 min

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.

PassLensesModelEffort
Judgment, first passSecurity, Correctness, Requirements-coverage, Performance, Visual/UX, and the test adversaryopushigh
Mechanical, first passAPI-contract, FT-standard or Architecture conformance, Clarity, Test-plan adequacysonnetmedium
Re-checkA lens that already ran reads the objection deltaThe model of its first pass, never cheapermedium

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 · cell for 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 blocking ID 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

Hand ops away rule~200K

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.

Ask for /compact note300K

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.

Automatic compaction600K

The setting autoCompactWindow governs the main loop and the sub-agents. No setting reaches the main loop alone.

Lane

Target after a resetunder ~110K

A resumed instance reads its HANDOFF block and only the files its entry stage needs. The target applies at its first dispatch.

Reset is due note250K

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

No more SendMessage deny200K

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.

Claude Code, the main loop past 300K
/compact keep: running agents with their ids, approvals waiting on the owner, open questions
A main loop cannot compact itself. Compacting keeps the session, so background agents still report to it.

How a lane sheds its context

  1. 1. Work

    The instance runs until it reaches a boundary.
  2. 2. Trigger

    9 dispatches by this instance, or the 250K note. Boundary A also opens after two design rounds.
  3. 3. Save

    Everything that the next stage reads is a file. The HANDOFF block names each path.
  4. 4. Return

    The instance returns CONTEXT_RESET - <journal path> and retires.Exit At resets 2, or earlier when the run is too big for one instance (over 9 dispatches at A, or one reset already spent), it returns SPLIT - <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.
  5. A fresh instance resumes from the journal: back to step 1

The five boundaries, in run order

  1. D

    Design rounds

    Between checkpoint-D rounds. The revised design brief is written.

  2. A

    Approved

    Stage 5 is approved, before the first Stage 6 dispatch.

  3. C

    Between units

    Inside Stage 6. The last report is saved, with no open repair.

  4. B

    Diff frozen

    The diff is frozen, before checkpoint F.

  5. R

    Review rounds

    Between checkpoint-F rounds. The repair batch is collected.

Which run may reset, and at which boundary

RunDACBR
Architecture-ledyesyesyesyesyes
TDD-ledyeswith a checkpoint Fwith 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 declare disallowedTools. 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

tier_ab: own opus pick. Closed for sonnet, 2026-10-20

opus$6.98

23 units. 30% were repaired. None climbed.

sonnet$2.42

18 units. 22% were repaired. None climbed.

tier_ab: doubtful Jev opus. Closed for sonnet, 2026-10-23

opus$11.89

15 units. 7% raised a tier. 47% left a DoD item unmet.

sonnet$5.46

15 units. 20% raised a tier. 47% left a DoD item unmet.

bugfix_ab: doubtful Jev opus. Closed for opus, 2026-10-27

opus$7.30

7 tasks, and all 7 were complete.

sonnet~$3

12 tasks, and 8 were complete. The saving was about $25 a day. Each of the other 4 handed back an open item.

repair_ab: fresh repairs. Closed for sonnet, 2026-10-29

opus$7.83

28 units. 4% climbed. 11% left a DoD item unmet.

sonnet$2.01

39 units. 8% climbed. 18% left a DoD item unmet.

host_ab: ft-fix-host. Closed for sonnet, 2026-10-29

opus$13.70

24 hosts. The bug tree of agents had a median of $65.6.

sonnet$4.50

18 hosts. The bug tree of agents had a median of $46.9. None climbed.

MeasuredOpen a bar for the sample and the quality figures. Samples are small, and each test closed on the date shown.

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 Skill listing. 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

Deny16problemsboundary_areset_caplane_capdesign_capreview_caplineage_chargeops_opusinteg_batchadversary_modellens_modelmajor_routehost_routeops_routeux_changecontinuation_cap
Swap9tier_abrepair_aborchestrator_abbugfix_abrefactor_abrecheck_abmech_lenshost_abinherit_pick
Note4context_notemain_notetouch_notelane_note

A 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

  • opussonnettier_ab: a coding first dispatch that the orchestrator picked itself after UNSURE, or a Jev opus under 0.9. A failed unit still gets its opus attempt.
  • opussonnetrepair_ab, host_ab, mech_lens: a fresh coding repair, a non-CRITICAL ft-fix-host, a mechanical lens.
  • opusJev's pickorchestrator_ab, bugfix_ab, refactor_ab: Jev picks the model of a whole run. UNSURE gives sonnet.
  • opussonnetrecheck_ab: a judgment-lens re-check, only on a DECIDED sonnet. Security and a CRITICAL brief stay on opus.
  • no modelsonnetinherit_pick: a general-purpose or Explore that 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?

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.

Every check, setting and measurementDispatch Economy Reference
How Jev answersDecision model (Jev)
The hooks and state filesAgent Harness
The termsGlossary
Open the reference