Claude Permission Hook — Development skill for Claude Code
Claude Code hook as workaround for a bug in Claud Code allowed tools permission matching.
How to install Claude Permission Hook
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open shaxxx/claude-permission-hook and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Permission Hook does
Claude Code hook as workaround for a bug in Claud Code allowed tools permission matching.
Alternatives in Development
- 11 Permission Explainer — Permission Explainer System Prompt 2.3k ★
- Phi — a coding Agent from pi 175 ★
- Generate Permissions — Generate VAMS Permission Template 137 ★
README
Claude Code Permissions Hook
Windows-native .NET 8 hook for Claude Code tool permission control. Supports deny → allow → passthrough rule evaluation with LLM-friendly debugging.
Overview
This hook provides fine-grained control over Claude Code's tool usage through regex-based pattern matching. It's designed specifically for Windows environments and handles edge cases like absolute paths (e.g., `C:\Tools\TF.exe checkout file.txt`) that Unix-based solutions can't handle.
**Key Features:**
- Regex-based pattern matching for all Claude Code tools (Bash, Read, Write, Edit, Glob, Task, WebFetch, WebSearch, TodoWrite)
- Deny rules checked FIRST (security-critical)
- LLM-friendly debugging (
--validate-explain,--test,--explain) - Fast startup (< 100ms target)
- JSON configuration (simple and maintainable)
- Windows-native (no Unix dependencies)
Building
Prerequisites
- .NET 8 SDK
- Windows 10+ (or Windows Server 2019+)
Build (Development)
dotnet build
Build (Release)
dotnet build -c Release
Output: `src/ClaudePermissionsHook/bin/Release/net10.0/ClaudePermissionsHook.exe`
Build (AOT - Optional)
AOT compilation requires Visual Studio 2022 with C++ tooling. If you don't have full VS installed, the Release build still provides excellent performance.
dotnet publish -c Release -r win-x64 --self-contained -p:PublishAot=true
**Note:** AOT may fail with `vswhere.exe not found` errors if VS C++ tools aren't installed. This is expected - the Release build works perfectly fine without AOT.
Configuration
Example configuration (examples/tf-safe-rules.json):
{
"audit": {
"enabled": true,
"level": "matched"
},
"rules": [
{
"name": "Deny TF.exe checkin",
"enabled": true,
"decision": "deny",
"toolName": "Bash",
"commandRegex": ".*TF\.exe.*checkin.*",
"reason": "Block TF.exe checkin commands"
},
{
"name": "Allow safe TF.exe operations"
Related Skills
Denial Triage
Triage denied tool calls into permission-surface fixes — the inverse of fewer-permission-prompts, which mines
MCP WordPress Setup
Step-by-step setup guide for the WordPress MCP server with Claude Code — Application Passwords, REST API confi
Freeze
Freeze files matching a pattern — blocks Edit/Write to matched files via a session-scoped PreToolUse hook. Use
Hook Creator
You are the Hook Creator Wizard. Your job is to interview the user and generate a complete, ready-to-use Claud
Edit Hook
Authorize the next Write/Edit to a .claude/hooks/.sh file. Writes a single-use marker the injection-gate hook
Edit Settings
Authorize the next Write/Edit to a .claude/settings.json (or settings.local.json) file. Writes a single-use ma
Related Agents
QA Triager
Analyses a large failed or flaky Playwright run recorded by qa-kit (more than 15 distinct failures across 3 or
Audit Deep
Deep single-subsystem audit that reasons about state over time (caches, upserts, migrations, concurrent scans)
Linear Ticket Investigator
Extract evidence from a single Linear ticket — read the ticket, locate affected code, and return an Evidence R