By thenemal
LLM-evaluated permission hook for Claude Code — auto-approves safe operations, blocks destructive commands, delegates ambiguous decisions to a lightweight LLM
This skill should be used when the user asks to "clear permission cache", "reset permission hook cache", "clear cached decisions", "permission hook inconsistent behavior", or needs to wipe cached LLM permission decisions.
This skill should be used when the user asks to "customize permission rules", "edit permission hook local config", "add environment rules", "modify permission prompt", or wants to change machine-specific allow/deny rules for the LLM permission evaluator.
This skill should be used when the user asks to "diagnose permission hook", "check permission hook status", "permission hook not working", "debug permission hook", "run permission hook doctor", or when troubleshooting LLM permission evaluation issues.
This skill should be used when the user asks to "set up the permission hook", "configure ai-permission-hook", "install permission hook", "migrate from cf-approve", or needs initial configuration of the LLM-evaluated permission system.
LLM-evaluated permission hook for Claude Code. Auto-approves safe operations, blocks destructive commands, and delegates ambiguous decisions to a lightweight LLM.
Replaces the abandoned cf-approve npm package with a self-contained Claude Code plugin — zero npm dependencies.
Three-tier decision system for Claude Code's PermissionRequest hook:
| Tier | Speed | Method | Examples |
|---|---|---|---|
| 1 | Instant | Pattern matching | Read/Write/Edit → allow; rm -rf / → deny |
| 2 | Instant | Cache lookup | SHA256 of {tool, input, cwd} → cached decision |
| 3 | ~1s | LLM query | Ambiguous Bash commands → GPT-4o-mini evaluates |
| Skill | Purpose |
|---|---|
/ai-permission-hook:setup | Interactive setup — configure provider, API key, model, register hook |
/ai-permission-hook:customize | Edit machine-specific environment rules |
/ai-permission-hook:doctor | Diagnose configuration and connectivity issues |
/ai-permission-hook:clear-cache | Clear cached permission decisions |
seb-plugins marketplace/ai-permission-hook:setup to configureOne setup per machine. The hook is registered in ~/.claude/settings.json and all runtime data lives at ~/.claude/permission-hook/ — both are global. Every Claude Code session on the machine shares the same hook, config, cache, and local rules. No per-session setup needed.
All runtime data lives at ~/.claude/permission-hook/:
~/.claude/permission-hook/
├── config.json # API key, model, provider, cache TTL
├── run.sh # Wrapper script (registered in settings.json)
├── local.md # Machine-specific environment rules
├── cache/
│ └── approval_cache.json
└── logs/
└── decisions.jsonl
The LLM evaluator uses a two-layer prompt:
config/default-system-prompt.md) — generic security rubric bundled with the plugin~/.claude/permission-hook/local.md) — machine-specific rules you edit with /ai-permission-hook:customizeAlways allow: Read, Glob, Grep, Write, Edit, MultiEdit, NotebookEdit, TodoWrite, Task, WebFetch, WebSearch, BashOutput, LS, NotebookRead, all mcp__* tools
Always passthrough (user dialog): AskUserQuestion, ExitPlanMode
Always deny (Bash only): 29 destructive command patterns — rm -rf /, force-push to protected branches, fork bombs, credential theft, disk formatting, system file modification
The setup skill automatically detects an existing cf-approve installation and offers to migrate config, cache, and logs. After migration, uninstall the old package:
npm uninstall -g @abdo-el-mobayad/claude-code-fast-permission-hook
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub thenemal/thenemal-cc-marketplace --plugin ai-permission-hookSmart command safety filter for Claude Code — parses shell pipelines and evaluates per-command safety rules to auto-approve safe commands and block dangerous ones
Achieve flow state safely with Claude Code. Auto-approves routine work, gates risky actions, hard-blocks dangerous patterns. Dual enforcement (skill + hooks), token cap for cost governance, full audit trail. Zero dependencies.
Auto-handle Claude Code permission requests. Route to Claude for security review, auto-approve everything, or turn off.
PreToolUse hook that auto-approves safe Bash commands by parsing them into an AST and matching against configurable patterns
A secure runtime for Claude Code. Intercepts every tool call with policy-based allow/block/ask decisions, evasion detection, path fencing, file snapshots, and audit logging.
Easily create hooks to prevent unwanted behaviors by analyzing conversation patterns