[Bug] Plugin hooks fail on Windows with spaces in username path
Bug Description
Bug Report: Plugin Hooks Fail on Windows with Spaces in Username
Environment:
- OS: Windows
- Username path: C:\Users\Burak Demir (contains space)
- Claude Code version: 2.0.76
- Installation method: native
Issue:
Claude Code fails to start plugin hooks when the Windows username contains spaces.
Error messages on startup:
SessionStart:startup says: Plugin hook error: 'C:\Users\Burak' is not recognized as an internal or external command,
operable program or batch file.
Error: Cannot find module 'C:\Users\Burak'
at Module._resolveFilename (node:internal/modules/cjs/loader:1420:15)
...
code: 'MODULE_NOT_FOUND'
The path is being split at the space character, treating "C:\Users\Burak" as the command and "Demir" as a separate argument.
Affected plugins:
- superpowers
- double-shot-latte
- learning-output-style
- episodic-memory
Root cause:
Plugin hook scripts (.sh and .cmd files) are not properly quoting paths when executing on Windows with spaces in the username.
Workaround:
Temporarily renaming the plugins folder resolves the issue, but disables all plugins.
Expected behavior:
Plugin hooks should work correctly regardless of whether the Windows username contains spaces.
Suggested fix:
All path references in plugin hook execution should be properly quoted or escaped for Windows compatibility.
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.0.76
- Feedback ID: 53a5be72-0240-46f8-89fa-de8522b7f8cb
Errors
[{"error":"Error: Plugin hook \"C:\\Users\\Burak Demir\\.claude\\plugins\\cache\\claude-plugins-official\\learning-output-style\\dbc4a7733cd4/hooks-handlers/session-start.sh\" failed with exit code 1\nstderr: 'C:\\Users\\Burak' is not recognized as an internal or external command,\r\noperable program or batch file.\n at <anonymous> (B:/~BUN/root/claude.exe:1136:18)\n at async IZE (B:/~BUN/root/claude.exe:4662:1206)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-06T10:35:31.946Z"},{"error":"Error: Plugin hook \"node C:\\Users\\Burak Demir\\.claude\\plugins\\cache\\superpowers-marketplace\\episodic-memory\\1.0.15/cli/episodic-memory.js sync --background\" failed with exit code 1\nstderr: node:internal/modules/cjs/loader:1423\r\n throw err;\r\n ^\r\n\r\nError: Cannot find module 'C:\\Users\\Burak'\r\n at Module._resolveFilename (node:internal/modules/cjs/loader:1420:15)\r\n at defaultResolveImpl (node:internal/modules/cjs/loader:1058:19)\r\n at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1063:22)\r\n at Module._load (node:internal/modules/cjs/loader:1226:37)\r\n at TracingChannel.traceSync (node:diagnostics_channel:328:14)\r\n at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)\r\n at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)\r\n at node:internal/main/run_main_module:33:47 {\r\n code: 'MODULE_NOT_FOUND',\r\n requireStack: []\r\n}\r\n\r\nNode.js v25.2.1\n at <anonymous> (B:/~BUN/root/claude.exe:1136:18)\n at async IZE (B:/~BUN/root/claude.exe:4662:1206)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-06T10:35:31.982Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗