convez.ai
PluginSegurançaIntermediário
hui-zheng

Claude Permissions Auditor

hui-zheng/claude-permissions-auditor

Audita e sincroniza permissões do Claude Code em múltiplos worktrees

Ver no GitHub
InicialPluginScore · de 0 a 100

Plugin que audita e sincroniza configurações de permissões em settings.local.json, detectando regras redundantes, anti-padrões, gaps de segurança e inconsistências entre worktrees. Funciona sem configuração inicial, com suporte a customização por projeto via arquivo .permissions-auditor.yml.

Instalação

$npx convez-ai hui-zheng/claude-permissions-auditor

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
57%
Último commit
há 8 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Validar qualidade de regras de permissão em projetos Claude Code
  • Detectar anti-padrões e gaps de segurança em configurações
  • Sincronizar settings entre diferentes git worktrees automaticamente
  • Manter consistência de permissões em equipes e ambientes

Veredito

Ferramenta especializada e bem-pensada para quem trabalha com Claude Code em projetos sérios. Resolve um problema real (drift de configurações e segurança) com detecção inteligente de anti-padrões e suporte a zero-config, mas tem escopo muito específico.

README

A tradução para o português deste README ainda está na fila.

claude-permissions-auditor

A Claude Code plugin that audits and syncs settings.local.json for rule quality, anti-patterns, and worktree drift. Works out-of-the-box with zero configuration, and supports project-specific customization via a companion .permissions-auditor.yml file.

Install

claude plugin add hui-zheng/claude-permissions-auditor

Or install from a local clone:

git clone https://github.com/hui-zheng/claude-permissions-auditor.git
claude plugin add ./claude-permissions-auditor

Quick Start

Audit your settings

/permissions-auditor audit

Checks for:

  • Redundant rules — wildcards that already cover specific subcommands
  • Duplicate rules — exact duplicates in allow or deny lists
  • Anti-patterns — Bash(grep:*), Bash(find:*), Bash(cat:*) (Claude has dedicated tools)
  • Malformed rules — missing closing parens, wrong separators
  • Missing rules — tools referenced in CLAUDE.md without allow rules
  • Deny gaps — destructive operations not explicitly denied (force push, push to main/master)
  • Worktree drift — settings differences across git worktrees (if worktrees exist)

Sync across worktrees

/permissions-auditor sync

Copies the current directory's settings.local.json to all other worktrees, with diff preview and confirmation for each.

Configuration

For project-specific checks, create a .permissions-auditor.yml in your project root:

# Tools your project uses (checked for missing allow rules)
tools:
  - name: poetry
    description: Python dependency management
  - name: make
    description: Build system

# Category ordering for organized settings (optional)
categories:
  allow:
    - name: "Build tools"
      patterns: ["poetry", "make"]
    - name: "Git"
      patterns: ["git"]
  deny:
    - name: "Destructive build"
      patterns: ["make clean"]
    - name: "Destructive git"
      patterns: ["push*--force", "push*origin*main"]

# Additional deny gap checks beyond universal protections
deny_gaps:
  - pattern: "make rules-clean"
    reason: "Runs git reset --hard, destroys uncommitted work"

Without this file, the auditor works in zero-config mode — it scans CLAUDE.md for tool references and applies universal checks only.

Universal Checks (always active)

These checks run regardless of whether a config file exists:

CheckWhat it catches
Redundant rulesBash(git status:*) when Bash(git:*) exists
DuplicatesExact duplicate entries in allow/deny
Anti-patternsBash(grep:*), Bash(find:*), Bash(cat:*)
Malformed rulesMissing ), wrong separators
Deny gapsForce push, push to main/master, rm -rf
Worktree driftSettings differences across worktrees

Examples

See examples/ for sample configurations:

  • .permissions-auditor.yml — Python/dbt project with poetry and database tools
  • nodejs.permissions-auditor.yml — Node.js project with npm, testing frameworks
  • go.permissions-auditor.yml — Go microservice with Docker, Kubernetes

Sample Audit Output

## Permissions Audit Report

**Settings:** .claude/settings.local.json
**Allow rules:** 24  |  **Deny rules:** 8

### Issues Found

**Redundant rules (2):**
- `Bash(git status:*)` — covered by `Bash(git:*)`
- `Bash(git diff:*)` — covered by `Bash(git:*)`

**Anti-patterns (1):**
- `Bash(grep:*)` — use the dedicated Grep tool instead

**Deny gaps (1):**
- Missing: `Bash(git*push*--force*)` — force push should be denied

### Worktree Comparison

| Rule | ./project | ./project-b | ./project-c |
|------|-----------|-------------|-------------|
| Bash(aws:*) | Y | Y | N |
| Bash(docker:*) | Y | N | N |

Design Principles

  1. Prefer wildcards over subcommand lists — Bash(git:*) not 10 individual git subcommands
  2. Don't allow what Claude has dedicated tools for — Grep, Glob, Read exist for a reason
  3. Deny destructive operations explicitly — allow rules alone aren't sufficient
  4. Use glob patterns in deny rules — Bash(git*push*--force*) catches variants
  5. Group related rules by category — easier to review and maintain
  6. Include MCP tools by full name — mcp__server__tool_name, not abbreviated

Contributing

Contributions welcome! Areas of interest:

  • Additional example configs for other tech stacks
  • New universal anti-pattern checks
  • Improved CLAUDE.md tool discovery heuristics

Please open an issue to discuss before submitting a PR.

License

MIT

Ver o original no GitHub

Bom para

Relacionados