You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
resolve-paths.sh tests REMEMBER_HOOK_CWD for directory existence before the Windows path normalization that would make it resolvable #448
Reported out of the #444 lane's self-review and routed here rather than fixed in that diff. Reasoned, not observed — no Windows or Git Bash shell was available in the session that found it, and that grade is part of the finding.
Symptom
On Windows, a hook payload's cwd that names a real directory can fail the existence test and be discarded, so resolve-paths.sh falls through to its next candidate or to the loud failure — on a host where CLAUDE_PROJECT_DIR is unset, that means every hook silently no-ops via its || exit 0.
The backslash and drive-letter normalization block runs later, and only against whatever PROJECT_DIR was already chosen.
Mechanism
The ordering is test -d first, normalize second. A cwd arriving in a Windows-native spelling — backslash separators, or a bare drive letter — is therefore tested in the form the shell cannot resolve, and the branch is skipped before the code that would have fixed the spelling ever runs.
CLAUDE_PROJECT_DIR does not have this asymmetry, which is why it has never surfaced: on Claude Code the first candidate wins and the normalization it feeds is reached. #411 introduced the ordering when REMEMBER_HOOK_CWD existed on two hooks that only fire once per session. #444 extended the same variable to user-prompt-hook.sh and post-tool-hook.sh — the second of which runs on every tool call — so the blast radius grew without the ordering being revisited.
This is also the exact platform band this repo keeps getting caught by: a suffix or separator match that behaves differently with backslashes than with forward slashes, and a drive letter whose colon precedes the first slash.
What would settle it
A test that feeds each of the four hooks a cwd in Windows-native spelling with CLAUDE_PROJECT_DIR unset, and asserts the store is written rather than the FATAL path taken. It needs the Windows CI leg to be meaningful — tests/_bash_runner.py and resolve_bash() landed in #432/#439 and are what makes such a test runnable there rather than skipped, which is the piece that did not exist when #411 shipped.
Pair it with a positive control: an assertion that resolution succeeded passes just as well when the harness never ran the hook at all.
Activity
fix: #448's test harness now hands bash forward-slash paths, not back…
fix: normalize REMEMBER_HOOK_CWD before testing it, not after (#448) (#…
fix: normalize backslash-separated REMEMBER_DIR before the retention …
fix: gate #487's backslash normalization on $OSTYPE, fix test's arg-q…
fix: Windows CI red on PR #499 -- portable retention sweep, NDC/reten…
fix(#951): forward-slash the mktemp-shim's own paths for windows-latest