Repository navigation
review: floor the small-diff fast path and measure review token sources - #1963
Merged
Merged
Conversation
Adds a SKILL.md fast-path byte floor and a per-diff-size must-load table to the existing review_load_bytes tests (no skill text changed; the fast path already ships). Adds review_token_sources.py, which splits transcript tool-result and model-output size by source for sessions that invoked the skill, with a synthetic-data test. Tests: 10/10 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z
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.
Measures where deep-code-review's token cost goes, so the review-cost gap can be fixed at the source.
scripts/review_token_sources.pysplits transcript tool-result and model-output size by source for sessions that invoked the skill. It is read-only and prints aggregates only: no transcript content or paths. Its known limits are in the docstring: grep is classified by the first token only, sidechain transcripts count as separate sessions, and attribution never resets after the first invocation.scripts/test_review_load_bytes.pykeeps the 7 existing tests and adds a floor for the SKILL.md-only fast path (≤3000 bytes; it is 2785 today). It also adds a check that the floor's reference list is still named infull-map.md.Local finding (size estimates, not billed tokens): Read results ~47%, Bash output ~27% and model output ~22% of review-session size. Skill and reference loads are under 1%. The next lever is a read and output budget for small diffs, not smaller skill files.
Tests: 10/10 (load-bytes 9, token-sources 1), run on the commit's own tree. Independent review: 1🔴 (deleted tests) fixed; 🟡 items folded in.
🤖 Generated with Claude Code
https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z