Skip to content

[BUG] Backslashes stripped from ${CLAUDE_PLUGIN_ROOT} in hook commands #23204

Description

@cmathew654-dot

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On Windows, plugin hooks using ${CLAUDE_PLUGIN_ROOT} fail because backslashes are stripped from the path during variable substitution.

What Should Happen?

The ${CLAUDE_PLUGIN_ROOT} variable should be properly escaped or converted to Unix-style paths (/c/Users/...) before being passed to bash on Windows.

Error Messages/Logs

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

Steps to Reproduce

  1. Windows 11, Claude Code 2.1.31
  2. Install superpowers plugin: /plugin install superpowers@claude-plugins-official
  3. Start a new Claude Code session
  4. Observe "SessionStart:startup hook error" message
  5. Check debug log in ~/.claude/debug/.txt
    for the mangled path

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.31

Platform

Other

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Workaround: Using a hardcoded Unix-style path
(/c/Users/Cyril/...) instead of
${CLAUDE_PLUGIN_ROOT} works correctly.

The issue appears to be in how Claude Code substitutes
the variable before passing to bash - Windows
backslashes aren't escaped or converted.

Plugin affected: superpowers
(https://github.com/obra/superpowers)

Activity

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

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions