---
name: permission-system
description: |
  Claude Code permission modes and access control patterns.
  Use when configuring tool access, understanding permission prompts,
  or implementing secure workflows. Covers default, plan, and auto modes.

allowed-tools:
  - Read
---

# Permission System Skill

## Permission Modes

| Mode | Description | Use Case |
|------|-------------|----------|
| `default` | Ask for each tool | Safe exploration |
| `plan` | Read-only, no writes | Code review |
| `auto-edit` | Auto-approve edits | Trusted workflows |

## Configuring Modes

### Via Settings

In `.claude/settings.json`:

```json
{
  "permissions": {
    "mode": "default",
    "allow": ["Read", "Glob", "Grep"],
    "deny": ["Bash:rm *"]
  }
}
```

### Via Command Line

```bash
claude --permission-mode=plan
```

## Tool Categories

| Category | Tools | Risk |
|----------|-------|------|
| Read-only | Read, Glob, Grep | Low |
| Write | Edit, Write | Medium |
| Execute | Bash | High |
| External | WebFetch, MCP | Variable |

## Permission Prompts

When Claude requests a tool:

```
Claude wants to: Edit file.py
Allow? [y/n/a(lways)/s(ession)]
```

Options:
- `y` - Allow once
- `n` - Deny
- `a` - Always allow this pattern
- `s` - Allow for session

## Bash Permissions

Fine-grained Bash control:

```json
{
  "permissions": {
    "allow": [
      "Bash:npm test",
      "Bash:git status",
      "Bash:python *.py"
    ],
    "deny": [
      "Bash:rm -rf",
      "Bash:sudo *"
    ]
  }
}
```

## Pre-Approval in Hooks

Background subagents need pre-approval:

```
"This task needs:
- Read access to /src/**
- Bash for npm test
Approve? [y/n]"
```

## Best Practices

1. Use `plan` mode for reviews
2. Pre-approve patterns, not blanket access
3. Deny destructive commands explicitly
4. Use session-scoped approvals
