Repository navigation
docs: update native Windows hook troubleshooting - #4350
Conversation
Since v0.37.2, rtk init -g installs the native rtk hook claude entry on Windows, so the troubleshooting page no longer needs to describe the CLAUDE.md fallback. Point legacy setups at re-running rtk init -g to migrate off rtk-rewrite.sh.
📊 Automated PR Analysis
SummaryThis PR updates documentation to reflect that since v0.37.2, Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
On native Windows, rtk init -g before v0.37.2 never wrote rtk-rewrite.sh: it fell back to CLAUDE.md injection. Name that as the legacy state in the troubleshooting entry, supported-agents and the README, and keep the rtk-rewrite.sh cleanup as the conditional case. The settings.json prompt defaults to N, and the "RTK hook registered" banner prints whatever the answer, so say to answer y (or pass --auto-patch outside a terminal) before the command, point at the line that confirms the patch, and give what rtk init --show reports once the hook is in place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
KuSh
left a comment
There was a problem hiding this comment.
Round 1 of 3 — APPROVED, follow-ups filed
Claim: the Windows troubleshooting entry and the supported-agents Windows section stop describing the pre-v0.37.2 CLAUDE.md fallback and tell legacy setups to re-run rtk init -g, which installs the native rtk hook claude.
Scope: accept (round 1, frozen)
Ran: develop 4f9015f binary against legacy states built with v0.36.0 in an isolated HOME: (A) the old Windows fallback state, init -g --claude-md; (B) a legacy rtk-rewrite.sh hook; (C) a legacy settings entry whose script is gone; (E) a fresh install. Each was then run through rtk init -g (non-interactive, pty answering y, pty answering N, --auto-patch) and rtk init --show. Invariants: every claim in the added lines checked against the code or a transcript; docs only, so no savings figure.
Pins: 0 decisions (docs only), nothing to mutate
Matrix: executed this round; pin check: not applicable (no code)
CI @4e47c314f: all green; @2a8161da9 (fixup): 10/10 green
Blocks merge (0, frozen at round 1)
None.
Filed as follow-ups
- #3693: comment added with three states from the same migration. (1)
rtk init --showreports any legacyrtk-rewrite.shentry as[ok] Hook: rtk hook claude (native binary command), both before migration and once the script is gone, so the check this page recommends cannot tell the two apart. (2) Declining the prompt on the CLAUDE.md-fallback state removes the instruction block and adds no hook. (3)settings.json.bakends up holding the in-between file rather than the original. All three are outside the PR's hunks. - #4423
rtk init -gleaves a pre-v0.10 CLAUDE.md RTK block in place (v0.9.x wrote no closing marker) and adds@RTK.mdnext to it. The hook is still added. This is pre-existing and outside the PR's hunks; filed.
Checked and correct — no need to re-verify
- v0.37.2 is the first tag with 0e29650, which removed the
cfg(not(unix))fallback that printed "Falling back to --claude-md mode". - Migration from (B), the legacy-script state:
rtk-rewrite.shand.rtk-hook.sha256are deleted, and the settings entry is replaced withrtk hook claude(pty answeringy). From (A), the 137-line CLAUDE.md block is replaced with@RTK.mdand the hook is added. - The printed lines
RTK hook registered (global).andCommand: rtk hook claudematch byte for byte. rtk init --showexists and reports the hook after a successful migration.- Gemini is the only init integration that still writes a shell wrapper (
#!/bin/bash/exec rtk hook gemini). Cursor registersrtk hook cursor, so dropping it from the WSL sentence is correct. - No other page (README, translated READMEs, docs/, src/hooks) still claims the Windows fallback.
Next
fixup 2a8161d pushed, code-reviewed, wording only:
- Legacy state. On native Windows,
rtk init -gnever wrotertk-rewrite.sh. v0.10.0 to v0.37.1 had acfg(not(unix))fallback that injected CLAUDE.md, and releases before that only wrote CLAUDE.md. The Symptom/Cause lines, the supported-agents sentence and the README upgrade line now name the CLAUDE.md fallback; the script cleanup stays as the "if one exists" case.rtk hook claudeitself shipped in v0.37.0; v0.37.2 is when init began registering it on Windows. - Prompt.
rtk init -gasks before patchingsettings.jsonand defaults toN. On a legacy setupNremoves the old entry and adds nothing. The bannerRTK hook registered (global).prints whatever the answer. The entry now says to answery, or to use--auto-patch, which patches without that question and also works outside a terminal. It names the line that confirms the patch (settings.json: hook added, orhook already presenton a re-run) and gives whatrtk init --showreports once the hook is in place. supported-agents.md and the README carry the same caveat, and the troubleshooting entry gives it before the command, not after.
CI is green on it; approving.
Rounds: 1/3. Threads: 0 open.
|
Thanks @KuSh, glad the native Windows hook troubleshooting entry matches the support page now instead of pointing people to WSL. |
Summary
rtk init -gregistersrtk hook claudeon Windows too, and docs(windows): document native binary hook support #2791 already updated the README. This rewrites the troubleshooting entry to match: upgrade, re-runrtk init -gto migrate off the legacyrtk-rewrite.shhook, restart Claude Code, check withrtk init --show. WSL is mentioned as an option, not a requirement. The supported-agents section now says the same, and keeps WSL for integrations that still install a shell wrapper script (such as Gemini).Test plan
run_default_modeandmigrate_old_hook_scriptin src/hooks/init/claude.rs, the Gemini wrapper script in src/hooks/init/gemini.rs, and the Windows section of the README.cargo fmt --all && cargo clippy --all-targets && cargo test(not applicable, no code changes)