Persistent "No hook installed" warning on Windows after rtk init -g --opencode
#913 opened on 2026年3月29日
説明
Description
After running rtk init -g --opencode (and also rtk init -g), the command rtk gain still shows this warning:
[warn] No hook installed — run
rtk init -gfor automatic token savings
This warning appears every time even though:
- The OpenCode plugin has been installed successfully (
rtk init --showshows[ok] OpenCode: plugin installed) rtk --versionworks correctly (currently v0.34.1)rtk gainsuccessfully shows token savings statistics- Cursor hook is also installed and working
Steps to Reproduce
- Install RTK on Windows (
rtk-x86_64-pc-windows-msvc.zip) - Add
C:\rtkto PATH - Run
rtk init -g --opencode - Restart OpenCode
- Run
rtk gain
→ Warning still appears.
Expected Behavior
rtk gain should recognize that the OpenCode plugin is installed and not show the "No hook installed" warning (or show a more accurate message for OpenCode/Windows).
Actual Behavior
The warning persists, which is confusing even though token savings are working and the plugin is active.
Environment
- OS: Windows 11
- RTK Version: 0.34.1
- Tool: OpenCode (with custom plugin
rtk.ts) - Other hooks: Cursor hook also installed
Additional Context
According to the troubleshooting docs, OpenCode uses a custom tool.execute.before plugin instead of native Unix-style hooks. The detection logic in rtk gain seems to only check for native hooks, causing this misleading warning on Windows.
It would be great if RTK could:
- Better detect OpenCode plugin installation on Windows, or
- Show a more specific message like "OpenCode plugin installed (native hook not available on Windows)" when the plugin is present.
Thanks!