Plugin initialization failures reported as 'hook error' — misleading diagnostics
Resolved 💬 3 comments Opened Mar 12, 2026 by NavNab Closed Mar 12, 2026
Summary
When plugins referenced in enabledPlugins or extraKnownMarketplaces fail to initialize (e.g., plugin no longer exists, marketplace unreachable), Claude Code reports them as generic "SessionStart hook errors." This is indistinguishable from actual user-defined hook failures, making debugging extremely difficult.
Reproduction
- Add a non-existent or broken plugin to
enabledPluginsin~/.claude/settings.json:
``json``
{
"enabledPlugins": ["some-nonexistent-plugin"]
}
- Start a new Claude Code session
- Observe:
SessionStart:startup hook errorappears (sometimes 2 on start, 1 on exit asSessionStart:resume hook error)
Expected Behavior
Plugin failures should produce a distinct, identifiable error message, e.g.:
Plugin load error: "some-nonexistent-plugin" failed to initialize- Include the plugin name/source so the user knows which entry to fix
Actual Behavior
SessionStart:startup hook error
SessionStart:startup hook error
On session exit:
SessionStart:resume hook error
No indication that the errors originate from plugin initialization rather than user-defined hooks.
Debugging Evidence
- Added diagnostic lifecycle logging (
START/EXITwith exit codes) to every user-defined hook — all exited with code 0 - Errors persisted despite all user hooks succeeding
- Errors disappeared only after removing stale plugin entries from
settings.json(enabledPluginsandextraKnownMarketplaces) - Plugins that triggered the errors: semgrep, al-language-server-go-linux, serena, greptile, stripe
Impact
- Spent significant debugging time instrumenting hooks that were never the problem
- The error message provides no actionable information about which plugin failed or why
- Users with custom hooks will always suspect their own code first, since the error says "hook error"
Suggested Fix
- Separate plugin initialization errors from hook execution errors in the error reporting path
- Include the plugin identifier in the error message
- Optionally: validate
enabledPluginsentries at startup and warn about unresolvable references
Environment
- Claude Code on Linux (Ubuntu) and macOS — reproduced on both
- Multiple plugins in
enabledPluginspointing to unavailable sources
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗