claude-code - 💡(How to fix) Fix Settings watcher only watches dirs that had a settings file at session start (silent hook failure) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54821Fetched 2026-04-30 06:35:00
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Error Message

When a user creates .claude/settings.json (or .claude/settings.local.json) in a project that didn't have one when the session started, the harness's settings watcher does not pick it up. Hooks defined in the new file silently never fire. There is no error, no log line, no UI indication. 3. Trigger the matching tool. Hook does not fire. No error.

Fix Action

Fix / Workaround

This is documented as a known footgun in the update-config skill — telling users to "open /hooks once, you can't do this yourself" — but it should not need a workaround skill at all.

RAW_BUFFERClick to expand / collapse

Problem

When a user creates .claude/settings.json (or .claude/settings.local.json) in a project that didn't have one when the session started, the harness's settings watcher does not pick it up. Hooks defined in the new file silently never fire. There is no error, no log line, no UI indication.

The only fix is to open the /hooks UI menu (which reloads config) or restart the session. This is undiscoverable — users assume their hook config is broken and waste time debugging the hook itself.

Proposed

One of:

  1. Watch .claude/ directory creation events too, so newly-created settings files in previously-empty project dirs are picked up.
  2. On file write to settings.json / settings.local.json in any project ancestor of cwd, surface a one-time message: "Settings changed — open /hooks or restart to apply."
  3. Auto-reload settings on file write, the same way the watcher already handles edits to existing files.

Reproduction

  1. Start claude in a project with no .claude/ directory.
  2. Create .claude/settings.json with a hook (e.g., a PostToolUse Write|Edit formatter).
  3. Trigger the matching tool. Hook does not fire. No error.
  4. Open /hooks menu (which closes the turn). Re-trigger. Hook now fires.

This is documented as a known footgun in the update-config skill — telling users to "open /hooks once, you can't do this yourself" — but it should not need a workaround skill at all.

extent analysis

TL;DR

The issue can be fixed by implementing a mechanism to detect and reload settings when a new .claude/settings.json or .claude/settings.local.json file is created in a project directory.

Guidance

  • To address the issue, consider watching the .claude/ directory for creation events to detect newly added settings files.
  • Another approach is to surface a one-time message when a settings.json or settings.local.json file is written in any project ancestor of the current working directory, instructing the user to open /hooks or restart to apply the changes.
  • Auto-reloading settings on file write, similar to how the watcher handles edits to existing files, could also resolve the issue.
  • Verify the fix by recreating the reproduction steps and checking if the hook fires as expected after creating the settings file.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a design or implementation decision.

Notes

The chosen solution should balance usability and performance, considering the trade-offs between automatically reloading settings, prompting the user, or requiring manual intervention.

Recommendation

Apply a workaround, such as watching the .claude/ directory for creation events or surfacing a one-time message, as implementing an auto-reload mechanism may introduce unintended side effects or performance issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Settings watcher only watches dirs that had a settings file at session start (silent hook failure) [1 participants]