Repository navigation
Conversation
📊 Automated PR Analysis
SummaryAdds tracking infrastructure to link native Claude hook invocations to specific commands via a validated --hook-event-id flag, and measures actual output bytes/tokens from recall executions rather than inferring cost from deduplicated content reads. Introduces immutable capture IDs with bounded, pruned metadata, an additive output_accounting export in Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
yeahjack
marked this pull request as ready for review
October 12, 2026 20:44
9 tasks done
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
Add explicit local associations and measure the output cost of actual recall executions, rather than treating deduplicated content reads as execution counts.
--hook-event-idoption. Old history and unsupported shell shapes keep nullable associations, with no timestamp/command-text inference.output_accounting, plus up to 100 command and recall-event details withrtk gain --history --format json. Signed observed net output savings deduct initial output and measured retrieval output. Coverage/unknown counts andmeasurement_complete: falseprevent conflating this with complete context, billing or task-success measurements.Accounting is by each event's date and working directory: recalling an older capture charges the current retrieval event. External tee reads, stderr, historical reads and failed tracking are not measured. Native Claude simple rewrites are the initial propagation scope; compound commands/wrappers and other integrations preserve their current shell/permission behavior and remain unassociated.
Motivation
This does not implement the broader agent-label grouping proposed by #1314, nor claim to replace end-to-end benchmark instrumentation.
Verification
cargo fmt --all -- --checkcargo clippy --all-targets --offlinecargo test --all --offline: 4,388 passed, 8 existing ignored testsRelease spot-checks on Linux compared develop
311ebcbwith this PR at85fe79b(60 measured runs after 5 warmups per case):rtk git log --oneline -1: median 4.834 ms → 4.561 msrtk recall abc123 --from 901on a 1,000-line stored fixture: median 2.736 ms → 2.635 msThese shared-host spot-checks are regression evidence, not speedup claims; the baseline hook already exceeds 10 ms on this host. A real 250-file listing also verified that capture and command invocation IDs agree, and two 40-byte partial recalls charged 20 estimated tokens in total.
Cross-platform CI passed on commit
85fe79b282bd41097ae2f8b4ac93d63011acf194, including Linux, macOS, Windows, benchmark, clippy, formatting, rustdoc and security jobs.