Claude Code hooks guard rails
Fail-closed PreToolUse, post-edit and Stop hooks that block force-pushes, .env reads and wild deletes, check each edit and run tests before done.
- 2 2 Rules
- 1 1 Skills
- – 0 MCP
These loadouts ship small, tested scripts that enforce rules outside the model: PreToolUse hooks that deny dangerous commands with a reason, a loop runner that stops on no progress or a false DONE, a Terraform guard that blocks apply and destroy, an OpenTofu module gate that runs tests and Checkov, and a spend guard that refuses the next agent run once the day's cap is used. The verifier runs every one.
Every one installs for Claude Code, Codex CLI, Cursor, Gemini CLI, Antigravity CLI and GitHub Copilot unless its card says otherwise.
Fail-closed PreToolUse, post-edit and Stop hooks that block force-pushes, .env reads and wild deletes, check each edit and run tests before done.
Run an agent in a Ralph-style loop with guard rails: a fresh process per pass, state in files, iteration and no-progress limits, and a check it cannot fake.
Run headless Claude Code, Codex and Antigravity CLI through one guard: a shared daily cap, per-run budgets, a ledger, and the provider limits that stop spend.
Agents write OpenTofu modules that pass a local gate: fmt, a read-only lock file, tofu test with a mocked AWS provider, and Checkov with reasoned skips only.
Let agents write Terraform and produce plans but never apply: a guard hook for apply, destroy and state changes, a plan summary that flags deletes, pinned providers.
Looking for something narrower? Search within Bash or filter everything.