Windows: five install and hook defects, with a tested patch #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Field report from installing
f498b6fon 2026-09-12 into a real, busy repository (Python app, ~1,500 tests, background jobs that write tracked data files, a 120 KB CLAUDE.md).Environment: Windows 11, Git for Windows (bash 5.3.9,
core.autocrlf=truefromthe system gitconfig), Python 3.14 (
python3is the WindowsApps alias and works),Claude Code 2.1.269 → 2.1.270.
How it was checked: the kit's own suite; the hooks driven exactly as
settings.jsonholds them; and four live headlessclaude -psessions readingthe
hook_responseevents. Nothing here was run on Linux or macOS.Fixed in the patch below
Kit suite: 90 passed / 3 failed → 101 passed / 0 failed on Windows. Every new
assertion was proven RED against unpatched
f498b6fcode before being trusted.A1. Three
test-install.shassertions can never pass on Windowstest-install.sh:24, :46, :88embed the settings path inside the Python source:MSYS converts paths in argv for native executables, but not paths inside a
string, so native Python receives
/tmp/tmp.XXXX/...and raisesFileNotFoundError. The installer itself is fine: it passes the path as argv.The consequence is worse than a red suite. These three stay red identically
when the settings merge is genuinely broken (duplicated hooks, invalid JSON),
so on Windows they cannot detect the regressions they exist for.
Fix: pass the path as
sys.argv[1].Related: the "hooks not duplicated" assertion counts entries, not
commands. A merge that nests the same command three times inside one entry
stays green (mutation-tested). The patch adds a per-command count.
A2. The Stop prompt sends agents to
log.md, which the contract calls read-onlywiki-stop-guard.shsays(update page, crosslinks, index.md, log.md), whileWIKI.mdhas said sincee8f0e76that "A log.md from older installs isread-only history". The log-per-entry migration missed this line.
Fix: the prompt now reads
a new entry in <wiki>/log/, with tests that itnames
wiki/log/and notlog.md.A3. The SessionStart page count uses the project path as a glob
-pathtakes a pattern, so a[or a backslash in the absolute project pathmakes both exclusions match nothing. Log entries and raw sources are then
counted as pages, with no error.
Reproduced two ways:
CLAUDE_PROJECT_DIRgiven as a backslash path (cygpath -w): the hook reports 4 pages instead of 3.proj[1]: same result.It is latent on Claude Code 2.1.269, which exports forward slashes. Any user
whose path contains brackets gets a count that grows with every log entry.
Fix:
cd "$dir", then use relative patterns. A new test installs into adirectory named
proj[1].A4. The Stop guard misreads quoted porcelain paths
The guard classifies inside/outside with
substr($0, 4, ...)overgit status --porcelain. Git quotes paths containing spaces or non-ASCIIbytes (
?? "wiki/notes/gy\303\266keres.md"). The column-4 match then fails, anew wiki page counts as outside the wiki, and the agent is told it recorded
nothing right after recording something.
Fix: two pathspec-limited status calls:
-- ':(top)' ":(exclude)$wiki"-- "$wiki"The existing subdirectory-rooted tests still pass. A new test uses a non-ASCII
page name, with a precondition asserting that git really quotes it.
A5. The installer writes
settings.jsonwith CRLF on Windowsopen(path, "w")is text mode. Fix:newline="\n". The test checks bytes,because Git for Windows'
grepdoes not reliably see a trailing CR: the firstgrep $'\r'version of this assertion could not fail.The patch (applies to
f498b6f, 134 lines)Companion issues from the same install: #3 (the Stop guard keys on the tree, not the session) and #5 (smaller findings).