optional-skills/software-development/subagent-driven-development/references/context-budget-discipline.md
Practical rules for keeping orchestrator context lean when spawning subagents or reading large artifacts. Use these whenever you're running a multi-step agent loop that will consume significant context — plan execution, subagent orchestration, review pipelines, multi-file refactors.
Adapted from the GSD (Get Shit Done) project's context-budget reference — MIT © 2025 Lex Christopherson (gsd-build/get-shit-done).
Every workflow that spawns agents or reads significant content must follow these:
delegate_task auto-loads them — you reading them too just doubles the cost.read_file instead. The subagent gets full content; your context stays lean.Check the model's actual context window (not "it's Claude so 200K"). Some Sonnet deployments are 1M, some are 200K. If you don't know, assume the smaller one — err toward leanness.
| Context window | Subagent output reading | Summary files | Verification files | Plans for other phases |
|---|---|---|---|---|
| < 500k (e.g. 200k) | Frontmatter only | Frontmatter only | Frontmatter only | Current phase only |
| >= 500k (1M models) | Full body permitted | Full body permitted | Full body permitted | Current phase only |
"Frontmatter only" means: read enough to see the final status/verdict/conclusion. If the subagent wrote a 3000-line debug log, read the summary section it produced, not the log.
Monitor your context usage and shift behavior as you climb the tiers. The point is to notice before you hit the wall, not when responses start truncating.
| Tier | Usage | Behavior |
|---|---|---|
| PEAK | 0 – 30% | Full operations. Read bodies, spawn multiple agents in parallel, inline results freely. |
| GOOD | 30 – 50% | Normal operations. Prefer frontmatter reads. Delegate aggressively. |
| DEGRADING | 50 – 70% | Economize. Frontmatter-only reads, minimal inlining, warn the user about budget. |
| POOR | 70%+ | Emergency mode. Checkpoint progress immediately. No new reads unless critical. Finish the current task and stop cleanly. |
Quality degrades gradually before hard limits hit. Watch for these:
When these signs appear, checkpoint the work and either reset context or hand off to a fresh subagent.
When you orchestrate, you cannot verify semantic correctness of subagent output — only structural completeness ("did the file appear?", "does the test pass?"). Semantic verification requires either running the code yourself or delegating a review pass to another fresh subagent.
Mitigation: in every task you delegate, include explicit "must-have" truths the subagent must confirm in its response (e.g., "confirm your test actually tests X, not just that X was imported"). The subagent re-asserting concrete facts is evidence; vague summaries are not.