Repository navigation
Conversation
…lag pre-hook nature Three discover issues are partially addressed here. Issue rtk-ai#1897: git subcommands like checkout / clone / remote / reset were misclassified as 'Unsupported' (so they appeared in the missed savings list), even though RTK proxies them transparently via the universal git passthrough. The git rule's pattern now matches those plus ~20 other commonly-used subcommands, and each new entry is marked with RtkStatus::Passthrough so the dashboard surfaces them as supported-but-not-shrinking rather than as missed opportunities. Issues rtk-ai#1973 / rtk-ai#1929: 'rtk discover' parses Claude Code session transcripts, which record the PRE-hook form of every Bash command -- i.e. what the assistant originally proposed, not what actually executed after the PreToolUse hook rewrote it. When the RTK hook is present and active, the 'Already using RTK' headline understates true adoption because hook-rewritten commands still appear in transcripts as their original form. A full fix requires either Claude Code logging the post-hook updatedInput in transcripts, or RTK shadowing transcripts against its own audit log; both are out of scope here. As a stopgap: - discover --help docstring explicitly explains the pre-hook nature and points users to 'rtk gain --history' for executed-command data. - When the RTK PreToolUse hook is detected as installed, the report prepends a 'Note:' that warns the reader to cross-reference 'rtk gain --history'. Four new tests assert that git checkout / clone / remote / reset are classified as Supported + Passthrough (not Unsupported). Refs rtk-ai#1973, rtk-ai#1929 Fixes rtk-ai#1897
This was referenced May 27, 2026
Contributor
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
Contributor
|
Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you! |
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
Three related `rtk discover` issues are partially addressed in this PR.
Fixed (#1897): `git checkout / clone / remote / reset / merge / rebase / restore / switch / tag / init / clean / cherry-pick / revert / bisect / grep / blame / …` (~30 subcommands) were misclassified as `Unsupported` and surfaced in the "missed savings" list, even though RTK proxies them transparently via the universal git passthrough. The git rule now matches those subcommands with `RtkStatus::Passthrough`.
Mitigated (#1973 / #1929): `rtk discover` parses Claude Code session transcripts, which record the pre-hook form of each Bash command (what the assistant originally proposed), not the post-hook form (what the RTK `PreToolUse` hook rewrote it to and what actually executed). When the hook is installed and active, the "Already using RTK" headline understates true adoption because hook-rewritten commands still appear in transcripts as their original form.
A full fix would require either Claude Code logging the post-hook `updatedInput` in transcripts, or RTK shadowing transcripts against its own audit log — both out of scope here. This PR provides a stopgap:
Reproduction
```bash
Before
rtk discover
Output included e.g.:
git checkout main 50 rtk git - ~3500
(false positive: passthrough, not missed savings)
After
rtk discover
git checkout is classified as Passthrough (Supported) and does
not contribute to the "missed savings" total.
Plus, when the RTK hook is installed:
Note: RTK PreToolUse hook detected; transcripts capture the
pre-hook (assistant-proposed) command...
```
Behavior changes
Test plan
Out of scope (deferred)
Fixes #1897
Refs #1973, #1929