Fence blocks fatal calls.
Fence blocks the catastrophic command before your agent runs it, and stays silent for everything else. It parses what a command actually does, so there is no denylist to evade. Open source, runs locally.
$ brew install hoophq/tap/fence
# prebuilt, no compile step. macOS and Linux
# then hook it into Claude Code:
$ fence init --global
Same intent, same verdict.
Fence parses every tool call into semantic facts. Reorder the flags or hide the path behind a variable and the intent stays the same, so the verdict does too.
- Deny
rm -rf ~Recursive delete of $HOME. Blocked before it runs. - Deny
rm -fr ~The same intent with the flags swapped. Blocked. - Deny
sudo rm -rf $HOMEThe same intent behind sudo and a variable. Blocked. - Ask
git push --forceThe built-in git-force-push rule asks you first. - Deny
terraform destroyYour own no-terraform-destroy rule from .fence.yaml. - Allow
npm testEveryday work. Fence stays silent.
Three steps, all local.
The recommended rule pack ships in the binary and is always on. Your own rules layer on top.
Hook into your agent
One command adds the hook to Claude Code.
fence init --globalJudge the intent
Fence parses each tool call into what it does, not how it is spelled.
intent: recursive delete of $HOMEBlock, ask or allow
Unambiguous catastrophe is blocked, the plausibly legit gets a confirm prompt, and everyday work passes in silence.
Your rules, in one file.
Fence finds .fence.yaml on its own. Add a rule in a few lines, or retune a built-in one in one.
# Layer your own rules on the built-in pack (auto-discovered)
rules:
- id: no-terraform-destroy
effect: deny
match:
shell: { command_in: [terraform] }
regex: '\bterraform\b.*\bdestroy\b'
# Retune a built-in rule in one line
overrides:
git-force-push: deny # ask -> deny
pipe-to-shell-from-network: allow # silence it
Holds in auto-accept
The hook runs before the permission system, so a deny blocks even in auto-accept or skip-permissions sessions.
Fails open
If Fence cannot parse a command, the command runs. A guardrail must never brick the agent it protects.
Agent-neutral
One portable rule pack. Claude Code today; Codex, Cursor and Gemini next.
More from hoop Labs.
Each tool solves one problem, runs locally and needs no signup to try.
- PII InvadersBrowser game
- MCP ProxyGo binary + library
- Implementation Savings CalculatorWeb tool
- WardenWeb tool + CLI
- BlueprintCLI
- Hoop Plugin for ClaudePlugin
- Alcatraz ActionGitHub Action
- FenceClaude Code hook
- Credential CloakLocal proxy
- JuliusCLI + proxy
- AlcatrazGo library
- AI Risk SummaryCLI
- AI ROI CalculatorWeb tool
Guardrails no one can turn off.
Fence is local self-protection: it lives in your config and you can edit or remove it. hoop.dev enforces the same idea fleet-wide, with centrally managed rules, approval workflows and audit the developer cannot override.
Ask an assistant what hoop.dev does: Claude, ChatGPT, Grok, Gemini, Perplexity, Copilot.
$ brew install hoophq/tap/fence
$ fence init --global