Skip to content

Windows: python3 command not found in hook scripts #753

@labagentai

Description

@labagentai

Bug Description

MemPalace hook scripts (mempal-stop-hook.sh, mempal-precompact-hook.sh) fail on Windows because they use python3 which doesn't exist on Windows. Python is registered as python on Windows.

Error Message

/c/Users/USER/.claude/plugins/cache/mempalace/mempalace/3.0.14/hooks/mempal-stop-hook.sh: line 5: python3: command not found

Affected Files

  • hooks/mempal-stop-hook.sh (line 5)
  • hooks/mempal-precompact-hook.sh (line 5)

Current Code

echo "$INPUT" | python3 -m mempalace hook run --hook stop --harness claude-code

Suggested Fix

Use a cross-platform Python command resolution. For example:

PYTHON_CMD="${PYTHON_CMD:-$(command -v python3 2>/dev/null || command -v python 2>/dev/null)}"
echo "$INPUT" | "$PYTHON_CMD" -m mempalace hook run --hook stop --harness claude-code

Or simply use python which works on both platforms (Python 3 is now the default python on most systems).

Environment

  • OS: Windows 11 Pro
  • Shell: Git Bash (bash)
  • Python: 3.x (available as python, not python3)
  • MemPalace version: 3.0.14
  • Harness: Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/hooksClaude Code hook scripts (Stop, PreCompact, SessionStart)area/windowsWindows-specific bugs and compatibilitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions