hookify hooks use python3, fail on windows when only py works

Open Beginner friendly
#113,812 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, typescript
Domain
tooling

Research direction

Start with plugins/hookify/hooks/hooks.json and compare its Python invocation with the security-guidance plugin's sg-python.sh, which the issue says tries python3, python, then py -3 while skipping the Microsoft Store shortcut. Update hookify so its hooks find a working Python on Windows and continue to work on macOS and Linux; verify the hook commands cover the reported events.

Written by the indexing model from the issue text.

Description

area:hooks area:plugins bug platform:windows
Preflight Checklist
  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code
What's Wrong?

all the hookify hooks run with a hardcoded python3 (plugins/hookify/hooks/hooks.json). on my pc python3 and python are both the microsoft store shortcut, not real python, so every hook fails and none of my hookify rules run. only py -3 works.

What Should Happen?

hookify should find a working python like the security-guidance plugin already does with its sg-python.sh (tries python3, python, then py -3 and skips the store shortcut). using that for hookify too would fix it.

Error Messages/Logs
PreToolUse:Read hook error
Failed with non-blocking status code: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

same thing on PreToolUse:Bash, PostToolUse:Bash and Stop.
Steps to Reproduce
  1. windows, python installed so only py works (python/python3 are the store shortcuts)
  2. install hookify and add any rule
  3. use any tool
  4. every hookify hook fails with "Python was not found"
Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.335 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

workaround: changed python3 to py -3 in the cached hooks.json, but it gets overwritten on update and wouldnt work on mac/linux.

older issues about python3 got closed but hooks.json still uses it on main. switching to python like they suggested wouldnt help here since python is also the store shortcut.

Dominant language
TypeScript
Stars
158k
Forks
25.1k
Avg merge
1d 8h
Merged PRs (30d)
4

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.