Repository navigation
fix(setup): quote forward-slash hook paths for Claude Code on Windows - #182
Open
MohammedAlkindi wants to merge 1 commit into
Open
MohammedAlkindi wants to merge 1 commit into
MohammedAlkindi wants to merge 1 commit into
Conversation
Claude Code runs hook commands through Git Bash on Windows, which strips the backslashes from a native path (C:\Users\x\...\prime.sh becomes C:Usersx...prime.sh, exit 127). Claude hooks fail open, so memory was silently never primed or recalled. Emit a quoted forward-slash path on Windows; other platforms are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Windows,
mnemon setupnow writes Claude Code hook commands as a quoted forward-slash path, for example"C:/Users/x/.claude/hooks/mnemon/prime.sh". Other platforms are unchanged.Why
Claude Code runs hook commands through Git Bash on Windows (hooks docs: "Git Bash on Windows"). Bash strips the backslashes, so
bash -c 'C:\Users\alkin\wt\gotmp-lead\p.sh'fails withC:Usersalkinwtgotmp-leadp.sh: command not found(exit 127), whilebash -c '"C:/Users/alkin/wt/gotmp-lead/p.sh"'runs. Claude hooks fail open, so memory never primed or recalled on Windows. No issue was filed for this.Checklist
make test): nomakeon my Windows box, so I ran its parts.GOOS=linux go vet ./...is clean and the fourTestAddClaudeHooksSelectivetests pass.TestClaudeRegisterHooksCollisionWritesAbsoluteCommandsand the other Windows failures in that package fail the same way on master.make test-integration, when affected): not affected