Skip to content

review: floor the small-diff fast path and measure review token sources - #1963

Merged
remigiusz-antczak merged 2 commits into
mainfrom
feat/review-token-sources
Oct 23, 2026
Merged

remigiusz-antczak merged 2 commits into
mainfrom
feat/review-token-sources

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Measures where deep-code-review's token cost goes, so the review-cost gap can be fixed at the source.

  • scripts/review_token_sources.py splits 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.py keeps 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 in full-map.md.
  • No skill text changed; the fast path already ships.

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

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
@remigiusz-antczak
remigiusz-antczak merged commit dda37be into main Oct 23, 2026
1 check passed
@remigiusz-antczak
remigiusz-antczak deleted the feat/review-token-sources branch October 23, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant