Skip to content

feat: enable hook-based mode on Windows#809

Closed
MauroDeryckere wants to merge 1 commit intortk-ai:developfrom
MauroDeryckere:feat/windows-hook-support-v2
Closed

feat: enable hook-based mode on Windows#809
MauroDeryckere wants to merge 1 commit intortk-ai:developfrom
MauroDeryckere:feat/windows-hook-support-v2

Conversation

@MauroDeryckere
Copy link
Copy Markdown
Contributor

@MauroDeryckere MauroDeryckere commented Mar 25, 2026

Summary

  • Remove #[cfg(not(unix))] fallbacks in run_default_mode and run_hook_only_mode that forced Windows into legacy CLAUDE.md injection mode
  • Make ensure_hook_installed cross-platform by wrapping only the chmod call in #[cfg(unix)]
  • Windows users can now run rtk init -g and get the same hook-based setup as macOS/Linux (zero context cost, deterministic rewriting)

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk init -g hook script written and settings.json patched on Windows 11
  • Manual testing: PreToolUse hook fires and rewrites commands in a live Claude Code session on Windows (Git Bash)
  • Manual testing: rtk rewrite "git status" returns rtk git status on Windows

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 25, 2026

CLA assistant check
All committers have signed the CLA.

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@MauroDeryckere MauroDeryckere force-pushed the feat/windows-hook-support-v2 branch from ef01cb6 to ebad5cc Compare March 27, 2026 08:09
aeppling added a commit that referenced this pull request Apr 19, 2026
Removing old guards, windows can now just use the binary hook engine from 0.37

Related issues:
- Fixes #502 : rtk init --global falls back to --claude-md on Windows
- Fixes #1353 : Feature request: hook-based mode on Windows
- Partially addresses #330 : Add hooks support for Windows
- Partially addresses #913 :  Persistent "No hook installed" warning on Windows
- Partially addresses #1373 : Suppress "No hook installed" warning on Windows
- Partially addresses #682 : Config to suppress hook warning
- Related to #1248 : Windows PowerShell compatibility gaps

Supersedes community PRs:
- #1123 fix(init): enable hook installation on Windows
- #1027 fix(init): enable hook-based mode on Windows
- #809 feat: enable hook-based mode on Windows
- #452 feat: add Windows hook support for rtk init --global
- #551 feat: native cross-platform hook for Windows support
- #150 feat(hook): native cross-platform hook-rewrite command
- #1063 Feat/windows hooks
@aeppling
Copy link
Copy Markdown
Contributor

Hello, should be resolved in 0.37.2

@aeppling aeppling added the resolved-pending-close Answered/resolved — will close if no response label Apr 20, 2026
@aeppling aeppling closed this Apr 20, 2026
@aeppling
Copy link
Copy Markdown
Contributor

Thanks for this contribution , this has been implement in latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

resolved-pending-close Answered/resolved — will close if no response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants