Every premium and members-only resource for $9.99/month, as a no-commitment subscription. See the plans

PalateKit

Menu

Request a resource

Describe the resource you are missing in one sentence. We will email you when it is published.

0 / 280

Unlock PalateKit

Unlock everything

Plan

Paying means accepting our terms of sale.

Secure payment by Stripe. Receipts and invoices sent by email.

Welcome back

Sign in to install, download or save this resource. A free account is enough for free resources.

PalateKit Pick

Destructive command guard v1.0.0

Use this resource to stop your agent from destroying work or data

New

  • 229 downloads
  • 92 likes
  • 209 saves

$4.99

Lifetime access to this resource, with its updates.

Install with the CLI

In a terminal, from the folder you want:

npx --yes palatekit@latest install destructive-command-guard

First time: connect the CLI with

npx --yes palatekit@latest login

Before every Bash command, the hook checks it against a list of dangerous patterns. On a match it blocks the command and sends the reason back to the agent, which must explain it and wait for your approval. git push --force-with-lease stays allowed.

Mostly picked by

Updated November 2, 2026

Destructive command guard hook card

Details

Works in
Install guides
Generates with
Your agent's model
Uses
  • Node.js 18+

Similar resources

View all

What you get

  • The Node.js hook
  • A settings.json snippet ready to merge
  • A guide with a test command

Good fit for

  • Agents running autonomously
  • Shared repos or reachable production databases
  • Claude Code beginners

Not for

  • Agents other than Claude Code
  • Replacing backups
  • Blocking a human's commands

Tags

  • hook
  • safety
  • claude code
  • git

About

You say

The agent tries "git reset --hard": the command is blocked and it asks for your approval.

Destructive command guard hook card

Hook written and tested by PalateKit.

Show more

Prerequisites

You bring
Node.js 18 or later
Dependencies
Node.js 18+
Last tested
v1.0.0 with Claude Code

How to use it

  1. Copy .claude/hooks/ into your project.
  2. Merge .claude/settings.json into yours.
  3. Restart Claude Code and run the test command.

Content preview

Files

  • .claude/hooks/guard-commands.mjs1.7 KB
  • .claude/settings.json0.2 KB
  • README.md1 KB

User reviews

–

No ratings yet

Loading reviews…

Delete your review?

Your rating and comment will be removed from the page.

Frequently asked questions

Can I add my own patterns?

Yes: they live in the RULES array at the top of the file.

Does it slow the agent down?

No: the check takes a few milliseconds.