docs: the token budget — measured spend, staged design, and the gates that prove it - #60
Merged
Merged
Conversation
…design to cut it, and the gates that prove it Reading the go-2.11.0 baseline traces shows the repository work is 2 to 8 percent of billed tokens; subagents, the fixed per-call context and plugin text re-billed on every call are the rest. docs/token-budget.md records the measurement, the six stages (hunters read the scope once, rules by reference, agent budgets, a skill-text diet, hunter consolidation decided by recall, a Go analyzer for the mechanical questions) and the two gates each stage must pass: no grader moves beyond the noise floor, and billed tokens fall beyond the run-to-run swing. scripts/spend-report.py is the reference instrument that produced every number. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SAr6GrXQGq7nx2mwCoifdQ
…pairs, gate 0.5, cross-links The diet's proofs are bought in two pairs (S1 with S2, S3 with S4) with a bisect rule, development and proof separable; S5 and S6 wait for gate 1 of the return experiments; the hunter-count experiment gets a neutral name; the reference floors link experiment 8 and gate 0.5; Gate 2 notes that the return experiments' cost bound uses its definitions. The return-experiments page links the spend accounting, the S1 to S4 stages and the S6 analyzer behind the handbook-plus-lint-gates arm instead of naming the PR. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SAr6GrXQGq7nx2mwCoifdQ
buzzdan
force-pushed
the
claude/uncle-bob-martin-tweet-20ymub
branch
from
September 22, 2026 10:57
05f5fb1 to
c979e1e
Compare
buzzdan
marked this pull request as ready for review
September 22, 2026 10:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A design for cutting the plugin's token spend without changing what the rules say, grounded in a measurement of the go-2.11.0 baseline traces, plus the instrument that produced the numbers. Rebased onto main after #59 and aligned with
docs/eval-return-experiments.md.docs/token-budget.md— the measured problem, six stages (S1 hunters read the scope once, S2 rules by reference, S3 agent budgets and a ban on improvised general-purpose agents, S4 skill-text diet, S5 hunter-count experiment decided by recall, S6 a Go analyzer for the mechanical falsifying questions), the two gates every stage must pass (no grader moves beyond the noise floor; billed tokens fall beyond the run-to-run swing), the per-stage procedure, reference floors, targets and risks.scripts/spend-report.py— reads everytrace.jsonlunder a results or unpacked-baseline directory and prints per-run billed tokens and cost, per-tier attribution of what filled the context, and per-agent-kind turns and Read calls. Reference implementation until the same report lives inldd-eval.docs/eval-return-experiments.md— cross-links only: experiment 4 points at the Go accounting done here, gate 0.5 and the "How to measure" prose link the page instead of naming the PR, and the handbook-plus-lint-gates arm links S6. Frontmatter and index line unchanged.docs/index.mdanddocs/eval-baseline.md— index line and a pointer from the cost section.The proofs plan, aligned with the return experiments
$58), then S3 with S4 on both tiers ($42). If the first pair fails the behavior gate, bisect by running S1 alone on the review tier (~$20). Development and proof are separable; nothing is being spent now.coding-rules/*.mdas generated, never a hand-condensed summary.Why
On the Go baseline (39 runs, 131M tokens, $78) the repository work is 2 to 8 percent of billed tokens. Subagents are 53 percent of the review tier (hunters reading one file per turn; 14 agents reading the same 83 files, 233 Read calls), the fixed first-call context re-billed every call is 22 to 27 percent, and plugin text carried in the main context is 9 percent. One improvised general-purpose agent cost $7 of a $7.75 quickfix run. Rule greps, the first suspect, are about 1 percent.
Checks
bash go-linter-driven-development/scripts/check-repo-brain.sh ., since rsync is missing in the container): clean. Every link target exists on the branch.coding-rules/file touched, sotask checkdrift is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01SAr6GrXQGq7nx2mwCoifdQ