Windows: ${CLAUDE_PLUGIN_ROOT} backslashes stripped when passed to bash hooks

Resolved 💬 5 comments Opened Feb 1, 2026 by puneet1409 Closed Mar 16, 2026

Description

On Windows, when a plugin hook uses ${CLAUDE_PLUGIN_ROOT} in its command, the backslashes in the Windows path are stripped when the command is passed to bash.

Steps to Reproduce

  1. Install the superpowers plugin on Windows
  2. Start a new Claude Code session
  3. Observe the startup hook error

Expected Behavior

The path should be correctly passed to bash. Either:

  • Convert backslashes to forward slashes (bash on Windows handles these)
  • Properly escape the backslashes

Actual Behavior

From debug log:

Hook SessionStart:startup (SessionStart) error:
/bin/bash: C:Userspunee.claudepluginscacheclaude-plugins-officialsuperpowers4.1.1/hooks/session-start.sh: No such file or directory

The path C:\Users\punee\.claude\plugins\cache\claude-plugins-official\superpowers\4.1.1 becomes C:Userspunee.claudepluginscacheclaude-plugins-officialsuperpowers4.1.1 (all backslashes removed).

Workaround

Manually edit the plugin's hooks.json to use a hardcoded path with forward slashes:

"command": "C:/Users/username/.claude/plugins/cache/claude-plugins-official/superpowers/4.1.1/hooks/session-start.sh"

Environment

  • Claude Code version: 2.1.29
  • OS: Windows 11
  • Bash: GNU bash 5.2.37 (Git Bash)

Additional Context

The hooks.json in superpowers plugin uses:

"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"

This variable interpolation works on macOS/Linux but fails on Windows due to the backslash handling.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗