kornysietsma

Claude Code Permissions Hook — Development skill for Claude Code

Development community

A PreToolUse hook for Claude Code for more granular permission controls.

How to install Claude Code Permissions Hook

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kornysietsma/claude-code-permissions-hook and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Permissions Hook does

A PreToolUse hook for Claude Code for more granular permission controls.

Alternatives in Development

  • Internet Court Skill — The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 4.9k ★
  • Ccundo — Integrates seamlessly with Claude Code to provide granular undo functionality by reading directly from Claude 1.4k ★
  • WP Abilities API — WordPress capabilities and permissions API 902 ★

README

Command Permissions Hook for Claude Code

A PreToolUse hook for Claude Code that provides granular control over which tools Claude can use, with support for allow/deny rules, pattern matching, and security exclusions.

NOTE: This is a workaround for current (December 2025) limitations in Claude Code permissions - [setting Bash permissions](https://docs.claude.com/en/docs/claude-code/iam#tool-specific-permission-rules) doesn't work consistently. Built following Anthropic's [hook guidelines](https://docs.claude.com/en/docs/claude-code/iam#additional-permission-control-with-hooks).

This may be short-lived as Anthropic improves permissions. Use it if it helps, but you'll need basic Rust knowledge.

Features

  • All configuration is via a single .toml file - see example.toml for an example
  • Allow/deny rules with regex pattern matching for tool inputs
  • Exclude patterns for handling edge cases (e.g., block .. in allowed paths)
  • Audit logging of tool use decisions to JSON file

Documentation

Installation

Requires Rust. Install via [rustup](https://rustup.rs/) if you want to use this project. Rust is fun!

cargo build --release

Binary: `target/release/claude-code-permissions-hook`

Configuration

Create a TOML configuration file (see `example.toml`):

[audit]
audit_file = "/tmp/claude-tool-use.json"
# Audit level: off, matched (default), all
# - off: no auditing
# - matched: audit only tool use that hits a rule (allow/deny)
# - all: audit everything including passthrough
audit_level = "matched"

# Allow rules - checked after deny rules
[[allow]]
tool = "Read"
file_path_regex = "^/Users/korny/Dropbox/prj/.*"
file_path_exclude_regex = "\\.\\."  # Block path traversal

[[allow]]
tool = "Bash"
command_regex = "^c