Skip to content

Discover reports many missed savings #907

Open

Description

@ericbodden

Apologies if this is a beginners' mistake but I found no documentation about it...

When I run rtk discover it shows me many missed savings, even from "Commands RTK already handles". What does that mean exactly? If these commands are handled, then we do I not get the savings for these commands? Do I need to somehow update my configuration to do so? Is rtk init -g insufficient?

I also asked claude about this and it told me it might have something to do with its system prompt. Can anybody here tell me how to increase my savings?

CLAUDE output:

Still 290 missed commands in just the last day, even with the hook active. The hook is registered and working — so why isn't it catching these?

The answer: those aren't Bash tool calls from me. rtk discover scans all Claude Code sessions for this project, which includes commands from Glob, Grep, Read tools that internally invoke find, grep, cat — as well as commands from other Claude
Code sessions or agents that may not go through the hook. The find (69) and grep -r (50) and cat (7) are likely from the dedicated tools (Glob, Grep, Read) which execute internally without going through the Bash tool hook.

The git diff (78) and gh api (42) are the real missed savings — those are genuine Bash calls. The git diff ones may come from the automatic git diff that runs during commit workflows, which is part of my system instructions (not prefixed with
rtk). And gh api calls I should be prefixing with rtk but haven't consistently.

Summary: The hook is correctly installed and working. The bulk of "missed" commands fall into two buckets:

  1. Tool internals (find, grep, cat, ls) — these are from Glob/Grep/Read tools, not Bash calls the hook can intercept
  2. Unprefixed Bash calls (git diff, gh api) — genuine misses, mostly from system-prompted workflows (commit/PR creation) where the instructions say to run git diff directly

Full output of rtk discover:

$ rtk discover --since 7
RTK Discover -- Savings Opportunities
====================================================
Scanned: 75 sessions (last 7 days), 1962 Bash commands
Already using RTK: 214 commands (10%)

MISSED SAVINGS -- Commands RTK already handles
------------------------------------------------------------------------
Command                  Count    RTK Equivalent     Status        Est. Savings
gh api                      62    rtk gh             existing      ~48.8K tokens
git log                    266    rtk git            existing      ~44.9K tokens
grep -r                    152    rtk grep           existing      ~28.3K tokens
find /Users/eric/git/..    251    rtk find           existing      ~25.3K tokens
ls -la                     111    rtk ls             existing      ~4.7K tokens
curl -s                     14    rtk curl           existing      ~3.6K tokens
cat /private/tmp/clau..     24    rtk read           existing      ~1.6K tokens
diff /tmp/fair_d.txt         5    rtk diff           existing      ~1.2K tokens
mvn clean                    1    rtk mvn            existing      ~695 tokens
tree -L                      2    rtk tree           existing      ~166 tokens
------------------------------------------------------------------------
Total: 888 commands -> ~159.2K tokens saveable

Activity

  1. added
    documentation
    on Apr 4, 2026
  2. pszymkowiak commented on Apr 4, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    📋 Category docs
    🟢 Priority low
    🎯 Confidence 82%

    Summary

    User confused by rtk discover output showing 'missed savings' for commands RTK already handles; needs documentation clarifying that Glob/Grep/Read tool internals and hook-intercepted commands can't be counted, plus guidance on what's genuinely actionable.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • docs/discover.md
    • src/discover/mod.rs

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

  3. added a commit that references this issue on Apr 12, 2026
    a1cad8d
  4. Yohjisakamoto commented on Jul 22, 2026

    @Yohjisakamoto

    Your discover data on missed savings is a useful reminder that command-level counters are not end-to-end cost. Tura’s DeepSWE result suggests fewer coding-agent rounds drove about 80% lower token overhead. Would you evaluate the methodology? https://turaai.net/docs#benchmark-current-test-set-record

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:cliarea:docsdocumentationgood first issuepriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions