PostToolUse hooks not firing on macOS
Resolved 💬 3 comments Opened Dec 28, 2025 by halcasteel Closed Jan 1, 2026
Description
PostToolUse hooks configured in ~/.claude/settings.json are not executing when Write or Edit tools complete successfully.
Environment
- OS: macOS Darwin 25.2.0
- Claude Code version: Latest (claude-code CLI)
- Shell: zsh
Configuration
~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "/absolute/path/to/script.sh",
"timeout": 30
}
]
}
]
}
}
Steps to Reproduce
- Add PostToolUse hook configuration to
~/.claude/settings.json - Restart Claude Code
- Create or edit a file using Write or Edit tools
- Check if hook executed (e.g., log file creation)
Expected Behavior
Hook script should execute after Write/Edit tool completes, receiving JSON input via stdin with tool_name, tool_input, and tool_response.
Actual Behavior
Hook never executes. Diagnostic test using:
"command": "echo 'PostToolUse fired' >> /tmp/claude-hooks.log"
Results in no log file being created.
Verification
- Script is executable (
chmod +x) - Script has proper shebang (
#!/bin/bash) - Script executes correctly when run manually
- JSON configuration is valid
- Multiple restarts attempted
Related Issues
- #6305 - Post/PreToolUse Hooks Not Executing in Claude Code
- #3179 - Similar reports
Impact
Cannot implement automatic document classification on file creation/modification, which would significantly improve documentation workflow automation.
---
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗