rtk-ai/rtk

Native Windows section of README/docs still describes pre-v0.37.0 CLAUDE.md fallback

Open

#2,115 创建于 2026年5月27日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Rust (2,914 fork)batch import
area:docsdocumentationgood first issueplatform:windowspriority:medium

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 8天 17小时) (30 天内合并 49 个 PR)

描述

The Native Windows section of README.md and matching docs still describe the pre-v0.37.0 fallback behavior, where rtk init -g on native Windows could not install a working hook and fell back to CLAUDE.md injection. Since v0.37.0 (CHANGELOG: hooks: windows use 'rtk hook claude' no fallback), rtk init -g installs the native rtk hook claude PreToolUse hook on all platforms including Windows, and the rtk-rewrite.sh shell script is no longer required for Claude Code.

Stale claims I noticed while reading the docs from a Windows install:

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/README.md#L90

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/README.md#L317

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/README.md#L330-L350

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/docs/guide/resources/troubleshooting.md#L119

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/docs/guide/getting-started/supported-agents.md#L182

Each one tells Windows users the auto-rewrite hook does not work and that rtk init -g falls back to CLAUDE.md injection.

Looking at the current code, rtk init -g for Claude Code writes a Bash matcher with "command": "rtk hook claude" into ~/.claude/settings.json unconditionally, on Windows the same as macOS/Linux — no cfg!(target_os = \"windows\") branch and no shell-script dependency:

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/src/hooks/constants.rs#L12

https://github.com/rtk-ai/rtk/blob/39583cf22b0a73ef78f935d8ada1c87a9a10e852/src/hooks/init.rs#L1054-L1086

I can confirm from a native Windows install (v0.42.0, Claude Code) that the hook is in settings.json as rtk hook claude and rewrites Bash tool calls transparently — no CLAUDE.md injection involved.

One related caveat that might be worth mentioning in the same place: the hook matcher is hardcoded to Bash, so when Claude Code is configured to use the PowerShell tool (CLAUDE_CODE_USE_POWERSHELL_TOOL=1), commands are not rewritten. That gap is already tracked in #1319, but readers landing on the Windows section today may not realize the Bash-tool-only scope is the only real limitation now.

Related closed issues: #1290, #1353.

贡献者指南