{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "^(Write|Edit|MultiEdit)$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_INPUT_file_path\" ] && npx @claude-flow/cli@latest hooks pre-edit --file \"$TOOL_INPUT_file_path\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      },
      {
        "matcher": "^Bash$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_INPUT_command\" ] && npx @claude-flow/cli@latest hooks pre-command --command \"$TOOL_INPUT_command\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      },
      {
        "matcher": "^Task$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_INPUT_prompt\" ] && npx @claude-flow/cli@latest hooks pre-task --task-id \"task-$(date +%s)\" --description \"$TOOL_INPUT_prompt\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "^(Write|Edit|MultiEdit)$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_INPUT_file_path\" ] && npx @claude-flow/cli@latest hooks post-edit --file \"$TOOL_INPUT_file_path\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      },
      {
        "matcher": "^Bash$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_INPUT_command\" ] && npx @claude-flow/cli@latest hooks post-command --command \"$TOOL_INPUT_command\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      },
      {
        "matcher": "^Task$",
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$TOOL_RESULT_agent_id\" ] && npx @claude-flow/cli@latest hooks post-task --task-id \"$TOOL_RESULT_agent_id\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$PROMPT\" ] && npx @claude-flow/cli@latest hooks route --task \"$PROMPT\" || true",
            "timeout": 5000,
            "continueOnError": true
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npx @claude-flow/cli@latest daemon start --quiet 2>/dev/null || true",
            "timeout": 5000,
            "continueOnError": true
          },
          {
            "type": "command",
            "command": "[ -n \"$SESSION_ID\" ] && npx @claude-flow/cli@latest hooks session-restore --session-id \"$SESSION_ID\" 2>/dev/null || true",
            "timeout": 10000,
            "continueOnError": true
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo '{\"ok\": true}'",
            "timeout": 1000
          }
        ]
      }
    ],
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "[ -n \"$NOTIFICATION_MESSAGE\" ] && npx @claude-flow/cli@latest memory store --namespace notifications --key \"notify-$(date +%s)\" --value \"$NOTIFICATION_MESSAGE\" 2>/dev/null || true",
            "timeout": 3000,
            "continueOnError": true
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "matcher": "^mcp__claude-flow__.*$",
        "hooks": [
          {
            "type": "command",
            "command": "echo '{\"decision\": \"allow\", \"reason\": \"claude-flow MCP tool auto-approved\"}'",
            "timeout": 1000
          }
        ]
      },
      {
        "matcher": "^Bash\\(npx @?claude-flow.*\\)$",
        "hooks": [
          {
            "type": "command",
            "command": "echo '{\"decision\": \"allow\", \"reason\": \"claude-flow CLI auto-approved\"}'",
            "timeout": 1000
          }
        ]
      }
    ]
  },
  "statusLine": {
    "type": "command",
    "command": "npx @claude-flow/cli@latest hooks statusline 2>/dev/null || node .claude/helpers/statusline.cjs 2>/dev/null || echo \"▊ Claude Flow V3\"",
    "refreshMs": 5000,
    "enabled": true
  },
  "permissions": {
    "allow": [
      "Bash(npx claude-flow*)",
      "Bash(npx @claude-flow/*)",
      "mcp__claude-flow__*"
    ],
    "deny": []
  },
  "claudeFlow": {
    "version": "3.0.0",
    "enabled": true,
    "modelPreferences": {
      "default": "claude-opus-4-5-20251101",
      "routing": "claude-3-5-haiku-20241022"
    },
    "swarm": {
      "topology": "hierarchical-mesh",
      "maxAgents": 15
    },
    "memory": {
      "backend": "hybrid",
      "enableHNSW": true
    },
    "neural": {
      "enabled": true
    },
    "daemon": {
      "autoStart": true,
      "workers": [
        "map",
        "audit",
        "optimize",
        "consolidate",
        "testgaps",
        "ultralearn",
        "deepdive",
        "document",
        "refactor",
        "benchmark"
      ],
      "schedules": {
        "audit": {
          "interval": "1h",
          "priority": "critical"
        },
        "optimize": {
          "interval": "30m",
          "priority": "high"
        },
        "consolidate": {
          "interval": "2h",
          "priority": "low"
        },
        "document": {
          "interval": "1h",
          "priority": "normal",
          "triggers": [
            "adr-update",
            "api-change"
          ]
        },
        "deepdive": {
          "interval": "4h",
          "priority": "normal",
          "triggers": [
            "complex-change"
          ]
        },
        "ultralearn": {
          "interval": "1h",
          "priority": "normal"
        }
      }
    },
    "learning": {
      "enabled": true,
      "autoTrain": true,
      "patterns": [
        "coordination",
        "optimization",
        "prediction"
      ],
      "retention": {
        "shortTerm": "24h",
        "longTerm": "30d"
      }
    },
    "adr": {
      "autoGenerate": true,
      "directory": "/docs/adr",
      "template": "madr"
    },
    "ddd": {
      "trackDomains": true,
      "validateBoundedContexts": true,
      "directory": "/docs/ddd"
    },
    "security": {
      "autoScan": true,
      "scanOnEdit": true,
      "cveCheck": true,
      "threatModel": true
    }
  }
}