Skip to content
Back to Writing

Insight

Rules That Run, Part 2: The Agents Ate the Week

In the week starting October 1, 2026, subagents were 63% of my Claude Code usage and the weekly cap had been hit three weeks running. These are the subagent rules I shipped on October 4, and the hook that enforces them.

Ariel AgorUpdated 7 min read
Rules That Run, Part 2: The Agents Ate the Week

Listen · Read by Ariel

0:00 / n/a

Rules That Run is a ten-part series on the rules that keep an AI agent setup honest. This is part 2.

Part 1 moved the scheduled jobs onto a lean wrapper. After that change, the audit of the week starting October 1, 2026 put those jobs at 0.6% of weekly usage. The same audit had a much bigger number in it. Subagents, the helper agents Claude spawns from inside an interactive session, were 63% of the week. In mid-September they had been between 9% and 14%. By early October the weekly cap had been hit three weeks running.

Subagents spend usage in a specific way, and once I understood it I wrote four rules for them and a hook that makes two of those rules hold.

Every turn re-reads the whole context

The mechanism is simple once you see it. Each turn an agent takes sends its entire context back to the model. Prompt caching makes the re-read cheaper, but the cost of a turn still tracks the size of the context it carries. An agent that runs for a long time with a large context is paying for that context again on every step.

The audit put numbers on it. A general-purpose subagent started at around 62,000 tokens of context, before it had done anything. Over a long job of somewhere between 100 and 440 turns it grew to around 240,000. Each of those late turns was several times the price of an early one, and there were a lot of them.

Forks were worse. A fork is a subagent that inherits the parent's whole conversation, which is handy when the child needs everything the parent knows. It is also a way to start a long job already carrying a long session. One design job's forks ran at between 450,000 and 966,000 tokens per turn. Across the week, turns above 500,000 tokens of context were 7% of all turns and 20% of all usage.

So the usage was concentrated in a small number of very heavy turns, and almost all of those heavy turns belonged to long-running children that started big and stayed alive.

The four rules

I shipped these on October 4, 2026.

No fork for long jobs. A long job gets a fresh agent with a written brief. The brief costs a few hundred words to write and saves the child from dragging the parent's history through hundreds of turns. Forks are still allowed for short jobs, and a short fork has to say so in its description, so the label is visible in the log and the hook can check it.

Set the model on every agent call. The choice is by role, the same idea as the tiers in part 1. Sonnet does research, sweeps and drafting. Opus does review and judgment. Subagents default to Sonnet, so getting Opus takes an explicit request. Before this rule, children inherited whatever the parent session was running, which was usually Opus, so research sweeps ran on the most expensive model without anyone choosing that.

Cap the agents in flight. There is a ceiling on how many subagents can be running at once. It started at 5, moved to 10, and is 20 now. The cap exists to make fan-out a decision. A wide parallel fan-out should be a choice the session makes with the cap in view.

Every brief gets a turn budget and a deliverable. The brief says how many turns the job should take and what comes back: a file, a list, a yes or no with evidence. A child with no stated end has no reason to stop reading, and the long-running children in the audit kept growing toward 240,000 tokens of context.

The Claude Code docs recommend delegating verbose work to subagents so "the verbose output stays in the subagent's context while only a summary returns to your main conversation." That advice is right, and it is the reason subagents became the largest line. Delegation moves the cost into the child, where the main conversation no longer sees it, and a child with no brief and no end can spend more than the parent would have.

The hook

Rules one and three are enforced by a PreToolUse hook on the Agent tool, with a SubagentStop hook to count agents as they finish. Every denial is logged. Rules two and four are partly mechanical (the default model is a setting) and partly still prose.

Here is the shape of the PreToolUse side:

// ~/.claude/hooks/agent-budget.mjs  (PreToolUse, matcher: "Agent")
import fs from 'node:fs';
const input = JSON.parse(fs.readFileSync(0, 'utf8'));
const { subagent_type, description = '' } = input.tool_input ?? {};
const CAP = Number(process.env.MAX_PARALLEL_AGENTS ?? 20);

const deny = (reason) => {
  logDecision({ gate: 'agent-budget', decision: 'deny', reason });
  process.stdout.write(JSON.stringify({
    hookSpecificOutput: {
      hookEventName: 'PreToolUse',
      permissionDecision: 'deny',
      permissionDecisionReason: reason,
    },
  }));
  process.exit(0);
};

if (subagent_type === 'fork' && !description.includes('[short-fork]')) {
  deny('Long jobs get a fresh agent with a written brief. Mark short forks [short-fork].');
}
if (inFlightCount() >= CAP) {
  deny(`At the in-flight cap (${CAP}). Wait for an agent to finish.`);
}
logDecision({ gate: 'agent-budget', decision: 'allow' });

inFlightCount() reads a small counter file. The PreToolUse hook adds to it when it allows a spawn, and the SubagentStop hook takes one away when an agent finishes. If you build this, give each entry a timestamp and have the reader drop entries older than your longest expected job, because a crashed session never sends its SubagentStop.

The deny reason matters more than it looks. The model reads it, so it should say what to do instead. "Denied" teaches nothing. "Use a fresh agent with a written brief" gets the next attempt right.

The context diet

The same day, I went after the context every session starts with, because every subagent pays for the same baseline.

A fresh session's starting context went from 63,141 tokens to 47,192. Three changes did it. The main instruction file went from about 16.7K tokens to about 3.5K by moving long sections verbatim into reference files that load only when needed (part 4 is about that file). I set 103 skills I was not using to name-only, so they appear in the listing without their descriptions. And for the home project I disabled 10 plugin packs and 10 connectors that had been loading into every session whether or not anything used them.

The docs make the same point about MCP servers and about moving workflow instructions out of the main instruction file into skills. What the audit added was the reason to do it now. Every token in the baseline is multiplied by every turn of every agent, and in a week where agents are most of the usage, the baseline is the cheapest thing to cut.

What still depends on the model

Two of the four rules are hook-enforced. The model choice is partly enforced through the default. The turn budget and the deliverable are still words in a brief, and an agent can blow through a turn budget if nothing stops it. No hook kills a child at its turn budget. The budget is a target the parent checks when the child reports back.

So the rules that run are the ones the harness can see at spawn time: what kind of agent, how many at once. The rules that depend on judgment during the run still depend on the model.

Build it yourself

  1. Find out what share of your week is subagents. The /usage breakdown on a subscription plan attributes usage to subagents, or you can sum it from your session logs.
  2. Write a brief template with four fields: goal, model, turn budget, deliverable.
  3. Add a PreToolUse hook on the Agent tool that denies forks for anything not marked short, and denies spawns past an in-flight cap.
  4. Add a SubagentStop hook that decrements the in-flight count, and expire stale entries.
  5. Make the deny reason an instruction the model can follow on its next attempt.
  6. Log every allow and deny, so you can see later how often the cap actually bites.
  7. Measure a fresh session's starting context, then trim skills, plugins and connectors you do not use in that project.

Rules That Run, Part 1: The 93,000-Token Hello

Want this kind of automation working for your business?

Agor AI designs and ships the systems these posts describe, scoped in weeks, not quarters.