Skip to content

fix(discover): ignore hook-covered Claude commands#2671

Open
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:fix/discover-claude-hook-misses
Open

fix(discover): ignore hook-covered Claude commands#2671
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:fix/discover-claude-hook-misses

Conversation

@fengjikui

Copy link
Copy Markdown

Fixes #2648.

Summary

rtk discover now detects the configured Claude Code RTK hook and stops reporting hook-covered transcript commands as missed savings.

Root cause

Claude Code session transcripts store the original Bash command before the PreToolUse hook rewrite runs. When rtk hook claude is configured, a raw transcript command such as git status may already have executed through RTK, but discover still counted it as a missed RTK opportunity.

Fix

  • Add Claude hook detection to AgentIntegrationStatus, using the same Claude config directory resolution path as session discovery.
  • When the Claude hook is installed, count supported transcript commands as already covered by RTK instead of adding them to the missed-savings list.
  • Keep unsupported commands visible, since those are not covered by RTK rewrite rules.

Validation

  • cargo fmt --check
  • cargo test discover:: -- --nocapture
  • cargo check
  • Manual smoke with a temporary CLAUDE_CONFIG_DIR:
    • without settings.json hook: git status appears in supported
    • with rtk hook claude: supported is empty and already_rtk increments to 1

@fengjikui fengjikui marked this pull request as ready for review June 27, 2026 19:02
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.

discover reports phantom "missed savings" when the Claude Code hook is configured

1 participant