Claude Code hook
agentjail
Policy guardrails that check every Claude Code, Codex or Cursor tool call against local rules.
Install
brew install LuD1161/tap/agentjailgit clone https://github.com/LuD1161/agentjail.gitFrom the README
Policy checks and OS sandboxing for coding agents A safety rail for Claude Code, Codex, and Cursor. Install policy hooks, then launch your agent through AgentJail for OS-level filesystem protection. Install minisign through your trusted package manager first (brew install minisign on macOS; sudo apt-get install minisign on Debian/Ubuntu). The installer verifies the signed release manifest before extracting or running the download. or Follow the installer's shell activation instruction, restart any running agent, then start your first protected session: Installation registers hooks; agentjail run adds the OS sandbox. Hooks alone are cooperative checks, not a filesystem isolation boundary. For automatic sandboxing of ordinary agent commands, opt into the PATH shim. Use --tunnel when you also want network visibility; the launch banner reports the active protection level. A coding agent gets blocked before it fires. ▶ Watch the 36-second demo with sound · source in video/. Recent updates See CHANGELOG.md for full details, or check the releases page. How it works Supported agent tool calls are checked against policy before execution while the daemon is available: Hooks provide policy decisions and explanations. Launching through agentjail run adds the OS sandbox, which enforces filesystem restrictions independently of the hook daemon. - 🪝 Zero-config - one install command auto-detects your agents and wires the hook - ⚡ ~8 ms median - persistent OPA daemon + decision cache. You won't feel it - 🛡️ Defense in depth - hook-level policy + optional kernel sandbox (agentjail-shield) - 📜 Real policy engine - OPA Rego rules, not regex hacks - 🔒 Explicit failure posture — credential and approval authorization fail closed.…
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
- LuD1161/agentjail
- Type
- Hooks
- Website
- agentjail.io
- Language
- Go
- License
- Apache-2.0
- Last updated
- 24 September 2026
- Topics
- agent-securityai-agentsclaude-codecodexcursordevsecopsgolangguardrailsllmopapolicy-as-coderego
FAQ
What is agentjail?
Policy guardrails that check every Claude Code, Codex or Cursor tool call against local rules. It is a hook for Claude Code, from LuD1161/agentjail on GitHub.
How do I install agentjail?
Run brew install LuD1161/tap/agentjail, then follow the setup in the README.
Is agentjail popular?
LuD1161/agentjail has 100 GitHub stars and 8 forks. It was last updated on 24 September 2026.
More hooks
Flonat Research
149flonat/flonat-research
Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows
Claude Adhd Skills
171ravila4/claude-adhd-skills
Claude Code skills and hooks for staying organized with AI agents.
Clawd Conduit
174ssssssanjiu/clawd-conduit
Full-lifecycle wiring between Claude Code and the Clawd on Desk pet — all 15 hook events, with permission prompts answered straight from the desktop
Claude Memory Engine
134HelloRuru/claude-memory-engine
Claude Code 的記憶系統 | A memory system built with hooks + markdown. Zero dependencies.
Interlinked CLI
183QuentinCody/interlinked-cli
The harness for your harness. Local hooks, taste enforcement, and developer observability for AI coding agents (Claude Code, Codex, Cursor, Copilot CLI).
Agent Usage Guard
93rbartoli/agent-usage-guard
Hook mod that pauses subagent fan-out, heavy prompts and retry loops before they burn quota.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.