camjac251/tool-gates
Intelligent permission gate for Claude Code shell, file, search, Skill, and MCP tool surfaces. AST-parses Bash commands, guards file reads/writes, and blocks configured tool invocations. Defers benign asks to CC's resolver so the prompt UI shows the 'Yes, and don't ask again for X' button, while keeping a deny floor for dangerous patterns. Tracks one-time approvals so they can be batch-promoted to permanent rules later.
Batch-promote frequently asked tool-gates patterns to permanent permission rules in settings.json. Lists pending one-time approvals across sessions, shows counts and suggested glob patterns, and writes selected rules at local, project, or user scope. Use when the user asks to review pending approvals, promote recurring patterns, clean up the approval queue, share rules, or audit accumulated approvals. For a single in-session approval, use Claude Code's "Yes, and don't ask again" prompt. Not for manual settings edits, hooks, environment variables, MCP configuration, or building an allowlist from a transcript.
Test how tool-gates evaluates any tool invocation (Bash, Read, Write, Edit, Glob, Grep, Skill, MCP) and show the permission decision (allow / ask / deny / defer). Pipes a synthesized JSON payload to the tool-gates binary and formats the result. Useful for verifying a new gate, debugging why a command was blocked, or distinguishing 'tool-gates explicitly asks' from 'tool-gates lets CC handle it'. NOT for approving a pending permission (use tool-gates:review) or editing rules manually (use update-config). When checking whether a command would be allowed, debugging why something was blocked or denied, verifying a permission rule works, simulating a tool call without running it, or confirming the defer-vs-explicit-ask wire decision. Triggers on 'is this allowed', 'test gate', 'why was this blocked', 'why was this denied', 'check permission', 'simulate tool call', 'would this run', 'does tool-gates catch this'.