{
  "description": "Colgrep hooks - inject context and redirect search tools to colgrep",
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume",
        "hooks": [
          {
            "type": "command",
            "command": "colgrep --session-hook",
            "timeout": 10
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Grep|Glob",
        "hooks": [
          {
            "type": "command",
            "command": "echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"Reminder: colgrep is available for semantic code search. Consider using colgrep for better results.\"}}'",
            "timeout": 5
          }
        ]
      },
      {
        "matcher": "Task",
        "hooks": [
          {
            "type": "command",
            "command": "cat <<'EOF'\n{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"IMPORTANT: Include colgrep instructions in your agent prompt. Add this to your prompt: Use colgrep (via Bash) for ALL code searches instead of Grep/Glob tools. Examples: colgrep query ./src, colgrep -e pattern, colgrep -l --include=*.rs query . Do NOT use Grep or Glob tools.\"}}\nEOF",
            "timeout": 5
          }
        ]
      }
    ]
  }
}
