Hooks not executing despite following documentation

Resolved 💬 11 comments Opened Jul 2, 2025 by grahama1970 Closed Jan 15, 2026

Hook Functionality Verification Report

Environment

  • Claude Code Version: 0.10.14 (from ps output)
  • OS: Ubuntu 24.04.2 LTS
  • Date: 2025-07-02

Test Methodology

1. Hook Setup

Created executable hook scripts in ~/.claude/hooks/:

  • pre-tool (chmod +x)
  • post-tool (chmod +x)
  • pre-edit (chmod +x)

Each hook logs to /tmp/claude_hooks_*.log when executed.

2. Configuration

Added hook configuration to ~/.claude/settings.json:

{
    "hooks": {
        "PreToolUse": [
            {
                "matcher": "",
                "hooks": [
                    {
                        "type": "command",
                        "command": "~/.claude/hooks/pre-tool"
                    }
                ]
            }
        ],
        "PostToolUse": [
            {
                "matcher": "",
                "hooks": [
                    {
                        "type": "command",
                        "command": "~/.claude/hooks/post-tool"
                    }
                ]
            }
        ]
    }
}

3. Tests Performed

  1. Multiple Bash commands executed
  2. File creation using Write tool
  3. File editing using Edit tool
  4. Checked for log files after each operation

4. Results

  • No log files created in /tmp/claude_hooks_*.log
  • Manual execution of hooks works correctly
  • Hooks do not appear to execute automatically during tool use

Observations

  • Claude Code process running with flags: --dangerously-skip-permissions --mcp-config "/home/graham/.claude/claude_code/.mcp.json" --continue
  • No hook-related processes detected during tool execution
  • Settings file is valid JSON and readable

Questions

  1. Are there additional configuration steps required to enable hooks?
  2. Is there a specific flag needed when launching Claude Code?
  3. Are hooks only available in certain versions or editions?

Reproduction Steps

  1. Create hook script: echo '#!/bin/bash\necho "Hook executed" > /tmp/hook_test.log' > ~/.claude/hooks/pre-tool && chmod +x ~/.claude/hooks/pre-tool
  2. Configure in ~/.claude/settings.json as shown above
  3. Execute any Bash command through Claude Code
  4. Check for /tmp/hook_test.log - file is not created

Would appreciate clarification on whether hooks are currently functional and if there are additional setup requirements.

View original on GitHub ↗

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