Hook

Pre-Bash SQL Safety

Block destructive SQL without a paired SELECT verification.

安裝

manual
add to ~/.claude/settings.json hooks.PreToolUse

把這段加入 Claude Code MCP 設定,或直接透過 CLI 執行。

介紹

PreToolUse hook on Bash. Detects DELETE/UPDATE/DROP/TRUNCATE without an inline SELECT to confirm impact. Returns block decision.

常見使用情境

  • Prevent accidental table drops
  • Force impact verification
  • Enforce SQL hygiene

標籤

securitysqlsafety