Skip to content

feat: enable hook-based mode on Windows#809

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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants