Claude Code hook
Hardstop
Don't let AI destroy your hard work! HardStop is a rock-solid protection for AI-generated commands. Pre-execution safety validation for Claude Code, Claude Cowork. Catches dangerous commands before they run: whether from AI mistakes, hallucinations, prompt injection, or misunderstood instructions. Seatbelts for the agentic AI era.
Install
/plugin marketplace add frmoretto/hardstopRun inside Claude Code, then /plugin to pick what to install from it.
npx hardstop installFound in the project README. Check it for setup steps after installing.
git clone https://github.com/frmoretto/hardstop.gitFrom the README
🛑 Hardstop 👉 ⭐ Star on GitHub if Hardstop keeps you safe! Pre-execution safety validation for AI coding agents. Validates every shell command against 428 security patterns before execution — blocking destructive operations, credential theft, infrastructure teardown, and prompt injection. Fail-closed: blocks by default when uncertain. Ecosystem: The detection patterns are published separately as hardstop-patterns (GitHub) — reusable in any Node.js tool. Installation • How It Works • Commands • Report Issue ⚡️ Why Hardstop? You trust your AI, but you shouldn't trust it with rm -rf / or reading your ~/.aws/credentials. Hardstop sits between the LLM and your system, enforcing a strict Fail-Closed policy on dangerous operations. - 🛡️ Pattern Matching: Instant regex-based detection for known threats (fork bombs, reverse shells) - 🧠 LLM Analysis: Semantic analysis for edge cases and obfuscated attacks - ⛓️ Chain Awareness: Scans every link in a command chain (&&, |, ;) - 🔐 Secrets Protection: Blocks reading of credential files (.ssh, .aws, .env) *(v1.3)* - 🍎 macOS Coverage: Keychain, diskutil, Time Machine, Gatekeeper, SIP, LaunchDaemons *(v1.3.6)* - 📚 LLM Guidance: Teaches Claude how to think about safety, not just blocks 🚀 Quick Demo Claude tries to ruin your day? Hardstop says no. ⚙️ How It Works Hardstop uses a two-layer verification system for Bash commands and pattern-based protection for file reads. The 428 detection patterns (Layer 1) are published as a standalone npm package: hardstop-patterns — usable in any Node.js tool, not just Hardstop. 🤝 Works Well With PatchPilot - Package vulnerability scanner that blocks risky npm/pip/brew installations. Use both for complete Claude Code security: Why both? PatchPilot secures your dependencies,…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- frmoretto/hardstop
- Type
- Hooks
- Language
- Python
- Last updated
- 18 April 2026
- Topics
- agentic-aiai-safetyclaudeclaude-aiclaude-codeclaude-code-hooksclaude-code-pluginclaude-code-plugin-marketplaceclaude-code-pluginsclaude-code-plugins-marketplaceclaude-coworkcowork
FAQ
What is Hardstop?
Don't let AI destroy your hard work! HardStop is a rock-solid protection for AI-generated commands. Pre-execution safety validation for Claude Code, Claude Cowork. Catches dangerous commands before they run: whether from AI mistakes, hallucinations, prompt injection, or misunderstood instructions. Seatbelts for the agentic AI era. It is a hook for Claude Code, from frmoretto/hardstop on GitHub.
How do I install Hardstop?
Run npx hardstop install, then follow the setup in the README.
Is Hardstop popular?
frmoretto/hardstop has 32 GitHub stars and 2 forks. It was last updated on 18 April 2026.
More hooks
squawk
17nov1n/squawk
Smart macOS notifications for Claude Code sessions.
Hatch3r
26hatch3r/hatch3r
Open-source CLI + editor plugin (Claude Code, Cursor, GitHub Copilot): one command installs 29 agents, 53 skills, 67 rules, 30 commands, 7 hooks & MCP integrations into any repo. Audited each release across 24 governance domains.
nomos
19safe-agentic-world/nomos
Deny-wins policy hook checking every shell, file and fetch call from Claude Code or Codex.
Claude Config Editor
26jung-wan-kim/claude-config-editor
Visual Config Editor for Claude Code - Drag & Drop Hook Pipeline, Agent Workflow, Skill/Rule Editor
Britfix
19Talieisin/britfix
Convert American spellings to British English - fix LLM output and documents
Go Claude Code Comment Checker
25code-yeongyu/go-claude-code-comment-checker
Multi-language comment detection hook for Claude Code. 100% vibe coded by Claude Opus 4.5.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.