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

  1. Add a non-existent or broken plugin to enabledPlugins in ~/.claude/settings.json:

``json
{
"enabledPlugins": ["some-nonexistent-plugin"]
}
``

  1. Start a new Claude Code session
  2. Observe: SessionStart:startup hook error appears (sometimes 2 on start, 1 on exit as SessionStart: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/EXIT with 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 (enabledPlugins and extraKnownMarketplaces)
  • 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 enabledPlugins entries at startup and warn about unresolvable references

Environment

  • Claude Code on Linux (Ubuntu) and macOS — reproduced on both
  • Multiple plugins in enabledPlugins pointing to unavailable sources

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗