---
name: update-config
description: Configure settings via settings.json - hooks, permissions, env vars.
when_to_use: When the user wants to configure hooks, permissions, or settings.
aliases: config-help
allowed_tools: read_file
---

Help configure the agent settings.

## Settings File Locations

- Global: `~/.claude/settings.json` applies to all projects.
- Project: `.claude/settings.json` is project-specific and committed to git.
- Local: `.claude/settings.local.json` is project-specific and gitignored.

## Configurable Settings

### Hooks

Event-driven shell commands that run on tool use or lifecycle events:

- `PreToolUse` runs before a tool executes and can block with exit code 2.
- `PostToolUse` runs after a tool completes.
- `PreCompact` runs before conversation compaction.

Hook format:

```json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'tool: $TOOL_NAME'"
          }
        ]
      }
    ]
  }
}
```

### Permissions

Tool permission rules:

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

### Environment Variables

```json
{
  "env": {
    "MY_VAR": "value"
  }
}
```
