auto-mode
Auto mode permission handling — classifier-based approvals, PermissionDenied hook, defer permissionDecision, and autonomy profiles for hands-off Claude Code usage
What this skill does
# Auto Mode
Auto mode is the middle ground between approving every tool call and running with `--dangerously-skip-permissions`. A classifier evaluates each permission prompt and either approves safe operations silently or blocks and surfaces suspicious ones.
Available since v2.1.83 (research preview).
## The Three Permission Modes
Cycle with **Shift+Tab** in the terminal:
| Mode | Behavior |
|------|----------|
| `default` | Claude asks for approval on every sensitive action |
| `auto` | Classifier auto-approves safe actions; blocks/surfaces suspicious ones |
| `bypassPermissions` | All actions run without prompting (dangerous — only in trusted environments) |
## Enabling Auto Mode
### Per-session
Press **Shift+Tab** until you see `auto mode on` in the footer.
### As default (settings.json)
```json
{
"permissions": {
"defaultMode": "auto"
}
}
```
### Command-line flag
```bash
claude --permission-mode auto
```
## How the Classifier Works
The classifier scores each tool call against a risk model. For each action:
- **Low risk** (reading files, running lint, git status) → silently approved
- **Medium risk** (writing files, running tests) → approved with a brief log entry
- **High risk** (deleting files, network calls to unknown hosts, force-pushing) → blocked and surfaced to you
You see the same UI as a manual block, so you can review and override when needed.
## Handling Denials with PermissionDenied Hook
When the classifier blocks an action, a `PermissionDenied` hook fires before Claude has a chance to respond. Use it to:
- Log blocked actions for audit trails
- Return `retry: true` to let Claude try a different approach instead of failing
```json
{
"hooks": {
"PermissionDenied": [{
"hooks": [{
"type": "command",
"command": ".claude/hooks/permission-denied.sh"
}]
}]
}
}
```
```bash
#!/usr/bin/env bash
# permission-denied.sh
set -euo pipefail
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name // "unknown"')
REASON=$(echo "$INPUT" | jq -r '.reason // "no reason"')
# Log to audit file
printf '%s\t%s\t%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$TOOL" "$REASON" \
>> .claude/logs/permission-denied.log
# Return retry: true so Claude tries an alternative approach
echo '{"retry": true}'
```
Alternatively, retry manually from the `/permissions` → **Recent** tab using `r`.
## Deferring Decisions in Headless Mode
For SDK apps and custom UIs that run Claude in `-p` (print/pipe) mode, use `defer` on a `PreToolUse` hook to pause Claude at a tool call and hand the decision to your application:
```json
{
"hooks": {
"PreToolUse": [{
"hooks": [{
"type": "command",
"command": ".claude/hooks/pause-for-review.sh"
}]
}]
}
}
```
```bash
#!/usr/bin/env bash
# pause-for-review.sh — returns defer for sensitive tools
set -euo pipefail
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name // ""')
case "$TOOL" in
Bash|Write|Edit)
echo '{"permissionDecision": "defer"}'
;;
*)
echo '{"decision": "approve"}'
;;
esac
```
When Claude hits a `defer`:
1. Claude Code exits with a `deferred_tool_use` payload
2. Your app surfaces the decision (custom UI, Slack message, approval flow)
3. Your app resumes: `claude --resume <session-id> --permission-decision approve`
## Auto Mode vs Manual Approval vs bypassPermissions
| | Manual | Auto | bypassPermissions |
|--|--------|------|-------------------|
| File reads | Prompt | ✅ Silent | ✅ Silent |
| File writes | Prompt | ✅ Usually silent | ✅ Silent |
| git push | Prompt | ⚠️ Surfaced | ✅ Silent |
| rm -rf | Prompt | 🚫 Blocked | ✅ Silent |
| Network calls | Prompt | ⚠️ Surfaced | ✅ Silent |
| Effort | High friction | Low friction | Zero friction / high risk |
**Recommended for most workflows:** `auto` mode.
**Only use bypassPermissions:** In locked-down CI containers where you control the entire environment.
## Combining with Autonomy Profiles
Auto mode pairs well with the autonomy profiles from `skills/autonomy-profiles/SKILL.md`. Set `defaultMode: "auto"` and then configure the appropriate autonomy profile (conservative, balanced, aggressive) to control task scope and self-correction behavior independently of permission approval.
## Checking Current Mode
```bash
/status # shows current permission mode in the footer
/permissions # opens the full permissions panel
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.