You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need config to suppress warnings like "No hook installed — run rtk init -g for automatic token savings" #682
I'm using rtk in Windows with my Claude Code. According to the guidance, I added rtk's instructions to my CLAUDE.md instead of configuring Claude Code Hooks.
But every time when Claude Code run some bash command with rtk, it will print a warning message like below:
● Let me check the current state of these files.
● Bash(rtk git log --oneline -20)
⎿ [rtk] /!\ No hook installed — run `rtk init -g`for automatic token savings !!!!!! Unexpected warnings.
7cb555668 Fix some package versions
f214d1b2e Fix csproj
… +18 lines (ctrl+o to expand)
● Searched for 1 pattern (ctrl+o to expand)
Reacted by fondoger, andersonaggie05, lionelhorn, Berserk, Adam Hamrick, Kimin Kim, Faci Labs, Nidhi Singh, bai-xia, Sean Millare and 6 more
I have the same but I'm running Opencode -- I do not have Claude installed. As you can see on my screenshot my token saver is indeed working but I am still receiving the same warning.
[warn] No hook installed — run `rtk init -g` for automatic token savings
even when RTK is installed, working, and being used from OpenCode.
This is confusing in the OpenCode setup, because the warning suggests that RTK is not properly installed or not active, while in practice RTK itself works and records savings.
[warn] No hook installed — run `rtk init -g` for automatic token savings
still appears in commands like:
rtk gain
rtk log
even when using the OpenCode plugin flow.
That warning is misleading for OpenCode users, because it implies that automatic integration is missing, when the OpenCode integration does not use the same mechanism as the classic Claude Code hook.
Issue #603 already states that the No hook installed message is checking for the Claude Code hook specifically, not the OpenCode plugin.
If that is the intended current behavior, then the problem is that rtk gain / rtk log are still surfacing a warning that is not accurate for OpenCode users.
In other words:
RTK works
OpenCode support exists via plugin
but RTK still emits a warning that sounds like the setup is incomplete or broken
Plugin used
importtype{Plugin}from"@opencode-ai/plugin"// RTK OpenCode plugin — rewrites commands to use rtk for token savings.// Requires: rtk >= 0.23.0 in PATH.//// This is a thin delegating plugin: all rewrite logic lives in `rtk rewrite`,// which is the single source of truth (src/discover/registry.rs).// To add or change rewrite rules, edit the Rust registry — not this file.exportconstRtkOpenCodePlugin: Plugin=async({ $ })=>{try{if(process.platform==="win32"){await$`where.exe rtk`.quiet()}else{await$`which rtk`.quiet()}}catch{console.warn("[rtk] rtk binary not found in PATH — plugin disabled")return{}}return{"tool.execute.before": async(input,output)=>{consttool=String(input?.tool??"").toLowerCase()if(!["bash","shell","powershell","cmd"].includes(tool))returnconstargs=output?.argsif(!args||typeofargs!=="object")returnconstcommand=(argsasRecord<string,unknown>).commandif(typeofcommand!=="string"||!command)returntry{constresult=await$`rtk rewrite ${command}`.quiet().nothrow()constrewritten=String(result.stdout).trim()if(rewritten&&rewritten!==command){;(argsasRecord<string,unknown>).command=rewritten}}catch{// rtk rewrite failed — pass through unchanged}},}}
Evidence that RTK is working
Example output from rtk gain:
RTK Token Savings (Global Scope)
════════════════════════════════════════════════════════════
Total commands: 547
Input tokens: 488.6K
Output tokens: 245.7K
Tokens saved: 243.0K (49.7%)
Total exec time: 65m5s (avg 7.1s)
Efficiency meter: ████████████░░░░░░░░░░░░ 49.7%
[warn] No hook installed — run `rtk init -g` for automatic token savings
This clearly shows that RTK is active and collecting savings, yet the warning still claims that no hook is installed.
Expected behavior
One of these should happen:
rtk gain / rtk log should detect the OpenCode plugin integration and avoid showing the warning in that context, or
the warning text should be made more precise, for example clarifying that it refers only to the classic hook mechanism and may not apply to OpenCode plugin users.
Actual behavior
rtk gain and rtk log still show:
[warn] No hook installed — run `rtk init -g` for automatic token savings
even though RTK is installed and functioning.
Why this matters
For OpenCode users, this warning strongly suggests that the setup is incomplete or broken.
That leads to unnecessary debugging, confusion, and duplicate support requests, especially on Windows where users may already be dealing with plugin-specific setup changes such as replacing which with where.exe.
Suggested fix
Possible options:
suppress the warning when OpenCode plugin integration is detected
add explicit detection for OpenCode plugin mode
change the warning text to something like:
[warn] No classic shell hook installed. This warning may not apply if you are using OpenCode plugin integration.
Questions
Is this warning expected to remain visible for OpenCode users even when RTK is working?
Is there a plan to distinguish classic hook mode from OpenCode plugin mode in rtk gain / rtk log?
Would you accept a PR to improve the warning text or detection logic?
sorry for pinging @aeppling / @pszymkowiak but any chance you would take a PR for this issue? if so more than happy to raise one because i cna almost imagine the gains i havev from rtk are being cancelled out by this warning
Activity
Macho0x commentedon Mar 18, 2026
I have the same but I'm running Opencode -- I do not have Claude installed. As you can see on my screenshot my token saver is indeed working but I am still receiving the same warning.
btbxbob commentedon Mar 19, 2026
it wasted a lot token than reduce it now.
fondoger commentedon Mar 19, 2026
I believe this issue needs an urgent fix for Windows users.
aimardcr commentedon Mar 19, 2026
Getting the same issue here for Windows
pszymkowiak commentedon Mar 20, 2026
🔍 Automated Triage
featurelowSummary
Request for a config option to suppress the 'No hook installed' warning; PR #776 is already in progress addressing this.
Triaged automatically by wshm · This is an automated analysis, not a human review.
ursoos commentedon Mar 21, 2026
Same problem for win 11.
feat(config): add suppress_hook_warning option
mvanhorn commentedon Mar 21, 2026
Implemented in #776 - adds hooks.suppress_hook_warning config option and RTK_SUPPRESS_HOOK_WARNING env var to disable the warning permanently.
16 remaining items
nidhi-singh02 commentedon May 6, 2026
i am on version 0.38.0, i am still facing this issue on mac via codex, pfa the snippet below
do i need to enable any settings/config for this ? TIA
killo3967 commentedon May 6, 2026
Summary
rtk gainandrtk logstill show:even when RTK is installed, working, and being used from OpenCode.
This is confusing in the OpenCode setup, because the warning suggests that RTK is not properly installed or not active, while in practice RTK itself works and records savings.
Related: #603
Actual problem being reported
This is not a report that RTK itself is broken.
RTK works correctly in my setup.
The problem is that the warning message:
still appears in commands like:
rtk gainrtk logeven when using the OpenCode plugin flow.
That warning is misleading for OpenCode users, because it implies that automatic integration is missing, when the OpenCode integration does not use the same mechanism as the classic Claude Code hook.
Environment
C:\Users\tomas\.config\opencode\plugins\rtk.tsContext
Issue #603 already states that the
No hook installedmessage is checking for the Claude Code hook specifically, not the OpenCode plugin.If that is the intended current behavior, then the problem is that
rtk gain/rtk logare still surfacing a warning that is not accurate for OpenCode users.In other words:
Plugin used
Evidence that RTK is working
Example output from
rtk gain:This clearly shows that RTK is active and collecting savings, yet the warning still claims that no hook is installed.
Expected behavior
One of these should happen:
rtk gain/rtk logshould detect the OpenCode plugin integration and avoid showing the warning in that context, orActual behavior
rtk gainandrtk logstill show:even though RTK is installed and functioning.
Why this matters
For OpenCode users, this warning strongly suggests that the setup is incomplete or broken.
That leads to unnecessary debugging, confusion, and duplicate support requests, especially on Windows where users may already be dealing with plugin-specific setup changes such as replacing
whichwithwhere.exe.Suggested fix
Possible options:
Questions
rtk gain/rtk log?fix(hooks): windows use 'rtk hook claude' no fallback
fix(hooks): windows use 'rtk hook claude' no fallback
tangrufus commentedon May 21, 2026
+1 for
RTK_SUPPRESS_HOOK_WARNINGespecially rtk doesn't detect hooks in claude pluginsramarivera commentedon Jun 8, 2026
sorry for pinging @aeppling / @pszymkowiak but any chance you would take a PR for this issue? if so more than happy to raise one because i cna almost imagine the gains i havev from rtk are being cancelled out by this warning
feat(config): quiet_hook_warnings to suppress hook warnings
Omzig commentedon Aug 14, 2026
i have this problem in the github copilot GUI chat, because hooks are disabled in my org for the GUI right now because it is still preview
feat(config): add suppress_hook_warning option
feat(config): add suppress_hook_warning option