Claude Code hook

Claude Warden

Security hooks and monitoring for Claude Code — quiet overrides, SSRF protection, MCP compression, OTEL tracing

60 stars 2 forksHooks Source

Install

From source
git clone https://github.com/johnzfitch/claude-warden.git

From the README

claude-warden

[![version][badge-version]][releases] [![license][badge-license]][license-file] [![platform][badge-platform]][repo]

claude-warden(token guardian) is a hook system for [Claude Code][claude-code] that intercepts every tool call before and after execution. It silences verbose commands, compresses large outputs, blocks unsafe network calls, enforces subagent budgets, and surfaces a live statusline — saving tens of thousands of tokens per session with negligible added latency.

Quickstart

1. Install prerequisites: jq (required). Optional: rg, fd.
2. Install hooks into ~/.claude/ (symlink mode):

3. Choose a profile when prompted (or pass --profile standard).
4. Start a new Claude Code session. Hooks run automatically.

Run ./install.sh --dry-run first to preview every change before anything touches ~/.claude/.

What it does

claude-warden installs shell hooks that intercept every Claude Code tool call. Each hook enforces token-efficient patterns and blocks unsafe operations.

Guard catalog

Architecture

  Token savings pipeline — tool calls enter the hook membrane, get silenced/compressed/blocked, and exit with fewer tokens.

  Claude Code tool calls pass through the hook membrane (bash enforcement) into the warden-collector Go backbone, which stores spans in WAL-mode SQLite and enforces subagent budgets via sub-millisecond stat() checks.

Requirements

Install

Quick install (latest release)

Downloads a release tarball, verifies its SHA-256 checksum, validates contents, then runs install.sh --copy.

To pin a version:

Install from source (development)

Profiles

The installer applies a configuration profile that sets token limits, tool permissions, and internal thresholds. Choose one during install or pass --profile:

Profiles live in…
Read the full README on GitHub

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.
Claude Code docs

Details

Type
Hooks
Language
Shell
License
MIT
Last updated
8 April 2026
Topics
alignmentanthropicclaude-aiclaude-codehooksinterpretabilitymonitoringpermissionssafetysecurityssrf-protectiontoken-optimization

FAQ

What is Claude Warden?

Security hooks and monitoring for Claude Code — quiet overrides, SSRF protection, MCP compression, OTEL tracing It is a hook for Claude Code, from johnzfitch/claude-warden on GitHub.

How do I install Claude Warden?

Clone johnzfitch/claude-warden from GitHub and follow the setup steps in its README.

Is Claude Warden popular?

johnzfitch/claude-warden has 60 GitHub stars and 2 forks. It was last updated on 8 April 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.