Platform
Claude Code
context-mode version
1.0.75 (latest)
Debug script output (REQUIRED)
{
"version": "2.0.0",
"generated": "2026-04-08T09:05:49Z",
"sections": {
"1. System Info": {
"checks": [],
"info": {
"OS type": "windows",
"uname -a": "MINGW64_NT-10.0-19045 Khalil 3.4.7-25de8b84.x86_64 2023-08-28 21:32 UTC x86_64 Msys",
"Architecture": "x86_64",
"Windows ver": "Microsoft Windows [Version 10.0.19045.6466]",
"Shell": "/bin/bash.exe",
"Bash version": "5.2.15(1)-release"
}
},
"2. Runtime Versions": {
"checks": [],
"info": {
"Node.js": "v22.22.0",
"npm": "10.9.4",
"npm global root": "C:\\Users\\TECH SHOP\\AppData\\Roaming\\npm\\node_modules"
}
},
"7. Hook Validation": {
"checks": [
{ "pass": true, "label": "PreToolUse registered" },
{ "pass": true, "label": "PostToolUse registered" },
{ "pass": true, "label": "PreCompact registered" },
{ "pass": true, "label": "SessionStart registered" }
]
},
"13. Hook Execution": {
"checks": [
{ "pass": true, "label": "PreToolUse denies WebFetch" },
{ "pass": true, "label": "PreToolUse passes Write tool through" },
{ "pass": true, "label": "SessionStart injects routing context" }
]
}
},
"summary": { "pass": 23, "fail": 7, "total": 30 }
}
Exact prompt that triggered the bug (REQUIRED)
Any prompt triggers it. The very first message after launching Claude Code shows "UserPromptSubmit hook error" and "SessionStart:resume hook
error". Example: "i restarted again last test"
Full error output (REQUIRED)
SessionStart:resume hook error
UserPromptSubmit hook error
PostToolUse:mcp__plugin_context-mode_context-mode__ctx_doctor hook error
These appear on every session start and on the first few tool calls. No stack trace is shown by Claude Code — it only displays "hook error".
Running the hook manually with an unquoted path reproduces the crash:
$ CLAUDE_PLUGIN_ROOT="C:/Users/TECH SHOP/.claude/plugins/marketplaces/context-mode"
$ echo '{}' | node $CLAUDE_PLUGIN_ROOT/hooks/userpromptsubmit.mjs
C:\Users\TECH:1
SyntaxError: Invalid or unexpected token
at wrapSafe (node:internal/modules/cjs/loader:1638:18)
at Module._compile (node:internal/modules/cjs/loader:1680:20)
Node receives C:/Users/TECH as the script path because the shell splits on the space.
Steps to reproduce (REQUIRED)
- Have a Windows username with a space (e.g. TECH SHOP)
- Install context-mode via plugin marketplace: /plugin marketplace add mksglu/context-mode then /plugin install context-mode@context-mode
- Restart Claude Code
- Send any message
- See: SessionStart:resume hook error and UserPromptSubmit hook error
What have you tried to fix it?
Upgraded to latest version (1.0.75)
- Read hooks/hooks.json — found all commands use unquoted ${CLAUDE_PLUGIN_ROOT}:
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.mjs"
- Tested manually: echo '{}' | node $CLAUDE_PLUGIN_ROOT/hooks/userpromptsubmit.mjs — crashes with SyntaxError because shell splits TECH SHOP
into two args
- Tested with quotes: echo '{}' | node "$CLAUDE_PLUGIN_ROOT/hooks/userpromptsubmit.mjs" — works perfectly
- Fix: Changed all 13 commands in hooks/hooks.json to use escaped quotes:
"command": "node "${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.mjs""
- After the fix, all hook errors are gone. Verified with a clean restart — zero errors.
Pre-submission checklist
Operating System
Windows (PowerShell)
JS Runtime
Node.js v22.22.0
Platform
Claude Code
context-mode version
1.0.75 (latest)
Debug script output (REQUIRED)
{ "version": "2.0.0", "generated": "2026-04-08T09:05:49Z", "sections": { "1. System Info": { "checks": [], "info": { "OS type": "windows", "uname -a": "MINGW64_NT-10.0-19045 Khalil 3.4.7-25de8b84.x86_64 2023-08-28 21:32 UTC x86_64 Msys", "Architecture": "x86_64", "Windows ver": "Microsoft Windows [Version 10.0.19045.6466]", "Shell": "/bin/bash.exe", "Bash version": "5.2.15(1)-release" } }, "2. Runtime Versions": { "checks": [], "info": { "Node.js": "v22.22.0", "npm": "10.9.4", "npm global root": "C:\\Users\\TECH SHOP\\AppData\\Roaming\\npm\\node_modules" } }, "7. Hook Validation": { "checks": [ { "pass": true, "label": "PreToolUse registered" }, { "pass": true, "label": "PostToolUse registered" }, { "pass": true, "label": "PreCompact registered" }, { "pass": true, "label": "SessionStart registered" } ] }, "13. Hook Execution": { "checks": [ { "pass": true, "label": "PreToolUse denies WebFetch" }, { "pass": true, "label": "PreToolUse passes Write tool through" }, { "pass": true, "label": "SessionStart injects routing context" } ] } }, "summary": { "pass": 23, "fail": 7, "total": 30 } }Exact prompt that triggered the bug (REQUIRED)
Full error output (REQUIRED)
Steps to reproduce (REQUIRED)
What have you tried to fix it?
Upgraded to latest version (1.0.75)
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.mjs"
into two args
"command": "node "${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.mjs""
Pre-submission checklist
Operating System
Windows (PowerShell)
JS Runtime
Node.js v22.22.0