[BUG] Hooks not loading from settings.json - /hooks shows "No hooks configured yet" despite valid configuration
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Hooks defined in ~/.claude/settings.json are not being loaded by Claude Code. The /hooks command shows "No hooks configured yet" despite having valid hook configurations in the settings file, and debug logs confirm that Claude Code is finding 0 hook matchers when it should be loading the
configured hooks.
Environment
- Claude Code Version: 2.0.37
- Platform: macOS (Darwin 24.6.0)
- Installation: npm-global
Configuration
My ~/.claude/settings.json contains the following hooks configuration:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "afplay -v 5 /System/Library/Sounds/Funk.aiff"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "afplay -v 5 /System/Library/Sounds/Pop.aiff"
}
]
}
]
},
"alwaysThinkingEnabled": false,
"feedbackSurveyState": {
"lastShownTime": 1754057465609
},
"mcpServers": {
},
"permissions": {
"allow": [
"Bash(python*)",
"Bash(python3:*)",
"Bash(gh_issue_create:*)",
"Bash(find:*)",
"Bash(pbcopy)",
"Bash(open_http*)",
"Bash(git:*)",
"Bash(gh:*)",
"Bash(uvicorn:*)",
"Bash(chmod:*)",
"Bash(echo:*)",
"Bash(pkill:*)",
"Bash(pytest:*)",
"Bash(docker-compose:*)",
"Bash(docker:*)",
"Bash(env)",
"Bash(pip_install:*)",
"Bash(cat:*)",
"Bash(awk:*)"
],
"deny": [],
"ask": []
}
}
The JSON is valid (verified with python3 -m json.tool).
Steps to Reproduce
- Create hooks configuration in ~/.claude/settings.json as shown above
- Start Claude Code with debug mode: claude --debug
- Run the /hooks command
- Complete a task to trigger the Stop hook
What Should Happen?
Expected Behavior
- The /hooks command should display the configured Stop and Notification hooks
- The Stop hook should execute (playing a sound) when Claude finishes responding
- Debug logs should show hooks being loaded from settings
Actual Behavior
- The /hooks command shows "No hooks configured yet"
- The Stop hook never executes (no sound plays)
- Debug logs show: [DEBUG] Found 0 hook matchers in settings
Debug Log Evidence
From the debug log at ~/.claude/debug/d46cbf9a-6474-4717-881d-05bc05025a37.txt:
[DEBUG] Watching for changes in setting files /Users/boris/.claude/settings.json...
...
[DEBUG] Getting matching hook commands for SessionStart with query: startup
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "startup" (0 before deduplication)
...
[DEBUG] Getting matching hook commands for SubagentStop with query: undefined
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)
The debug log explicitly shows that Claude Code is watching the settings.json file but finding 0 hook matchers despite the hooks being defined in the file.
Additional Context
- The hooks configuration structure follows the documentation at https://code.claude.com/docs/en/hooks.md
- There is no project-level .claude/settings.json that could be overriding the global settings
- The settings.json file is being monitored (shown in debug logs)
- Other settings from the same file (mcpServers, permissions) are loading correctly
- The hook commands work when executed manually (e.g., afplay -v 5 /System/Library/Sounds/Funk.aiff plays sound successfully)
Error Messages/Logs
From the debug log at ~/.claude/debug/d46cbf9a-6474-4717-881d-05bc05025a37.txt:
[DEBUG] Watching for changes in setting files /Users/boris/.claude/settings.json...
...
[DEBUG] Getting matching hook commands for SessionStart with query: startup
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "startup" (0 before deduplication)
...
[DEBUG] Getting matching hook commands for SubagentStop with query: undefined
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)
Steps to Reproduce
- update the settings with my config
- start a new claude session
- run a command
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.37 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗