Claude Code hook
claude-warden
Command safety filter hook that parses shell pipelines and judges each sub-command separately.
Install
/plugin marketplace add banyudu/claude-wardengit clone https://github.com/banyudu/claude-warden.gitFrom the README
Claude Warden Smart command safety filter for Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, and other AI coding agents. Parses shell commands, evaluates each against configurable safety rules, and returns allow/deny/ask decisions — eliminating unnecessary permission prompts while blocking dangerous commands. The problem Claude Code's permission system is all-or-nothing. In the default mode, you're prompted for every shell command — even ls, cat, and grep. This creates a painful UX where you're clicking "Allow" hundreds of times per session on obviously safe commands. The alternative (yolo mode) disables all prompts, which is dangerous. There's no middle ground: you can't say "allow git but block git push --force", or "allow ssh to my dev server but prompt for production". And compound commands like npm run build && npm test trigger a single opaque prompt with no visibility into what's actually being run. How Warden solves it Warden hooks into Claude Code's PreToolUse event and parses every shell command into an AST using bash-parser. This means it doesn't just see npm run build && git push --force as a single string — it walks the AST to extract each individual command, then evaluates them independently against a configurable rule engine. This AST-based approach enables: - Pipe and chain decomposition: cat file | grep pattern | wc -l is parsed into three commands, each evaluated separately. All safe → auto-allow. One dangerous → deny the whole pipeline. - Argument-aware rules: git status → allow, git push --force → prompt. rm temp.txt → allow, rm -rf / → prompt. The evaluator matches against argument patterns, not just command names. - Recursive evaluation of remote commands: ssh devserver 'cat /etc/hosts' → Warden extracts the remote command, parses it…
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
- banyudu/claude-warden
- Type
- Hooks
- Website
- banyudu.com/claude-warden
- Language
- TypeScript
- License
- MIT
- Last updated
- 30 June 2026
FAQ
What is claude-warden?
Command safety filter hook that parses shell pipelines and judges each sub-command separately. It is a hook for Claude Code, from banyudu/claude-warden on GitHub.
How do I install claude-warden?
Run /plugin marketplace add banyudu/claude-warden inside Claude Code, then follow the setup in the README.
Is claude-warden popular?
banyudu/claude-warden has 32 GitHub stars and 3 forks. It was last updated on 30 June 2026.
More hooks
Claude Sdlc Harness
53BaseInfinity/claude-sdlc-harness
Self-evolving SDLC enforcement for AI coding agents — hooks, skills, and one-command setup for Claude Code. Plan before coding, test before shipping, escalate when uncertain. Measures itself getting better over time.
Claude Warden
60johnzfitch/claude-warden
Security hooks and monitoring for Claude Code — quiet overrides, SSRF protection, MCP compression, OTEL tracing
claude-code-guardrails
41tillmeier/claude-code-guardrails
Guardrail hooks derived from real incidents plus a plan-implement-verify delivery loop.
Evolving Lite
50primeline-ai/evolving-lite
A self-evolving Claude Code plugin. Context routing, memory bootup, smart delegation, self-correction — out of the box.
Prowler Studio
54prowler-cloud/prowler-studio
Prowler Studio an AI workflow that ensures Claude Code follows Prowler's guardrails to deliver consistent, tested, and PR-ready threat detection checks, remediations and update compliance frameworks.
CC Hooks Ts
39sushichan044/cc-hooks-ts
Define Claude Code hooks with full type safety.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.