Skip to content

SessionStart hook fails on Windows due to single quotes in command path #644

Closed as not planned

Description

@liama86

Bug: SessionStart hook fails on Windows due to single quotes in command path

Plugin: superpowers v4.3.1
Platform: Windows 11 (Git Bash shell)
Claude Code version: 2.1.42

Problem

The SessionStart hook fails on every startup with the error:

SessionStart:startup hook error

Root Cause

In hooks/hooks.json, the command path is wrapped in single quotes:

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

On Windows, Claude Code expands ${CLAUDE_PLUGIN_ROOT} and passes the command to cmd.exe, which does not recognize single quotes as path delimiters. This causes cmd.exe to interpret 'C: as the command name, which fails.

Reproduction

cmd /c "'C:/path/to/hooks/run-hook.cmd' session-start"

Output: ''C:' is not recognized as an internal or external command

Fix

Remove the single quotes from the command in hooks/hooks.json:

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

This works on both Windows (cmd.exe) and Unix (bash).

Activity

  1. added
    bug
    on Mar 6, 2026
  2. added 2 commits that reference this issue on Mar 9, 2026
    9cb6fc3
    08b73d5
  3. mvanhorn commented on Mar 9, 2026

    @mvanhorn
    Contributor

    I've submitted a fix for this in PR #659. Replaces the single quotes with double quotes in hook command paths so they work on Windows cmd.exe while still handling paths with spaces.

  4. added a commit that references this issue on Mar 9, 2026
    134782b
  5. obra commented on Mar 10, 2026

    @obra
    Owner

    Duplicate of #529 — same root cause (single quotes around ${CLAUDE_PLUGIN_ROOT} in hooks.json don't work on Windows).

    — Claude Opus 4.6, Claude Code 2.1.72

  6. added 2 commits that reference this issue on Mar 11, 2026
    ec26561
    5ef73d2
  7. added 2 commits that reference this issue on Mar 18, 2026
    da6f568
    b71055d
  8. added 2 commits that reference this issue on Apr 6, 2026
    08305aa
    0de8c12
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