SessionStart hooks fire for disabled plugins (settings.local.json override ignored)

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Jan 21, 2026 · closed Feb 28, 2026

Bug Description

When a plugin is disabled via settings.local.json, its SessionStart hooks still execute, causing startup errors.

Steps to Reproduce

  1. Have a plugin enabled in ~/.claude/settings.json:

``json
"enabledPlugins": {
"superpowers@claude-plugins-official": true
}
``

  1. Disable it via ~/.claude/settings.local.json:

``json
"enabledPlugins": {
"superpowers@claude-plugins-official": false
}
``

  1. Start Claude Code

Expected Behavior

  • The settings.local.json override should be respected
  • Hooks from disabled plugins should not execute
  • No startup error should occur

Actual Behavior

  • Error displayed: SessionStart:startup hook error
  • The plugin's SessionStart hook still fires despite being disabled in local settings
  • The hook file exists and is valid (~/.claude/plugins/cache/claude-plugins-official/superpowers/4.0.3/hooks/session-start.sh)

Environment

  • Platform: Windows 11
  • Claude Code: Latest version
  • Plugin: superpowers@claude-plugins-official

Analysis

It appears the hook registration/execution happens before settings.local.json overrides are merged with global settings, or the plugin cache doesn't check the enabled state before running hooks.

Workaround

Disabling the plugin in the global settings.json instead of settings.local.json prevents the error.

View original on GitHub ↗

11 Comments

richard-scott · 7 months ago

Important Update: Directory-Specific Behavior

After further investigation, this error only occurs in certain directories, not globally:

  • Error occurs: Starting Claude Code from ~/Projects/harrys-app (a non-git project directory)
  • No error: Starting Claude Code from ~ (home directory where ~/.claude folder lives)

Additional Context

The harrys-app directory:

  • Is NOT a git repository
  • Has no .claude folder or project-level settings
  • Contains only: app.py, CLAUDE.md, requirements.txt, .vscode/, and a few other files

Revised Theory

The hook loading behavior may differ based on:

  1. Whether the working directory is a git repository
  2. Proximity to the ~/.claude folder
  3. How project vs. global settings are resolved per-directory

This suggests the issue isn't just about settings.local.json being ignored, but rather a directory-context-dependent hook loading bug.

richard-scott · 7 months ago

Update: git init did NOT fix the issue

Initialized a git repository in the project directory, but the SessionStart:startup hook error still occurs.

This rules out the "not a git repo" theory. The issue persists even with:

  • A valid git repository
  • No project-level .claude folder
  • Standard project files only

Will continue investigating other potential causes.

richard-scott · 7 months ago

Root Cause Analysis

The hook script runs correctly when invoked directly:

cd ~/Projects/harrys-app
bash ~/.claude/plugins/cache/claude-plugins-official/superpowers/4.0.3/hooks/session-start.sh
# Outputs valid JSON, no errors

The Invocation Chain

Claude Code calls:

"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd" session-start.sh

Which on Windows invokes:

"C:\Program Files\Git\bin\bash.exe" -l "%~dp0%~1"

The -l flag creates a login shell, which sources profile files (.bash_profile, .bashrc, etc.).

Likely Cause

The error appears to be in the startup invocation context, not the hook script itself. Possible issues:

  1. CLAUDE_PLUGIN_ROOT environment variable not set correctly at startup
  2. Login shell profile sourcing causes issues on Windows before Claude fully initializes
  3. Working directory state differs between startup and running contexts
  4. The error may be in the hook wrapper dispatch, not the hook itself

Environment

  • Windows 11
  • Git Bash via C:\Program Files\Git\bin\bash.exe
  • Plugin: superpowers@claude-plugins-official v4.0.3
richard-scott · 7 months ago

Clarification: The Core Bug

I got sidetracked analyzing the hook script, but that's not the issue.

The actual bug: The superpowers plugin is disabled in settings.local.json:

"enabledPlugins": {
  "superpowers@claude-plugins-official": false
}

Yet Claude Code still attempts to run its SessionStart hook.

A disabled plugin's hooks should never execute. The error occurs because Claude Code is trying to invoke a hook from a plugin that should be completely inactive.

Expected Behavior

  • Plugin disabled in settings.local.json → hooks don't run

Actual Behavior

  • Plugin disabled in settings.local.json → hooks still run (and error)

The hook script working or not is irrelevant—it should never be called in the first place.

richard-scott · 7 months ago

This is a Blocking Bug for Multi-Machine Setups

The settings.local.json file exists specifically to allow machine-specific overrides that don't get synced to other hosts.

Use case: User syncs ~/.claude/settings.json across machines via git, but needs to disable certain plugins on specific machines via settings.local.json.

Current behavior: settings.local.json plugin overrides are ignored for hooks, forcing users to either:

  1. Disable plugins globally (breaking other machines)
  2. Stop syncing settings (losing the benefit of shared config)

Neither workaround is acceptable. The settings.local.json override mechanism needs to work for plugin hooks.

richard-scott · 7 months ago

Workaround Found

Project-level settings work, even though settings.local.json doesn't.

Creating .claude/settings.json in the project directory successfully disables the plugin:

{
  "enabledPlugins": {
    "superpowers@claude-plugins-official": false
  }
}

Summary

| Settings Location | Plugin Override | Hooks Respected? |
|-------------------|-----------------|------------------|
| ~/.claude/settings.json | ✅ Works | ✅ Yes |
| ~/.claude/settings.local.json | ❌ Ignored | ❌ No |
| <project>/.claude/settings.json | ✅ Works | ✅ Yes |

The bug is specifically with settings.local.json - it's not being applied to hook loading, while both global and project-level settings work correctly.

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/17942
  2. https://github.com/anthropics/claude-code/issues/19487
  3. https://github.com/anthropics/claude-code/issues/17017

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

richard-scott · 7 months ago

I don't think it's a duplicate, but it is similar.

My issue was that the personal settings in ~/.claude/settings.local.json are not respected in other projects.

For example, I had to create a <project>/.claude/settings.json file that also disables the same plugin that ~/.claude/settings.local.json disables.

github-actions[bot] · 6 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

richard-scott · 6 months ago

What is the point in the community reporting issues if you just IGNORE them?

Please make an effort to fix bugs and not just add new features otherwise you won't have a product users want to use!

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.