Hooks stop firing entirely after editing settings.local.json — Desktop 2.1.156 Windows

Open 💬 1 comment Opened Jun 2, 2026 by SAKSCJ

Hooks stop firing entirely after editing settings.local.json — Claude Code Desktop 2.1.156 Windows

Summary

After editing .claude/settings.local.json on Windows, ALL hooks across ALL phases (UserPromptSubmit, PreToolUse, PostToolUse) stop firing entirely. Restarting Claude Code Desktop does NOT recover hook execution. Rolling back the settings file to a known-good state and restarting also does NOT recover.

Environment

  • Claude Code Desktop version: 2.1.156 (from ~/.claude/sessions/{pid}.json)
  • Claude Code CLI version: 2.1.150 (from claude --version)
  • OS: Windows
  • Project type: Standard, .claude/settings.local.json with ~40 hooks across 7 phases

Steps to Reproduce

  1. Start Claude Code with a project that has hooks defined in .claude/settings.local.json
  2. Confirm hooks are firing (telemetry/marker files being written)
  3. Edit .claude/settings.local.json (add a new hook entry, or modify existing — valid JSON)
  4. Continue using Claude Code in the same session

Expected Behavior

  • File watcher detects the edit
  • Hook configuration hot-reloads
  • All hooks continue firing on their respective phases
  • New/edited hooks become active

Actual Behavior

  • All hooks STOP firing immediately after the edit
  • NO hooks fire on any phase from that moment on
  • Restarting Claude Code Desktop does NOT recover
  • Restarting with rolled-back (pre-edit) settings does NOT recover
  • Adding the BOM/CRLF line endings to match Windows defaults does NOT recover

Evidence

Hook firing was working

audits/telemetry/sa/2026-05-30.jsonl — 89 KB (hundreds of persona-enforcer events)

After edit on 2026-05-31 ~20:33

audits/telemetry/sa/2026-05-31.jsonl — 388 bytes (1 entry from manual stdin pipe test)
audits/telemetry/sa/2026-06-01.jsonl — DOES NOT EXIST
audits/telemetry/sa/2026-06-02.jsonl — 5 entries between 09:50-10:04 only, then NOTHING

Today 2026-06-02 reproduction test

  1. Settings.local.json hooks worked between 09:50 and 10:04 (5 telemetry entries)
  2. Edited settings.local.json at 10:13 (added a test hook with marker-file output)
  3. Wrote "test" as user prompt at 10:14 — NO marker file created, NO telemetry entry
  4. Restarted Claude Code Desktop (3 fresh PIDs created: 2664, 16228, 29372)
  5. Wrote multiple prompts after restart — STILL no telemetry entries
  6. Rolled settings.local.json back to a backup from 2026-05-31 14:37 (before any modifications today)
  7. Converted file encoding to CRLF (Windows standard)
  8. Restarted Claude Code Desktop AGAIN
  9. Wrote prompts — STILL no telemetry entries (mtime stuck at 10:08)

Hook code is functional

Manually piping stdin to the hook works fine:

echo '{"prompt":"test","session_id":"test","cwd":"/path"}' | node .claude/hooks/persona-enforcer.js
# → writes telemetry file correctly

So the issue is NOT in the hook scripts themselves — Claude Code is simply not invoking them.

Settings file is structurally valid

- JSON.parse() succeeds
- All 44 hook entries have type: "command", command: string, timeout: number
- All hook file paths exist on disk
- Schema matches the documented format that worked previously

/hooks slash command is not available

/hooks → "/hooks isn't available in this environment."

So I cannot inspect the loaded hook state in-session to verify if the registration silently failed.

Affected hook phases

All of them. Tested:

  • UserPromptSubmit — 7 hooks registered, 0 firing
  • PreToolUse (matcher: Write|Edit|MultiEdit) — 12 hooks registered, 0 firing
  • PreToolUse (matcher: Bash) — 2 hooks registered, 0 firing
  • PostToolUse — 9 hooks registered, 0 firing
  • SessionStart — possibly firing on start but no telemetry written
  • Stop — untested
  • SessionEnd — untested

Hypothesis

Settings hot-reload mechanism in 2.1.156 has a silent failure mode that:

  1. Drops the hook configuration when the file is edited mid-session
  2. Persists the dropped state to some cache that survives application restart
  3. Cannot be recovered without some unknown reset action

Workarounds tried (none worked)

  • Restart Claude Code Desktop (multiple fresh PIDs)
  • Roll back settings.local.json to pre-edit backup
  • Convert file encoding LF → CRLF (Windows standard)
  • Validate JSON schema strictly
  • Verify all hook file paths exist

What I need

  • A way to force Claude Code to re-read settings.local.json (some cache-bust command)
  • Confirmation whether file-watcher behavior changed in 2.1.156
  • Documentation of the silent-drop behavior so we can avoid the trigger pattern
  • The /hooks slash command back, or an alternative diagnostic command

Reproducer files (can share)

  • Full settings.local.json (sanitized)
  • Telemetry directory showing the abrupt stop
  • Session files from ~/.claude/sessions/ showing multiple restart attempts

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗