Bug Description
Slash commands like /sessions fail with MODULE_NOT_FOUND because the script require path falls back to ~/.claude/scripts/lib/ which doesn't exist.
Root Cause
The require pattern in slash command .md files:
require((process.env.CLAUDE_PLUGIN_ROOT || require('path').join(require('os').homedir(), '.claude')) + '/scripts/lib/session-manager')
CLAUDE_PLUGIN_ROOT is only injected by Claude Code's harness when executing hooks, not slash commands
- The fallback path
~/.claude/scripts/lib/ doesn't exist — the actual scripts are at ~/.claude/plugins/marketplaces/everything-claude-code/scripts/lib/
Affected Commands
All slash commands using this pattern: /sessions (10 occurrences in sessions.md)
Contrast with Hooks
Hooks have proper multi-path fallback logic (added in v1.8.0 "SessionStart root fallback"):
for root in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME/.claude/plugins/everything-claude-code" "$HOME/.claude/plugins/everything-claude-code@everything-claude-code" "$HOME/.claude/plugins/marketplace/everything-claude-code"; do ...
Slash commands don't have equivalent fallback.
Error
Error: Cannot find module '/Users/xxx/.claude/scripts/lib/session-manager'
Suggested Fix
Apply the same multi-path fallback logic to slash commands, or use a helper function that resolves the plugin root dynamically. For example:
function resolvePluginRoot() {
const path = require('path');
const fs = require('fs');
const home = require('os').homedir();
const candidates = [
process.env.CLAUDE_PLUGIN_ROOT,
path.join(home, '.claude/plugins/marketplaces/everything-claude-code'),
path.join(home, '.claude/plugins/everything-claude-code'),
path.join(home, '.claude/plugins/cache/everything-claude-code/everything-claude-code/1.8.0'),
].filter(Boolean);
for (const root of candidates) {
if (fs.existsSync(path.join(root, 'scripts/lib/session-manager.js'))) return root;
}
throw new Error('ECC plugin root not found');
}
Environment
- Claude Code CLI
- Plugin: everything-claude-code v1.8.0 (installed via marketplace)
- OS: macOS
Bug Description
Slash commands like
/sessionsfail withMODULE_NOT_FOUNDbecause the script require path falls back to~/.claude/scripts/lib/which doesn't exist.Root Cause
The require pattern in slash command
.mdfiles:CLAUDE_PLUGIN_ROOTis only injected by Claude Code's harness when executing hooks, not slash commands~/.claude/scripts/lib/doesn't exist — the actual scripts are at~/.claude/plugins/marketplaces/everything-claude-code/scripts/lib/Affected Commands
All slash commands using this pattern:
/sessions(10 occurrences insessions.md)Contrast with Hooks
Hooks have proper multi-path fallback logic (added in v1.8.0 "SessionStart root fallback"):
Slash commands don't have equivalent fallback.
Error
Suggested Fix
Apply the same multi-path fallback logic to slash commands, or use a helper function that resolves the plugin root dynamically. For example:
Environment