Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Approval Learning

When you click Yes on a tool-gates ask, the command joins a pending queue. The tool-gates review TUI lets you promote any of those patterns to a permanent rule in settings.json, so future matching calls auto-allow without prompting.

Lifecycle

Ask once, promote once, never see it again.

approval learning
Ask
tool-gates returns ask; you click Yes. The command executes.
PostToolUse
Track
On successful execution, the (project, command) pair lands in ~/.cache/tool-gates/pending.jsonl.
tool-gates review
Promote
You open the TUI (or run tool-gates approve directly). Pick the pattern and scope; tool-gates writes a permission rule into settings.json.
Auto-allow
Future matching calls return allow with no prompt.

CLI

Inspect and promote without the TUI.

Inspect the pending queue:

$ tool-gates pending list
$ tool-gates pending list --project
$ tool-gates pending list --json

Promote a pattern directly:

$ tool-gates approve 'npm install*' -s local
$ tool-gates approve 'cargo*' -s user

Manage existing rules:

$ tool-gates rules list
$ tool-gates rules remove 'pattern' -s local

Inspect ask rules that suppress the third "don't ask again" button:

$ tool-gates rules ask-audit

Interactively audit and clean up ask rules via a TUI checklist:

$ tool-gates rules ask-audit --apply

Scopes

Where the rule lives.

Pick the scope that matches who should see this rule.

local

per-machine

Personal overrides on this checkout only. Not committed.

.claude/settings.local.json

project

team baseline

Shared rules for everyone working on this repo. Committed.

.claude/settings.json

user

global

Personal defaults across every project on this machine.

~/.claude/settings.json

Review TUI

Or promote interactively.

Run tool-gates review for a keyboard-first dashboard: pending commands with colour-and-symbol-coded segments, a blast-radius meter that escalates friction as a rule widens, and tabs for managing the allow / deny rules you already have. Full walkthrough and keymap live on the Review TUI page.

Only human approvals queue. Under auto mode the classifier decides silently; nothing it approves goes into pending.jsonl. The review queue stays focused on patterns you explicitly clicked through.

tool-gates · permission gate hook for Claude Code, Codex CLI, and Antigravity CLI, with deprecated Gemini CLI support. github.com/camjac251/tool-gates

13 gates · 400+ commands · built from rules/*.toml