hooks_enabled=false (plugin userConfig) not honored at runtime; hook bootstrap crashes under CLAUDE_CONFIG_DIR profiles
Bug: hooks_enabled=false (plugin userConfig) not honored at runtime; hook bootstrap crashes under CLAUDE_CONFIG_DIR profiles
ECC: 2.2.2 (ecc@ecc, installed via claude plugin install ecc@ecc)
Claude Code: 2.1.278 · OS: macOS (darwin 27.0.0)
Summary
Two related problems when ECC is installed as a Claude Code plugin into a secondary config dir (CLAUDE_CONFIG_DIR=~/.claude-ecc):
- The
hooks_enableduserConfig option (defaulttrue, set tofalseviaclaude plugin install ecc@ecc --config hooks_enabled=false, stored underpluginConfigsin settings.json) is not referenced by any hook runtime code — the only matches in the tree arescripts/lib/claude-plugin-setup.js(CLI installer path) andhooks/README.md. Result: all 24 hook commands inhooks/hooks.json(PreToolUse:9, Stop:7, SessionStart:2, PreCompact:1, PostToolUse:2, PostToolUseFailure:2, SessionEnd:1) remain registered and attempt to run regardless of the config. - The hook commands use an inline
node -ebootstrap that resolves the ECC root fromCLAUDE_PLUGIN_ROOT, else falls back to~/.claude(path.join(os.homedir(), '.claude')) — ignoringCLAUDE_CONFIG_DIR. When the hook process doesn't receiveCLAUDE_PLUGIN_ROOT, resolution lands on the main profile's.claudedir,require('scripts/hooks/plugin-hook-bootstrap.js')fails withnode:internal/modules/cjs/loader:1433 (Cannot find module), and the SessionStart hook errors (non-blocking) on every session start.
Repro
CLAUDE_CONFIG_DIR=~/.claude-ecc claude plugin marketplace add affaan-m/ECC
CLAUDE_CONFIG_DIR=~/.claude-ecc claude plugin install ecc@ecc --config hooks_enabled=false
CLAUDE_CONFIG_DIR=~/.claude-ecc claude # fresh session in any dir→ SessionStart:startup hook error — Failed with non-blocking status code: node:internal/modules/cjs/loader:1433
Verified empirically: with CLAUDE_PLUGIN_ROOT=<plugin cache> exported, the bootstrap runs cleanly (exit 0, emits valid SessionStart JSON) — so the failure is specifically the env-less homedir fallback.
Expected
hooks_enabled=falseshould disable plugin hooks at runtime (per its own description: "Disable this to keep skills and commands without local hook automation").- The bootstrap fallback should respect
CLAUDE_CONFIG_DIR(or fail silently/consistently).
Workaround applied
Emptied the cached hook registry (hooks/hooks.json → {"hooks":{}}) in the plugin cache; original preserved as hooks.json.disabled-hooks-bak. Skills, agents, and commands continue to work.
Happy to provide further env details if useful.
Source: affaan-m/ECC