Skip to content

rtk discover reports false missed savings — reads pre-hook transcript commands, not executed ones #1929

Closed as duplicate

Description

@zer0logik

Problem

rtk discover scans Claude Code session transcripts (.jsonl files) to detect commands that could be handled by RTK. However, transcripts record the command as written by the LLM before the PreToolUse hook rewrites it.

As a result, rtk discover reports commands like grep, cat, ls, git add as "missed savings" even when the hook is correctly installed and intercepting them at execution time.

Example

With the hook properly configured in settings.json:

  • Transcript logs: cat ~/.claude/settings.json (pre-rewrite)
  • Actually executed: rtk cat ~/.claude/settings.json (post-rewrite)

rtk discover sees the transcript entry and flags cat as a missed opportunity.

Impact

  • "Already using RTK: 38 commands (0.3%)" — extremely misleading for a correctly configured setup
  • Users with a working hook may think it's broken and try to fix something that isn't

Suggestion

Either:

  1. Cross-reference transcript commands against rtk gain data to exclude already-intercepted commands
  2. Add a note in the output: "Note: pre-hook transcript commands are counted — verify your hook is active with rtk gain"
  3. Detect whether the PreToolUse hook is configured and warn/skip accordingly

Activity

  1. pszymkowiak commented on May 27, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 88%

    Summary

    rtk discover reads pre-hook transcript commands rather than executed ones, causing false 'missed savings' reports for users with a correctly-configured hook; PR #1979 is already in progress.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  2. Yohjisakamoto commented on Jul 22, 2026

    @Yohjisakamoto

    This false missed-savings report reinforces why end-to-end agent outcomes matter more than compressed text alone: DeepSWE found Tura cuts coding-agent rounds by 89% and total token cost by 80%; would you evaluate the methodology? https://turaai.net/docs#benchmark-current-test-set-record

  3. KuSh commented on Sep 5, 2026

    @KuSh
    Collaborator

    Closing as a duplicate of #1441, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions