Repository navigation
Open
Labels
area:clibugSomething isn't workingeffort-largePlusieurs jours, nouveau moduleenhancementNew feature or requesthelp wantedExtra attention is neededpriority:medium
Description
Problem
RTK's Claude Code hook intercepts only the Bash tool, but Claude Code has built-in native tools (Read, Grep, Glob, Edit, Write) that handle the majority of file and search operations without ever touching Bash.
Claude Code's system prompt explicitly instructs:
"Do NOT use the Bash to run commands when a relevant dedicated tool is provided."
- Read files →
Readtool (notcat/head/tail)- Search content →
Greptool (notgrep/rg)- Find files →
Globtool (notfind/ls)- Edit files →
Edittool (notsed/awk)
This means ~60% of the commands RTK is designed to compress (cat, grep, find, ls) never reach the Bash tool and are invisible to the RTK hook.
Evidence
On a real system with RTK 0.28.2 properly installed (hook v2, settings.json configured, RTK.md referenced):
rtk discoverreports 6,302 Bash commands in 7 days and claims 248K tokens saveable- But
rtk gainshows only 4 commands ever processed by RTK - The hook was installed and working correctly — the gap is because
rtk discoverscans Claude's JSONL logs and cannot distinguish between Bash tool calls and native tool calls, so it overestimates saveable tokens
Architecture mismatch
Claude Code Tool Routing:
┌─────────────┐
│ Read tool │──→ direct file read (no Bash, no hook, no RTK)
│ Grep tool │──→ direct ripgrep (no Bash, no hook, no RTK)
│ Glob tool │──→ direct glob (no Bash, no hook, no RTK)
│ Edit tool │──→ direct edit (no Bash, no hook, no RTK)
│ Bash tool │──→ hook fires ──→ RTK rewrites ✅
└─────────────┘
Impact
- RTK's headline claim of "80% savings across ~118K tokens per session" is significantly overstated for Claude Code users
rtk discovergives misleading savings estimates because it counts native tool usage as "missed Bash commands"- Users install RTK expecting large savings but see minimal impact, leading to confusion
What RTK still helps with (Bash-only commands)
gitoperations (status, diff, log, add, commit, push)ghCLI (pr, issue, run)npm run build/test,cargo test/builddockercommandscurl,ssh
These are real savings, but a fraction of the advertised total.
Suggestions
rtk discoveraccuracy: Filter out or flag commands that likely used native tools (Read/Grep/Glob) rather than Bash, so savings estimates are realistic- Hook non-Bash tools: Investigate intercepting
Read,Grep,Globtool calls via thePreToolUsehook to compress their outputs (differentmatcher+updatedInputschema) - Documentation: Clarify that Claude Code's native tools bypass RTK, and set realistic expectations for savings (git/gh/build/test commands only)
rtk gaincontext: Show estimated "reachable" vs "unreachable" commands so users understand why savings are lower thanrtk discoversuggests
Environment
- RTK 0.28.2 (Homebrew, macOS)
- Claude Code with Opus model
- Hook v2 (thin delegator), correctly installed and verified working
Metadata
Metadata
Assignees
Labels
area:clibugSomething isn't workingeffort-largePlusieurs jours, nouveau moduleenhancementNew feature or requesthelp wantedExtra attention is neededpriority:medium
Activity
roman-rr commentedon Mar 12, 2026
README savings table is misleading for Claude Code
The README's "Token Savings (30-min Claude Code Session)" table claims ~118K → ~24K tokens (80% savings), but the top 3 rows — which account for 45% of claimed savings — never go through Bash in Claude Code:
cat / readReadtool, notcat— RTK never sees itgrep / rgGreptool, notgrep— RTK never sees itls / treeGlobtool, notls— RTK never sees itClaude Code's system prompt explicitly instructs the model to use native tools over Bash:
Realistic savings estimate
cat / readReadtool)grep / rgGreptool)ls / treeGlobtool)git status/diff/log(20x)git add/commit/push(8x)npm test / cargo test(5x)ruff/pytest/go test(10x)docker ps(3x)RTK genuinely helps with git/gh/test/build/docker — but the headline "80% savings, 118K → 24K" is benchmarked against an agent that uses raw
cat/grep/lsvia Bash, which isn't how Claude Code works.Suggestion
Consider either:
pszymkowiak commentedon Mar 24, 2026
The discover module only counts Bash tool_use blocks (filters on
"Bash"in the JSONL). Native tools (Read, Grep, Glob) are not counted.The gap between discover (6302 commands) and gain (4 commands) is likely a hook issue — several users reported hooks not firing correctly between v0.25-v0.28 (see #260, #361). The hook has been significantly improved since then.
Could you try:
brew upgrade rtkorcurl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | shrtk init -g --auto-patchrtk init --show(should show[ok]for hook + settings)rtk gainvsrtk discoverIf gain still shows 0 after the upgrade, please share the output of
rtk init --show.Thanks!
roman-rr commentedon Mar 24, 2026
Lets measure. Today my stats, as following.
I'll post once again after 1-2 weeks.
roman-rr commentedon Apr 2, 2026
After a week @pszymkowiak so its obviously advantage, but only from read command ?!
pszymkowiak commentedon Apr 12, 2026
🔍 Automated Triage
bugmediumSummary
RTK's Bash-only hook misses Claude Code's native tools (Read/Grep/Glob/Edit), causing rtk discover to overstate potential savings — fix requires analytics filtering and/or extending hook coverage to PreToolUse native tools
📁 Relevant files
src/discover.rssrc/hook.rssrc/analytics.rsdocs/claude-code.mdTriaged automatically by wshm · This is an automated analysis, not a human review.