Skip to content

SessionStart hook fails on WSL : CLAUDE_PLUGIN_ROOT contains Windows-style backslashes, run-hook.cmd "not found" #2091

Closed as not planned

Description

@emmaanuel
  • I searched existing issues and this is not a duplicate (checked issues mentioning CLAUDE_PLUGIN_ROOT, run-hook.cmd and "SessionStart hook fails" — related reports are all closed as fixed, and none describe backslashes appearing in CLAUDE_PLUGIN_ROOT while running under WSL2/Linux, so this looks like a regression rather than a straight duplicate.)

Environment (required)

Field Value
Superpowers version 6.2.0
Harness (Claude Code, Cursor, etc.) GitHub Copilot (VS Code) — plugin hooks loaded from ~/.copilot/installed-plugins/superpowers-marketplace/superpowers
Harness version Visual Studio Code 1.131
Your model + version Sonnet 5
All plugins installed superpowers-marketplace/superpowers
OS + shell WSL 2 under windows 11. Linux (remote/VS Code Server, /home/manu/.vscode-server), /bin/sh

Is this a Superpowers issue or a platform issue?

  • I confirmed this issue does not occur without Superpowers installed
    (likely a harness bug in how GitHub Copilot Chat substitutes CLAUDE_PLUGIN_ROOT for hook commands — filing here first since it breaks Superpowers' SessionStart hook specifically, and run-hook.cmd's own path-handling can't work around it, see analysis below)

What happened?

On session start, the SessionStart hook fails with not found because the CLAUDE_PLUGIN_ROOT environment variable substituted into the hook command uses Windows-style backslash path separators, even though the hook is executed on Linux via /bin/sh.

The configured command in hooks/hooks.json is:

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

After substitution it became:

"\home\manu\.copilot\installed-plugins\superpowers-marketplace\superpowers/hooks/run-hook.cmd" session-start

Since /bin/sh treats backslashes as literal characters (not path separators) on Linux, this does not resolve to the actual file /home/manu/.copilot/installed-plugins/superpowers-marketplace/superpowers/hooks/run-hook.cmd, and the shell reports the whole string as a nonexistent command.

Steps to reproduce

  1. Install the Superpowers plugin in Copilot CLI on a Windows/WSL2. Start VSCode
  2. Start/resume a Copilot Chat session in that workspace (triggers SessionStart).
  3. Observe the debug log for the SessionStart hook execution.

Expected behavior

CLAUDE_PLUGIN_ROOT should be a valid POSIX path (forward slashes) when the hook is executed on a Linux/POSIX shell, so run-hook.cmd resolves and runs correctly.

Actual behavior

CLAUDE_PLUGIN_ROOT is substituted with backslash separators, producing an unresolvable path and this error:

/bin/sh: 1: \home\manu\.copilot\installed-plugins\superpowers-marketplace\superpowers/hooks/run-hook.cmd: not found

The SessionStart hook silently fails to inject its context as a result.

Debug log or conversation transcript

2026-08-05 09:21:22.229 [info] [#0] [SessionStart] Running: {"command":"\"\\home\\manu\\.copilot\\installed-plugins\\superpowers-marketplace\\superpowers/hooks/run-hook.cmd\" session-start","cwd":{"$mid":1,"fsPath":"/home/manu/git/xxxxx","path":"/home/manu/git/xxxxx","scheme":"file"},"env":{"CLAUDE_PLUGIN_ROOT":"\\home\\manu\\.copilot\\installed-plugins\\superpowers-marketplace\\superpowers"}}
2026-08-05 09:21:22.229 [info] [#0] [SessionStart] Output: /bin/sh: 1: \home\manu\.copilot\installed-plugins\superpowers-marketplace\superpowers/hooks/run-hook.cmd: not found

Note: cwd.fsPath/cwd.path in the same log entry correctly use forward slashes (/home/manu/git/xxxxx), while CLAUDE_PLUGIN_ROOT alone uses backslashes — suggesting the plugin root path is computed on a different code path/OS context (client side?) than cwd.

Activity

  1. added
    bug
    on Aug 5, 2026
  2. added
    copilot
    hooks
    upstream-bug
    on Aug 17, 2026
  3. arittr commented on Aug 17, 2026

    @arittr
    Collaborator

    Thanks — confirmed the shape of this: the hook receives a backslashed CLAUDE_PLUGIN_ROOT and the path lookup fails before anything runs. Fix queued on our side; we'll also report the substitution behavior upstream so it gets fixed at the source.

  4. obra commented on Oct 22, 2026

    @obra
    Owner

    Hi @emmaanuel, I'm Claude, an AI agent (Claude Opus 5.5, running in Claude Code 2.1.308), posting from Jesse (@obra)'s account at his direction. Jesse reviewed the finding below and asked me to close this.

    Thanks for the detailed log. It made this easy to pin down. The backslashed path comes from VS Code itself, before Superpowers runs anything. VS Code computes CLAUDE_PLUGIN_ROOT on the Windows side (URI.fsPath, which uses Windows separators) and then hands that path to /bin/sh inside WSL. We rebuilt that exact command from VS Code's path code and got the same \home\...\run-hook.cmd: not found. Copilot CLI on Linux runs the same hook without trouble. Nothing in our hooks.json or run-hook.cmd can fix this, because the wrong path is already in both the command and the environment when the shell starts. The fix mentioned earlier in this thread didn't land, and we haven't found a safe change on our side that would help.

    The upstream bug is tracked at microsoft/vscode#337374. An earlier report, microsoft/vscode#313201, was closed as a duplicate of it. Adding your log and VS Code version there is the best way to get it fixed. I'm closing this here as an upstream issue. If it still happens once VS Code ships a fix, please reopen and we'll take another look.


    If any of the evidence above is wrong, reply here. Jesse reads these, and decisions can be revisited.

    — Claude Opus 5.5, Claude Code 2.1.308, session https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba

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

    bugcopilothooksupstream-bugwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions