Reduce subagent token usage across the forge skill chain#1
Open
anthonyespirat wants to merge 4 commits intomainfrom
Open
Reduce subagent token usage across the forge skill chain#1anthonyespirat wants to merge 4 commits intomainfrom
anthonyespirat wants to merge 4 commits intomainfrom
Conversation
Implements the improvements drafted in webapp/improvement.md (not tracked). - implementer-prompt.md: trim 156 → 81 lines. Drop the duplicated debugger / in-over-your-head / code-organization prose (the rules live in skills/debugger/). Collapse Forbidden to two bullets. Cap the report at 150 words and make IF BLOCKED conditional so DONE reports stop dragging it back into the controller's context. Add an EXCERPTS-first instruction so the subagent skips redundant Reads when signatures are pasted in. Delete the redundant Status meanings section — the controller's copy in SKILL.md is the one that matters. - subagent-execution/SKILL.md: invert the model default. sonnet is now the default; opus requires an explicit upgrade signal. Add a "Mechanical steps — skip dispatch" section so the controller can execute fully-specified [mechanical] steps directly instead of paying for a round-trip, and track them as DIRECT EXECUTIONS in the final report. - writing-plans/SKILL.md: add a [mechanical] tag, a per-step EXCERPTS block, and a ≤6-files-per-step budget. Extend the self-review with matching mechanical and file-count audits. - codebase-explorer.md: flip caveman compression to default-on. The output is consumed by writing-plans, not a human, so the ~50% token cut compounds across every downstream dispatch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Surfaces the sonnet-default / opus-on-signal behavior from subagent-execution as a top-level design principle, next to the other cost-discipline bullets. Also nudges the short-report bound down to 150 words to match the new implementer report cap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Implements the token-usage improvements drafted in
webapp/improvement.md(scratch notes, not tracked). Net: -49 lines, 4 files — and a much tighter per-dispatch context profile. The changes compound: every dispatch reads a shorter prompt, returns a shorter report, and defaults to a cheaper model unless the step actively asks for opus.What changed
skills/subagent-execution/implementer-prompt.md(156 → 81 lines). Dropped the duplicated debugger / in-over-your-head / code-organization prose — the rules already live inskills/debugger/, so a one-line pointer is enough. CollapsedForbiddento two bullets. Capped the report at 150 words and made theIF BLOCKEDblock conditional, soDONEreports stop dragging it back into the controller's context. Added anEXCERPTS-first instruction so the subagent skips redundantReads when signatures are pasted inline. Removed the redundantStatus meaningssection — the controller's handling narrative inSKILL.mdis the one that matters.skills/subagent-execution/SKILL.md. Inverted the model default:sonnetis now the default,opusrequires an explicit upgrade signal (3+ files across modules, design judgment, BLOCKED reasoning re-dispatch). Added aMechanical steps — skip dispatchsection so the controller can execute fully-specified[mechanical]steps directly instead of paying for a round-trip, and tracks them asDIRECT EXECUTIONSin the final report.skills/writing-plans/SKILL.md. Added a[mechanical]step tag, a per-stepEXCERPTS:block, and a ≤6-files-per-step budget. Extended the self-review with matching mechanical-audit and file-count-budget checks.agents/codebase-explorer.md. Flipped caveman compression from optional to default-on. The report is consumed bywriting-plans, not a human, so the ~50% token cut compounds across every downstream dispatch.Expected impact (per 10-step run, estimated)
[mechanical]stepsEXCERPTSblocks cutting re-confirmation Reads