{
  "$schema": "https://thegrid.dev/schemas/hooks.json",
  "version": "1.0",
  "description": "The Grid hooks configuration for Claude Code",
  "hooks": {
    "SessionStart": [
      {
        "type": "command",
        "command": "bash commands/grid/hooks/session-start.sh",
        "description": "Load Grid state and provide mission context",
        "timeout": 5000
      }
    ],
    "SubagentStart": [
      {
        "type": "command",
        "command": "python3 commands/grid/hooks/budget-check.py",
        "description": "Enforce budget limits before spawning programs",
        "timeout": 3000
      }
    ],
    "PostToolUse": [
      {
        "type": "command",
        "command": "python3 commands/grid/hooks/track-progress.py",
        "description": "Log tool operations to scratchpad",
        "timeout": 2000
      },
      {
        "type": "command",
        "command": "bash commands/grid/hooks/verify-edit.sh",
        "description": "Verify file edits exist and have content",
        "timeout": 3000,
        "filter": {
          "tools": ["Edit", "Write"]
        }
      }
    ],
    "SubagentStop": [
      {
        "type": "command",
        "command": "python3 commands/grid/hooks/subagent-complete.py",
        "description": "Track subagent completion and update budget",
        "timeout": 3000
      }
    ],
    "SessionEnd": [
      {
        "type": "command",
        "command": "bash commands/grid/hooks/session-end.sh",
        "description": "Save final state and archive session",
        "timeout": 5000
      }
    ],
    "Stop": [
      {
        "type": "command",
        "command": "bash commands/grid/hooks/session-end.sh",
        "description": "Ensure state is saved on mission completion",
        "timeout": 5000
      }
    ]
  },
  "options": {
    "fail_on_error": false,
    "log_output": true
  }
}
