tool-gates is a single Rust binary. Install it, then point your assistant's settings at it. The same binary serves Claude Code, Codex CLI, Antigravity CLI, and the deprecated Gemini CLI. Claude Code and Gemini CLI are auto-detected from the hook payload; Codex and Antigravity are selected by the --client codex / --client antigravity flag the installer bakes into the hook command.
Step 1 · Install the binary
Recommended on macOS and Linux. Bottles are built for arm64 and x86_64; the formula updates automatically on every release. Homebrew installation is supported for v1.5.6 and newer.
$ brew install camjac251/tap/tool-gates
Upgrade later with brew upgrade tool-gates.
Pick the right artifact for your platform; drop it on PATH and mark it executable. Pre-built binaries are available for versions v1.5.4 and newer.
Replace macos-arm64 with macos-x86_64, linux-arm64, or linux-x86_64 for your platform. Windows binaries are available for Bash-like environments such as Git Bash or MSYS2. PowerShell/cmd.exe command classification is not first-class yet; WSL users should use the Linux binary.
Requires Rust 1.97.1 or newer. Builds from source into Cargo's bin directory.
Each client uses a different hook protocol. The hooks add subcommand writes the right settings file in the right format. Multiple clients can run side by side. Settings files don't overlap.
Claude Code
4 hooks
Compatible with the latest versions of Claude Code, with built-in fallbacks for legacy hook contracts.
Personal use (recommended):
$ tool-gates hooks add -s user
Shared with team:
$ tool-gates hooks add -s project
PreToolUse: main gate
PermissionRequest: subagent gate
PermissionDenied: auto-mode retry hint
PostToolUse: approval learning + Tier 2 nudges
~/.claude/settings.json
Gemini CLI
1 hook
Deprecated compatibility: Google's consumer Gemini CLI sunset date was 2026-06-18. Existing tool-gates integrations remain available, but new setups should use Antigravity. Requires Gemini CLI v0.36.0+ for ask-decision support on BeforeTool hooks.
$ tool-gates hooks add --gemini
BeforeTool: gates every tool call
~/.gemini/settings.json
Codex CLI
3 hooks
The installer bakes --client codex into every hook command so the wire format routes correctly.
$ tool-gates hooks add --codex
PreToolUse: Bash + apply_patch + MCP
PermissionRequest: flat allow/deny
PostToolUse: Tier 3 warnings ride here
~/.codex/hooks.json
Antigravity CLI
1 hook
Google's successor to the Gemini CLI (agy). The installer bakes --client antigravity into the hook command so the wire format routes correctly. The hook gates commands (deny/ask); to also stop prompts for read-only commands, generate agy's native allowlist with tool-gates agy allowlist --apply (see Antigravity).
$ echo '{"tool_name":"Bash","tool_input":{"command":"rm -rf /"}}' | tool-gates
→ {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"rm: `rm -rf /` blocked: would recursively delete the entire root filesystem."}}
For a full health check on config, hooks, cache files, and legacy bash-gates remnants: tool-gates doctor.
Step 4 · Optional Claude Code plugin
tool-gates also ships as a Claude Code plugin with two slash commands: /tool-gates:review opens the approval TUI, /tool-gates:test-gate runs a command against the gate engine without executing it. The plugin provides skills only; the hook installation above is the prerequisite.
Add the marketplace:
/plugin marketplace add camjac251/tool-gates
Install the plugin:
/plugin install tool-gates@camjac251-tool-gates
Or from a local clone:
$ claude --plugin-dir /path/to/tool-gates/claude-plugin
After install, the two slash commands are available inside any Claude Code session: