PostToolUse hooks not triggering after Edit/Write tool calls on macOS

Resolved 💬 3 comments Opened Apr 3, 2026 by TimJi Closed Apr 7, 2026

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?

PostToolUse hooks configured in .claude/settings.json are not triggering after Edit/Write tool calls in Claude Code Desktop on macOS. The same configuration format appears correct per the documentation.

After adding PostToolUse hooks with matchers for Edit and Write tools (running pnpm format:fix and npx tsc --noEmit), nothing happens after tool use — no spinner, no formatting, no type-check output.

What Should Happen?

After each Edit/Write tool use, the hook should run pnpm format:fix and tsc --noEmit, showing the statusMessage spinner ("Formatting & type-checking...").

Error Messages/Logs

No error messages — the hooks simply do not trigger. No spinner appears and no formatting or type-checking output is produced.

Steps to Reproduce

  1. Add PostToolUse hooks to .claude/settings.json:

``json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "pnpm format:fix 2>&1 | tail -5; npx tsc --noEmit --pretty 2>&1 | head -20",
"timeout": 30,
"statusMessage": "Formatting & type-checking..."
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "pnpm format:fix 2>&1 | tail -5; npx tsc --noEmit --pretty 2>&1 | head -20",
"timeout": 30,
"statusMessage": "Formatting & type-checking..."
}
]
}
]
}
}
``

  1. Use the Edit tool to add intentionally malformatted code (e.g., const x = 1 with extra spaces)
  2. Observe that no formatting or type-checking runs after the edit

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.569.0 (49894a) 2026-04-02T20:01:42.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • Client: Claude Code Desktop (macOS)
  • macOS: 26.3
  • Hook location: .claude/settings.json (project-level)
  • /hooks command output would help confirm if hooks are loaded (not yet checked)
  • The configuration format matches the official docs exactly
  • No disableAllHooks is set in any settings file

View original on GitHub ↗

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