← Back to library

Stack-specific guard hooks for coding agents

u/AdEast5873 open-sourced Agentic Workflow, a template where you run a bootstrap command, answer questions about your frameworks, and get tailored Claude Code commands, guard hooks and pre-push checks. The hooks block each framework's destructive commands, for example Prisma's db push or Django's flush, while pre-push checks catch localhost leaks, migration mismatches and environment variable drift.

  • OutcomeGenerate hooks that block the destructive commands of your framework, plus pre-push checks, after a few questions about your stack.
  • SetupUnder an hour
  • LevelIntermediate
  • Creditu/AdEast5873 on r/claude
View original
Works with
Claude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • A coding agent works in your repo
  • Your framework has commands that wipe data
  • You want checks before code leaves your machine

Not for: Repos with no database or deploy; Teams that already enforce this in CI only

What do you need, and what do you get?

You need

  • Your stack and framework list
  • Commands you never want run
  • Repo access

You get

  • Hook config that blocks risky commands
  • Pre-push checks
  • Review commands for changes

How does it work, step by step?

  1. Interview the stackList your framework, database tool and deploy setup.
  2. List the dangerous commandsName the commands that reset or wipe data in your stack.
  3. Block themAdd hooks that stop those commands and explain why to the agent.
  4. Check before pushAdd pre-push checks for localhost URLs, migrations and env variables.
  5. Test the guardsAsk the agent to run a blocked command in a test repo and confirm it is stopped.

The prompt

Our own prompt, inspired by u/AdEast5873 on r/claude and written to work in Claude Code. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt1 variable
My stack: {stack}. List the commands in this stack that can wipe, reset or overwrite data or deploy to production.
Write hook rules that block each one with a short message explaining what to do instead. Then write pre-push checks for localhost URLs, migration consistency and env variables, and tell me how to test each guard safely.

Inspired by u/AdEast5873 on r/claude: I built Agentic Workflow entirely with Claude Code — an open-source system that generates project-specific dev workflows from a single interview. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Hooks only help if the agent runs through them; check how your tool loads them.
  • Over-blocking slows real work; review rejections weekly.
  • Keep backups; a guard is not a restore plan.

Our take

Generic safety rules for coding agents tend to block obvious commands like deleting folders, while the operations that actually ruin a day are framework-specific: a schema push that drops data, an artisan wipe, a database flush. u/AdEast5873's project starts from that observation and asks about your stack before writing any guards. The idea works even without the template. Spend an hour listing the destructive commands for the tools you use, including database resets, cache purges and deploy scripts, and block them in your agent's hooks so they require a person. The pre-push checks address the dull failures that break deploys: a localhost address left in config, a migration out of step with the models, or a new environment variable missing from production. Then test the guards deliberately, by asking the agent to run a blocked command and confirming it stops, because a hook you have never seen fire might not be wired correctly. Revisit the list whenever you add a framework or a new deploy target.

Where the time goes back: One afternoon of guards prevents the one command that would cost a weekend of recovery.

FAQ

Do I need the template?
No. The idea works by hand: list your risky commands and block them in your agent's hook settings.
What else does it include?
The author describes review commands that spawn parallel reviewers and a session monitor.

Source and credit

Inspired by u/AdEast5873 on r/claude. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
I built Agentic Workflow entirely with Claude Code — an open-source system that generates project-specific dev workflows from a single interview
Creator
u/AdEast5873 on r/claude
Published on
Reddit
Original date
Mar 25, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in IT & Security

All 82 IT & Security playbooks →

Related playbooks

IT & SecurityWorkflow✓ AI dry run

Compare an agent run with a task you did by hand

Before you believe big productivity claims, time and cost one routine agent task against a similar one you did yourself, counting review and cleanup.

Credit: Chris_Newton on Hacker News

Under an hour
IT & SecuritySkill✓ AI dry run

Find repeat fixes and good habits in your team's PRs

Have Claude Code look across a chosen window of commits and pull request review comments for the same fix or review note coming up again and again, suggest turning the top ones into a project rule or skill you write in your own words, and list good practices already in the repo that other teams could copy.

Credit: anthropics

Under an hour
IT & SecurityPrompt✓ AI dry run

Make the coding agent log real numbers before guessing

When a coding agent cannot see the result, such as a window it draws, have it log actual sizes and values or save frames as images instead of guessing.

Credit: u/no-shadowban-lmao on r/ClaudeAI

Minutes