claudegoodies
Hook

claude-code-best-practice hooks

From shanraisshan

Hooks on PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, PostToolBatch, UserPromptSubmit, UserPromptExpansion, Notification, MessageDisplay, Stop, SubagentStart, SubagentStop, PreCompact, PostCompact, SessionStart, SessionEnd, Setup, TeammateIdle, TaskCreated, TaskCompleted, ConfigChange, WorktreeCreate, WorktreeRemove, InstructionsLoaded, Elicitation, ElicitationResult, StopFailure, CwdChanged, FileChanged, PermissionDenied

Facts

Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this hook runs.

{
  "PreToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
          "timeout": 5000,
          "async": true,
          "statusMessage": "PreToolUse"
        }
      ]
    }
  ],
  "PermissionRequest": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
          "timeout": 5000,
          "async": true,
          "statusMessage": "PermissionRequest"
        }
      ]
    }
  ],
  "PostToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
          "timeout": 5000,
          "async": true,
          "statusMessage": "PostToolUse"
        }
      ]
    }
  ],
  "PostToolUseFailure": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
          "timeout": 5000,
          "async": true,
          "statusMessage": "PostToolUseFailure"
        }
      ]
    }
  ],
  "PostToolBatch": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
          "timeout": 5000,
          "async": true,
  
View full source on GitHub →

Other hooks