Skip to content

Windows: Hooks fail silently because python3 command not found #20

@GoodAlex223

Description

@GoodAlex223

Problem

On Windows, the auto-memory hooks fail silently because python3 is not a valid command. Windows uses python instead, and the Windows Store provides a python3.exe stub that shows an error message rather than executing Python.

Symptoms

  • PostToolUse hooks appear to run (logs show "Matched 2 unique hooks for Edit")
  • But dirty-files is never populated with edited files
  • Stop hook fires but outputs plain text (not JSON block), so memory-updater is never triggered
  • No errors shown in Claude Code - hooks fail silently

Root Cause

The hooks in hooks/hooks.json use python3:

"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.py"

On Windows:

  • python3 doesn't exist natively (Windows uses python)
  • Windows Store installs a python3.exe stub in %LOCALAPPDATA%\Microsoft\WindowsApps\ that shows "Python was not found; run without arguments to install from the Microsoft Store..."
  • This stub takes precedence and causes the hook scripts to fail

Solution (User Workaround)

Disable the Windows Store Python alias:

  1. Open Settings → Apps → Advanced app settings → App execution aliases
  2. Turn OFF the toggle for python3.exe

This allows a user-created python3 script/alias to work, or the hooks can find Python through other means.

Suggested Fix

Consider one of these approaches for the plugin:

Option 1: Use python with fallback

"command": "python ${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.py"

(Most Python 3 installations on Windows use python, not python3)

Option 2: Cross-platform detection

"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.py || python ${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.py"

Option 3: Document Windows requirement

Add a note in README about Windows requiring the Store alias to be disabled or a python3 alias to be created.

Environment

  • OS: Windows 10/11
  • Python: 3.13.5 (installed via python.org, not Store)
  • Claude Code: 2.1.21
  • auto-memory plugin: 0.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions