Skip to main content

TryBrake for Claude Code

Let Claude Code work. Never let it run rm -rf.

TryBrake hooks into Claude Code and checks every shell command and file edit before it happens. Dangerous ones are blocked, sensitive ones wait for you, and everything is logged.

The same install works for Codex CLI, Cursor and Gemini CLI.

How it works

Set up in three steps.

  1. 1

    Copy the install text

    In TryBrake, create an agent for Claude Code. You get a short text to paste.

  2. 2

    Paste it into Claude Code

    Claude Code runs a one-time installer that adds TryBrake's hook to your project settings, keeping a backup of the old file.

  3. 3

    Code as usual

    Each command and edit is checked against your rules in a fraction of a second. You see everything in the dashboard.

my-app — claude — 120×32✻ Welcome to Claude Code!/help for help, /status for your current setupcwd: /Users/you/my-app> Clean up the repo and delete the old data folder⏺ I'll remove the old data folder.⏺ Bash(rm -rf ./data) ⎿ PreToolUse:Bash hook returned blocking error TryBrake blocked this action: deleting folders (rm -rf) is against your rulesProtected by TryBrake⏺ TryBrake blocked deleting ./data. Want me to move it to ./archive instead, so nothing is lost?> ▍? for shortcuts
In Claude Code: the risky command is stopped before it runs, and Claude is told why so it suggests something safer.

What it stops

The mistakes you can't undo.

  • Folder and disk wipes

    rm -rf and its variants are recognised however they're written, and blocked.

  • Database wipes

    DROP TABLE, DROP DATABASE and TRUNCATE are blocked.

  • Secrets

    Edits to .env files are blocked, so keys don't get overwritten or leaked.

  • Risky git

    Force pushes and history rewrites wait for your approval.

Questions

Good to know.

Does it slow Claude Code down?

Barely. Each check is a single quick request, and only commands and file edits are checked, not reading files.

What if TryBrake is unreachable?

The command is blocked and Claude Code is told why. Nothing risky runs without a check.

Can I remove it?

Yes. The installer keeps a backup of your settings file, and the hook is a few lines you can delete.

Works with more than Claude Code.

One TryBrake account protects every agent you run, wherever it's built.

See all integrations

Protect your Claude Code agents today.

Connect your first agent in five minutes. 14 days free, no credit card.