Skip to content

● v4.3.1 regressed Windows hook fix from PR #331 #529

Closed

Description

@blakazulu

Describe the bug

Superpowers v4.3.1 regressed the Windows hook fix from PR #331. The hooks.json was changed back to use run-hook.cmd
instead of calling session-start.sh directly, causing SessionStart:startup hook error on every Claude Code startup
on Windows. v4.3.0 had the correct fix ("command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"), but v4.3.1 reverted to
"command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start". Additionally, v4.3.1 renamed
session-start.sh to session-start (no extension), which breaks Claude Code's auto-detection of .sh files on
Windows.

To Reproduce

  1. Install superpowers plugin on Windows (Claude Code v2.1.32, Windows 11)
  2. Start Claude Code (claude or claude --verbose)
  3. Observe: SessionStart:startup hook error

Expected behavior

Clean startup with no hook error, and the superpowers context injected into the session.

Logs

▐▛███▜▌ Claude Code v2.1.32
▝▜█████▛▘ Opus 4.6 · Claude Max
▘▘ ▝▝ C:\mypart_sc\postman
⎿ SessionStart:startup hook error

Additional context

  • Claude Code v2.1.32, Windows 11 (MSYS_NT-10.0-26200)
  • Git Bash is first in PATH (C:\Program Files\Git\usr\bin\bash.exe)
  • This is the same issue as [Bug] SessionStart:startup hook error #275, which was fixed by PR fix: Windows hook execution for Claude Code 2.1.x #331 but regressed in v4.3.1
  • The session-start script itself works fine when called directly via bash
  • v4.3.0 hooks/hooks.json: "command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh" (correct)
  • v4.3.1 hooks/hooks.json: "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start" (broken)
  • Attempted applying the same fix from PR fix: Windows hook execution for Claude Code 2.1.x #331 (pointing to session-start.sh) — error persisted on v2.1.32,
    suggesting Claude Code may have changed how it handles hook commands since v2.1.x
  • Workaround: empty the hooks in hooks.json ({"hooks": {}}) — skills still work via the Skill tool, just without
    auto-context injection at startup

Activity

  1. added
    bug
    on Feb 22, 2026
  2. thebtf commented on Feb 25, 2026

    @thebtf

    Confirmed on Claude Code v2.1.58, Windows 11 Pro.

    Root cause analysis:

    cmd.exe treats single quotes as literal characters, not string delimiters. So the command:

    '${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start
    

    is interpreted as a filename starting with 'C:\..., which doesn't exist → exit 1 / "filename syntax incorrect".

    Workaround applied (while waiting for upstream fix):

    Edit ~/.claude/plugins/cache/claude-plugins-official/superpowers/<version>/hooks/hooks.json and remove the single quotes:

    // Before (broken):
    "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start"
    
    // After (working):
    "command": "${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd session-start"

    Note: run-hook.cmd itself works correctly — the issue is solely the wrapping single quotes in the hooks.json command string.

    The fix from v4.3.0 (session-start.sh) was cleaner. For Windows compatibility, either approach works as long as single quotes are absent from the cmd.exe command string.

  3. jtuskan commented on Feb 28, 2026

    @jtuskan

    Confirming a fix for this on Windows 11 + Claude Code + Git Bash.

    Root cause: Single quotes in hooks.json don't work as quoting characters in CMD.exe. CMD treats them as literal characters, so it tries to execute a file with ' in the filename:

    'un-hook.cmd'' is not recognized as an internal or external command,
    operable program or batch file.
    

    Fix: Change single quotes to escaped double quotes in hooks/hooks.json:

    - "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start",
    + "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",

    The polyglot run-hook.cmd wrapper and extensionless session-start script both work correctly once the quoting is fixed — the JSON output is produced as expected. This is consistent with the polyglot-hooks.md documentation which shows escaped double quotes in its examples.

  4. obra commented on Mar 11, 2026

    @obra
    Owner

    Fixed via #585 (merged to dev) — single quotes replaced with escaped double quotes in hooks.json, exactly as @thebtf and @jtuskan diagnosed in the comments here.

    Verified the fix on a Windows 11 dev box (NT 10.0.26200.0) with Claude Code 2.1.72: single quotes fail in cmd.exe, escaped double quotes work universally across cmd.exe, Git Bash, and macOS bash (with and without spaces in the path).

    — Claude Opus 4.6, Claude Code 2.1.72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions