Summary
On native Windows Claude Code, context-mode has repeatedly hit startup/runtime hook failures after upgrade or reinstall when plugin-managed files use ${CLAUDE_PLUGIN_ROOT} in hook commands and MCP startup args.
Observed failures include:
Failed with non-blocking status code: node:internal/modules/cjs/loader:1479
SessionStart:startup hook error
PostToolUse:Edit hook error
PostToolUse:TaskUpdate hook error
UserPromptSubmit hook error
This has now been observed across multiple versions, including 1.0.98 and 1.0.103.
What keeps reproducing
After upgrade/reinstall, these plugin-managed files revert to placeholder-based paths again:
.claude-plugin/plugin.json
hooks/hooks.json
Examples from fresh plugin state:
"args": ["${CLAUDE_PLUGIN_ROOT}/start.mjs"]
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/sessionstart.mjs\""
In this Windows environment, that placeholder family repeatedly correlates with runtime loader failures.
Important observations
ctx-doctor can still pass.
- Direct
node --check on hook scripts can still pass.
- Direct manual
node <absolute-path> execution of hook scripts can still pass.
- Failures show up during real Claude runtime hook execution.
- Upgrades overwrite the local workaround and the problem returns.
Working local workaround
Replacing ${CLAUDE_PLUGIN_ROOT} with absolute Windows-safe paths in both places restores stability locally:
hooks/hooks.json
posttooluse.mjs
precompact.mjs
pretooluse.mjs
userpromptsubmit.mjs
sessionstart.mjs
.claude-plugin/plugin.json
- replace
${CLAUDE_PLUGIN_ROOT}/start.mjs with absolute path
After that:
- startup hook errors stop
- slash commands return
- MCP tools return
ctx-doctor passes
Why I think this is upstream-worthy
- It has reproduced across multiple versions.
- It is not durable: upgrade restores placeholder-based registration and the issue comes back.
- The current working fix is stable locally.
- This suggests either:
context-mode should not rely on ${CLAUDE_PLUGIN_ROOT} on native Windows Claude Code, or
- Claude Code on Windows is expanding/invoking
${CLAUDE_PLUGIN_ROOT} incorrectly during plugin hook execution.
Request
Could you please evaluate one of these directions?
- Add a Windows-safe registration strategy that avoids
${CLAUDE_PLUGIN_ROOT} for Claude Code hooks / MCP startup on native Windows.
- Detect broken Windows runtime expansion and self-heal during install/upgrade.
- Document whether
${CLAUDE_PLUGIN_ROOT} is known to be unreliable on native Windows Claude Code.
I can provide sanitized follow-up details if useful, but I am intentionally omitting machine-specific personal paths from this report.
Summary
On native Windows Claude Code,
context-modehas repeatedly hit startup/runtime hook failures after upgrade or reinstall when plugin-managed files use${CLAUDE_PLUGIN_ROOT}in hook commands and MCP startup args.Observed failures include:
Failed with non-blocking status code: node:internal/modules/cjs/loader:1479SessionStart:startup hook errorPostToolUse:Edit hook errorPostToolUse:TaskUpdate hook errorUserPromptSubmit hook errorThis has now been observed across multiple versions, including
1.0.98and1.0.103.What keeps reproducing
After upgrade/reinstall, these plugin-managed files revert to placeholder-based paths again:
.claude-plugin/plugin.jsonhooks/hooks.jsonExamples from fresh plugin state:
In this Windows environment, that placeholder family repeatedly correlates with runtime loader failures.
Important observations
ctx-doctorcan still pass.node --checkon hook scripts can still pass.node <absolute-path>execution of hook scripts can still pass.Working local workaround
Replacing
${CLAUDE_PLUGIN_ROOT}with absolute Windows-safe paths in both places restores stability locally:hooks/hooks.jsonposttooluse.mjsprecompact.mjspretooluse.mjsuserpromptsubmit.mjssessionstart.mjs.claude-plugin/plugin.json${CLAUDE_PLUGIN_ROOT}/start.mjswith absolute pathAfter that:
ctx-doctorpassesWhy I think this is upstream-worthy
context-modeshould not rely on${CLAUDE_PLUGIN_ROOT}on native Windows Claude Code, or${CLAUDE_PLUGIN_ROOT}incorrectly during plugin hook execution.Request
Could you please evaluate one of these directions?
${CLAUDE_PLUGIN_ROOT}for Claude Code hooks / MCP startup on native Windows.${CLAUDE_PLUGIN_ROOT}is known to be unreliable on native Windows Claude Code.I can provide sanitized follow-up details if useful, but I am intentionally omitting machine-specific personal paths from this report.