Repository navigation
Conversation
…s installed On Windows, `rtk init -g` does not install a PreToolUse hook — it falls back to `--claude-md` mode and writes the RTK instructions block into `~/.claude/CLAUDE.md`. That is the only supported integration on this platform. However, `status()` still reports `Missing` in that configuration, so `maybe_warn()` prints `/!\ No hook installed — run 'rtk init -g' for automatic token savings` every 24h. The advice is impossible to follow: running `rtk init -g` on Windows just re-emits the `--claude-md` fallback, so the user is nagged forever about a hook they can never install. Detect the `--claude-md` integration on Windows by looking for the `<!-- rtk-instructions` marker in `~/.claude/CLAUDE.md`, and return `HookStatus::Ok` in that case. The check is gated on `cfg!(windows)` to stay narrowly scoped and avoid reopening the broader "hook masking" discussion from d85fe33.
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
|
Thanks for the careful Windows reproduction. Hook based mode now works on Windows since PR #1399 (merged 2026-04-19), which dropped the Unix only guard and registers the native rtk hook in settings.json, so rtk init -g installs a real PreToolUse hook there and the "No hook installed" warning is both accurate and actionable. The claude-md fallback this patch recognized is no longer the only integration available on Windows, so the special case is not needed, and treating it as Ok would now hide the prompt to migrate to the hook. If you still see the warning after running rtk init -g on current develop, please comment and we can reopen. |
Summary
rtk init -gcannot install a PreToolUse hook — it falls back to--claude-mdmode and writes the RTK instructions block into~/.claude/CLAUDE.md. That's the only valid integration on this platform.status()still returnsMissingin that configuration, somaybe_warn()keeps printing/!\ No hook installed — run `rtk init -g` for automatic token savingsevery 24h.rtk init -gon Windows just re-emits the--claude-mdfallback message (Hook-based mode requires Unix (macOS/Linux). Windows: use --claude-md mode). The user is nagged forever about an integration they can never install.status()to recognize the--claude-mdintegration on Windows by looking for the<!-- rtk-instructionsmarker in~/.claude/CLAUDE.md, and returnHookStatus::Okin that case.cfg!(windows)to stay minimal and avoid reopening the broader "hook masking" discussion from d85fe33 — on macOS/Linux, behavior is unchanged.Reproduction (before this patch, on Windows)
After the patch, once
<!-- rtk-instructionsis present in~/.claude/CLAUDE.md, the warning stops — on Windows only.Test plan
claude_md_mode_installed: marker present, marker absent, file missing.test_status_returns_valid_variantextended with a Windows +--claude-mdbranch assertingHookStatus::Ok.cargo fmt --all && cargo clippy --all-targets && cargo test— I don't have a Rust toolchain on the Windows machine where I reproduced this, so relying on CI for the pre-commit gate.~/.claude/CLAUDE.mdcontaining the RTK block; after this patch it should go silent.