More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Claude Code Safety Guard: Block Destructive Commands

    1

    Turn rm -rf, git reset --hard and force pushes into a checked step: blocks destructive shell commands only when they would really lose work.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    About this skill

    "The agent ran git reset --hard and I lost a day." Command Guard checks your repo before every shell command and blocks only what would destroy real work.

    Measured: on a 61-command holdout set written after tuning, it scored precision 0.969 and recall 0.969. A typical regex guard scored 0.595 and 0.688 on the same set, with 15 false blocks out of 29 safe commands.

    What it does

    • A Claude Code PreToolUse hook for Bash and PowerShell. It runs scripts/guard.py, a standard-library Python tool that parses the command the way the shell will: &&, pipes, subshells, heredocs, bash -c, eval, powershell -Command, -EncodedCommand, cmd /c, sudo, xargs, find -exec, and script files it can read.
    • Before it decides, it reads the real state with git status, git clean -n, kubeconfig, .terraform/environment and .env.
    • Blocks, and lists what would be lost:
      • reset --hard, checkout -- ., restore and clean -fd, but only when uncommitted files exist.
      • push --force (it suggests --force-with-lease).
      • branch -D of unpushed work.
      • rm -rf, Remove-Item -Recurse, rd /s and del /s on home, /, system folders, .git, bare globs or paths outside the project.
      • DROP or TRUNCATE on a non-local database.
      • terraform destroy and kubectl delete on prod.
    • Asks you when the risk can't be checked from your machine, such as cloud deletes, non-prod destroys or unresolved variables.
    • Allows what is safe: rm -rf build, or a reset in a clean tree.

    Benchmarks

    Test setCommand GuardRegex guard
    Holdout, 61 commands, run once1 false block, 1 miss15 false blocks, 10 misses
    Tuned corpus, 306 commands0 false blocks, 0 misses (first run: 5 and 1)51 false blocks, 66 misses
    psf/requests and django/django, 20 commands, clean treeblocks 3 of 20blocks 15 of 20
    Same repos, after seeded uncommitted workblocks 13 of 20the same 15 of 20

    Across 32,587 tldr-pages example commands, 47 were blocked and 114 sent to you. The median decision took 0.9 ms.

    What it does NOT do

    • It can't see commands built at run time, such as bash -c "$(printf ...)" or curl | sh.
    • It doesn't simulate state changes inside one chain.
    • It doesn't inspect remote hosts.
    • It recognises production by name only (configurable).
    • It doesn't guard file-edit or MCP tools.

    Works in Claude Code, Cursor, Codex CLI, Copilot and any SKILL.md agent. The hook is Claude Code only; other agents run the check command.

    Privacy: everything runs locally, with no network calls and no telemetry.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 27 days ago

    Requires

    rimraf
    Node.js
    prisma
    sequelize-cli
    cdk
    Git

    Permissions

    Terminal / Shell
    Read Files
    Network Access
    Environment Variables
    Listed27 days ago

    What's inside

    Frequently Asked Questions

    Turn rm -rf, git reset --hard and force pushes into a checked step: blocks destructive shell commands only when they would really lose work.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Claude Code Safety Guard: Block Destructive Commands on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in DevOps & Cloud