{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",

  "env": {
    "CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-4-5"
  },

  "spinnerVerbs": {
    "mode": "replace",
    "verbs": ["Pensando", "Procesando", "Analizando", "Trabajando", "Editando", "Escribiendo", "Leyendo", "Ejecutando", "Delegando"]
  },

  "permissions": {
    "allow": [
      "Read",
      "Edit",
      "Write",
      "Glob",
      "Grep",
      "Bash(git:*)",
      "Bash(npm run:*)",
      "Bash(npm test:*)",
      "Bash(pnpm:*)",
      "Bash(yarn:*)",
      "Bash(composer:*)",
      "Bash(php bin/console:*)",
      "Bash(php artisan:*)",
      "Bash(dotnet:*)",
      "Bash(make:*)",
      "Bash(docker compose:*)",
      "Bash(flutter:*)",
      "Bash(ng:*)"
    ],
    "deny": [
      "Bash(rm -rf:*)",
      "Bash(sudo:*)",
      "Bash(chmod 777:*)",
      "Bash(curl | sh:*)",
      "Bash(wget | sh:*)",
      "Read(**/.env)",
      "Read(**/.env.*)",
      "Read(**/secrets/*)",
      "Read(**/*.key)",
      "Read(**/*.pem)",
      "Read(**/*credentials*)"
    ]
  },

  "model": "claude-opus-4-6",

  "plansDirectory": ".claude/plans",

  "hooks": {
    "PreCompact": [
      {
        "matcher": "auto",
        "hooks": [
          {
            "type": "command",
            "command": "if [ -f .claude/context-essentials.md ]; then echo 'Context preserved for restoration after compaction'; else echo 'No context-essentials.md found'; fi",
            "timeout": 5000
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "matcher": "compact",
        "hooks": [
          {
            "type": "command",
            "command": "if [ -f .claude/context-essentials.md ]; then cat .claude/context-essentials.md; else echo 'No context-essentials.md found.'; fi"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "FILEPATH=$(echo '$TOOL_INPUT' | jq -r '.file_path // empty'); if echo \"$FILEPATH\" | grep -qE '(\\.env|\\.env\\.|credentials|secrets|private.*key|id_rsa)'; then echo \"BLOCKED: Cannot edit sensitive file: $FILEPATH\" && exit 1; fi; exit 0"
          }
        ]
      },
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "FILEPATH=$(echo '$TOOL_INPUT' | jq -r '.file_path // empty'); if echo \"$FILEPATH\" | grep -qE '(\\.env|\\.env\\.|credentials|secrets|private.*key|id_rsa)'; then echo \"BLOCKED: Cannot write sensitive file: $FILEPATH\" && exit 1; fi; exit 0"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "OUTPUT_SIZE=$(echo '$TOOL_OUTPUT' | wc -c); if [ \"$OUTPUT_SIZE\" -gt 50000 ]; then echo 'NOTICE: Large output (>50KB). Extract only the relevant information and summarize in under 20 lines.'; elif [ \"$OUTPUT_SIZE\" -gt 10000 ]; then echo 'NOTICE: Moderate output (>10KB). Focus on errors, warnings, and key results.'; fi; exit 0",
            "timeout": 3000
          }
        ]
      },
      {
        "matcher": "Grep",
        "hooks": [
          {
            "type": "command",
            "command": "OUTPUT_SIZE=$(echo '$TOOL_OUTPUT' | wc -c); if [ \"$OUTPUT_SIZE\" -gt 50000 ]; then echo 'NOTICE: Large output (>50KB). Summarize key findings in under 20 lines.'; fi; exit 0",
            "timeout": 3000
          }
        ]
      }
    ],
    "PostCompact": [
      {
        "matcher": "auto",
        "hooks": [
          {
            "type": "command",
            "command": "if [ -f .claude/context-essentials.md ]; then jq -n --rawfile c .claude/context-essentials.md '{\"systemMessage\": (\"CONTEXT RESTORED AFTER COMPACTION:\\n\" + $c)}'; else echo '{}'; fi",
            "timeout": 5000
          }
        ]
      }
    ]
  }
}
