[BUG] hooks don't seem to work per-project

Resolved 💬 6 comments Opened Jul 6, 2025 by steveklabnik Closed Jul 7, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.43
  • Operating System: Ubuntu in WSL
  • Terminal: VS Code Terminal

Bug Description

https://docs.anthropic.com/en/docs/claude-code/hooks#configuration describes hooks as being per-project, but claude code does not seem to pick up this config.

Steps to Reproduce

but I have this in my .claude/settings.json:

{
  "hooks": [
    {
      "matcher": {
        "tool": ["Edit", "MultiEdit", "Write"],
        "pathGlob": "**/*.rs"
      },
      "events": {
        "PostToolUse": "cargo +nightly fmt"
      }
    },

Expected Behavior

I expect the hook to run/

Actual Behavior

yet claude --debug shows:

● Update(foo.rs)
  ⎿  Updated foo.rs with 1 addition and 1 removal    
       36    /// Request to foo a bar
       37    #[derive(Clone)]
       38    pub struct Foo {
       39 -      pub role: String,
       39 +      pub role: String,pub timestamp:Option<String>,
       40    }
       41    
       42    /// Request to baz a bar
[DEBUG] Executing hooks for PostToolUse:Edit
[DEBUG] Getting matching hook commands for PostToolUse with query: Edit
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 hooks for query "Edit"
[DEBUG] Found 0 hook commands to execute

Additional Context

This is my first time using hooks so I may have just made a very basic mistake here.

View original on GitHub ↗

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