agenting
Subagents let one session use several model tiers at once. This plugin makes that deliberate.
A PreToolUse gate refuses to run a Workflow until every agent() call carries an explicit model and effort, and a second guard denies an Agent start that would take its tier by accident. In manual mode it then asks you to approve the routing plan, offering cheaper and higher quality, not just cheaper. When a Workflow finishes, a second hook checks its journal and warns if any agent never returned.
The problem
Inside a workflow script, agent(prompt) with no opts.model / opts.effort inherits the main-loop model and the session effort. Nothing warns you.
Measured on one machine, 2026-08-06: a 16-agent research workflow burned 4.45M subagent tokens (~$320 at Opus list rates) because every agent() call omitted both options. Three of those agents did nothing but count files.
On the same machine, across ~45k API calls: Opus was 44% of calls but 82% of cost.
The insight that shapes the design
Your main session runs at one model and one effort. Subagents are the only way to use several at once:
SESSION: sonnet / medium ← fast, cheap baseline for the conversation
├─ agent(…, {model:'haiku', effort:'low'}) ← reach DOWN: don't spend sonnet on counting
└─ agent(…, {model:'opus', effort:'xhigh'}) ← reach UP: buy Opus only where it earns it
So this is not a cost-cutting tool. Which direction is risky depends on where your session sits:
| Session tier | Real risk | The gate leads with |
|---|
| opus / xhigh | over-spending on trivial work | "drop these to haiku?" |
| sonnet / medium | under-powering a hard task | "raise the synthesis step to opus?" |
The gate never offers only "cheaper."
What it does
Stage 1: routing. Any agent() call missing model/agentType or missing effort blocks the Workflow, naming the offending line numbers. No mode bypasses this.
Stage 2: plan approval. In manual mode, even a fully routed Workflow blocks until you approve this particular routing plan in this session. Re-running the same plan is silent; changing any tier asks again. In auto mode (the default) Claude decides the plan itself and the gate steps aside.
STAGE 2/2 — PLAN APPROVAL: 9 agent() call sites, all routed. Waiting on the user
(mode is manual). Procedure: the agenting skill.
4 call site(s) haiku effort: low
3 call site(s) sonnet effort: medium
2 call site(s) opus effort: xhigh
9 agent() call sites -- call sites, not runs: a call inside a loop, map(),
parallel() or pipeline() runs once per item, so the script launches more agents than this.
Plan signature: haiku/lowx4|opus/xhighx2|sonnet/mediumx3
Agent guard. A single Agent start is checked too (hooks/agent-routing-guard.py, PreToolUse on Agent). A one-off agent needs a model and an effort, on the call or pinned by its agent file; otherwise the start is denied with a reason the model can act on, so it retries routed and you are not asked. A fork passes, and so does a prompt line routing: inherit (offered only when you asked for the agent to run on the chat's own tier). A teammate (a start with a name, with agent teams on) takes its model from the call but its effort only from an agent file: an effort written on its call was ignored in every measured start. So a teammate needs an agent file, such as an agenting: agent. It only ever denies or says nothing; it never allows. Replayed against 165 real Agent starts from the owner's last 21 days, it passes 78 and denies 87. Rules: the skill's "Agent starts: what the agent guard denies".
Finish check. A workflow script's own summary is computed from whatever agents returned; agents that died are silently missing from it. When a Workflow completes, workflow-finish-check.py reads the run's journal.jsonl and, only if something is missing, adds a line like:
[agenting] Workflow "Phase 4 classify": 13 of 18 agents returned; missing: classify:MAT.7.1-1,
classify:MAT.7.2, verify:MAT.7.4-1, verify:MAT.7.6, verify:MAT.7.7. The workflow's own summary
was built without them. Read <journal> and report the real count before presenting or acting on
this result (agenting skill: "When the finish check fires").
Session settings. Three values, carried per chat across compaction and printed as one line at every SessionStart:
[agenting] mode=auto · disposition=balanced · workflows=not opted in (session <id>). Record changes: …