Skip to content

fix: start the hook on native Windows (1.0.5) - #11

Merged
abullard1 merged 2 commits into
mainfrom
fix/windows-interpreter-1.0.5
Aug 16, 2026
Merged

abullard1 merged 2 commits into
mainfrom
fix/windows-interpreter-1.0.5

Conversation

@abullard1

Copy link
Copy Markdown
Owner

Fixes #7. Thanks to @aermak for the report and for identifying the cause.

On native Windows the plugin was silently inert. No bolding, no error, and /claude-bionify:status reporting ON throughout.

Cause

hooks.json declared one interpreter, python3. Hooks run in exec form, which Claude Code spawns with no shell, so the name must resolve to a real executable. On native Windows it usually does not:

  • The python.org installer creates python.exe and py.exe, never a python3.exe.
  • Windows ships a 0-byte App Execution Alias stub named python3.exe in WindowsApps, on PATH and enabled by default. Running it prints Python was not found and exits 9009.

So the spawn succeeds and runs the wrong thing. Existence checks like where python3 pass while the plugin stays dead. A failed MessageDisplay hook is display-only, so Claude Code keeps the original delta and surfaces nothing; claude --debug is the only trace.

Fix

{"command": "python3", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/bionify.py"], "timeout": 10},
{"command": "py",      "args": ["-3", "${CLAUDE_PLUGIN_ROOT}/scripts/bionify.py"], "timeout": 10}

Entries dedupe on command plus args so both are attempted, a failing one yields no displayContent, and the merge keeps the last defined one. python3 covers Linux, macOS, WSL and Store Python; py covers python.org on Windows, whose launcher is a real .exe in C:\Windows.

Not chosen: a python third entry, which on Arch and in any activated venv is the same interpreter as python3 and would run the transform twice per flush; and shell form with a || chain, which fails to parse under PowerShell 5.1, the fallback when Git Bash is absent.

/claude-bionify:status also stopped reporting ON while nothing was bolded, which is what made this look like a settings problem.

Known limitation

Where python3 is the Store placeholder, bolding works but the /claude-bionify:* commands do not, since they run through a shell. Installing Git for Windows, or a real python3 on PATH, restores them. Documented in both READMEs.

Test plan

  • 115 passed, 2 skipped, 93.7% coverage (gate 80%)
  • Each fix fails a named test when reverted
  • hooks.json contract asserted in the suite, since claude plugin validate --strict does not check it
  • Spawn test runs the hook under each declared interpreter by name
  • claude plugin validate --strict on both manifests, ruff clean

hooks.json declared one interpreter, `python3`. Hooks run in exec form,
which Claude Code spawns with no shell, so the name must resolve to a
real executable. On native Windows it usually does not: the python.org
installer creates python.exe and py.exe but no python3.exe, and Windows
ships an App Execution Alias stub of that name which exits 9009 without
running Python. Existence checks pass, so the failure is invisible, and
a failed MessageDisplay hook shows the original text without an error.

Declare the hook as both `python3` and `py -3`. Entries dedupe on command
plus args so both are attempted, a failing one contributes no
displayContent, and the merge keeps the last defined one.

`python` is not a third entry. On Arch and in an activated venv it is the
same interpreter as `python3`, so it would run the transform twice per
flush for many POSIX users.

Also fix `/claude-bionify:status` reporting ON while nothing is bolded.
The commands reach Python through a shell, which resolves names the
hook's spawn cannot, so status could describe a hook that never ran. It
now warns when no declared interpreter starts, judging each by running it
rather than locating it, and discounting one that only resolves because
Windows searches our own directory before PATH.

The commands keep their single-command form. A `python3 || py -3` chain
fails to parse under PowerShell 5.1, which is what shell form falls back
to when Git Bash is absent.

Refs #7.

Claude-Session: https://claude.ai/code/session_011ZEJcomZuou2T23FGSBmdd
Copilot AI lite review requested due to automatic review settings August 16, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abullard1
abullard1 merged commit 4c300bc into main Aug 16, 2026
7 checks passed
@abullard1
abullard1 deleted the fix/windows-interpreter-1.0.5 branch August 16, 2026 15:12
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.

Hook never starts on native Windows: python3 does not resolve to Python

2 participants