Skip to content

Claude How ToClaude How To

Complete Guide to Claude Concepts ​

A conceptual overview of how Claude Code's features work and fit together — architecture diagrams, decision tables, and comparisons across Slash Commands, Subagents, Memory, MCP, Skills, Plugins, Hooks, and more.

How to use this guide: this page explains the concepts — what each feature is, how it works internally, and when to reach for it. The copy-paste templates and full reference material live in the numbered modules (01- through 10-), which each section links to. Start here to build a mental model, then go to the module to actually configure something.


Table of Contents ​

  1. Slash Commands — module
  2. Subagents — module
  3. Memory — module
  4. MCP Protocol — module
  5. Agent Skills — module
  6. Plugins — module
  7. Comparison & Integration
  8. Summary Table
  9. Quick Start Guide
  10. Hooks — module
  11. Checkpoints and Rewind — module
  12. Advanced Features — module
  13. Models and Reasoning Effort — module
  14. Resources

Slash Commands ​

Overview ​

Slash commands are user-invoked shortcuts stored as Markdown files that Claude Code can execute. They enable teams to standardize frequently-used prompts and workflows.

Architecture ​

File Structure ​

Command Organization Table ​

LocationScopeAvailabilityUse CaseGit Tracked
.claude/commands/Project-specificTeam membersTeam workflows, shared standards✅ Yes
~/.claude/commands/PersonalIndividual userPersonal shortcuts across projects❌ No
SubdirectoriesNamespacedBased on parentOrganize by category✅ Yes

Features & Capabilities ​

FeatureExampleSupported
Shell script executionbash scripts/deploy.sh✅ Yes
File references@path/to/file.js✅ Yes
Bash integration$(git log --oneline)✅ Yes
Arguments/pr --verbose✅ Yes
MCP commands/mcp__github__list_prs✅ Yes

Practical Examples ​

Eight copy-paste command templates live in 01-slash-commands/ — /optimize, /pr, /commit, /push-all, /generate-api-docs, /doc-refactor, /setup-ci-cd, and /unit-test-expand.

01-slash-commands/README.md also carries the full built-in command reference (60+ commands) and the frontmatter field table.

Command Lifecycle Diagram ​

Best Practices ​

✅ Do❌ Don't
Use clear, action-oriented namesCreate commands for one-time tasks
Document trigger words in descriptionBuild complex logic in commands
Keep commands focused on single taskCreate redundant commands
Version control project commandsHardcode sensitive information
Organize in subdirectoriesCreate long lists of commands
Use simple, readable promptsUse abbreviated or cryptic wording

Subagents ​

Overview ​

Subagents are specialized AI assistants with isolated context windows and customized system prompts. They enable delegated task execution while maintaining clean separation of concerns.

Subagents can spawn their own subagents, nested on by default up to depth 3 (v2.1.219) — so the hierarchy is not limited to the single main → subagent layer shown below. Set CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH to change the limit, or 1 to turn nesting off. (History: v2.1.172–v2.1.216 nested by default up to 5 layers with no way to change it; v2.1.217 made nesting opt-in at depth 1; v2.1.219 set the default to 3.)

Architecture Diagram ​

Subagent Lifecycle ​

Subagent Configuration Table ​

ConfigurationTypePurposeExample
nameStringAgent identifiercode-reviewer
descriptionStringPurpose & trigger termsComprehensive code quality analysis
toolsList/StringAllowed capabilitiesread, grep, diff, lint_runner
system_promptMarkdownBehavioral instructionsCustom guidelines

Tool Access Hierarchy ​

Practical Examples ​

Nine ready-to-use subagent definitions live in 04-subagents/ — code-reviewer, clean-code-reviewer, secure-reviewer, test-engineer, documentation-writer, implementation-agent, performance-optimizer, debugger, and data-scientist.

04-subagents/README.md documents the complete frontmatter reference, tool-access rules, nesting limits, and Agent Teams.

Subagent Context Management ​

When to Use Subagents ​

ScenarioUse SubagentWhy
Complex feature with many steps✅ YesSeparate concerns, prevent context pollution
Quick code review❌ NoNot necessary overhead
Parallel task execution✅ YesEach subagent has own context
Specialized expertise needed✅ YesCustom system prompts
Long-running analysis✅ YesPrevents main context exhaustion
Single task❌ NoAdds latency unnecessarily

Agent Teams ​

Agent Teams coordinate multiple agents working on related tasks. Rather than delegating to one subagent at a time, Agent Teams allow the main agent to orchestrate a group of agents that collaborate, share intermediate results, and work toward a common goal. This is useful for large-scale tasks like full-stack feature development where a frontend agent, backend agent, and testing agent work in parallel.


Memory ​

Overview ​

Memory enables Claude to retain context across sessions and conversations. It exists in two forms: automatic synthesis in claude.ai, and filesystem-based CLAUDE.md in Claude Code.

Memory Architecture ​

Memory Hierarchy in Claude Code (7 Tiers) ​

Claude Code loads memory from 7 tiers, listed from highest to lowest priority:

Memory Locations Table ​

TierLocationScopePrioritySharedBest For
1. Managed PolicyEnterprise adminOrganizationHighestAll org usersCompliance, security policies
2. Project./CLAUDE.mdProjectHighTeam (Git)Team standards, architecture
3. Project Rules.claude/rules/*.mdProjectHighTeam (Git)Modular project conventions
4. User~/.claude/CLAUDE.mdPersonalMediumIndividualPersonal preferences
5. User Rules~/.claude/rules/*.mdPersonalMediumIndividualPersonal rule modules
6. Local./CLAUDE.local.mdLocalLowNot sharedMachine-specific settings
7. Auto MemoryAutomaticSessionLowestIndividualLearned preferences, patterns

Auto Memory ​

Auto Memory automatically captures user preferences and patterns observed during sessions. Claude learns from your interactions and remembers:

  • Coding style preferences
  • Common corrections you make
  • Framework and tool choices
  • Communication style preferences

Auto Memory works in the background and does not require manual configuration.

Memory Update Lifecycle ​

Practical Examples ​

Copy-paste memory templates live in 02-memory/:

  • project-CLAUDE.md — team-wide project standards for ./CLAUDE.md
  • personal-CLAUDE.md — individual preferences for ~/.claude/CLAUDE.md
  • directory-api-CLAUDE.md — directory-scoped standards for a subtree

02-memory/README.md covers the full hierarchy, import syntax, .claude/rules/, auto memory, and how to keep CLAUDE.md under 200 lines.

Memory in Claude Web/Desktop ​

Memory Synthesis Timeline ​

Auto Memory Contents ​

Auto memory stores what Claude learns about you across sessions in ~/.claude/projects/<project>/memory/, indexed by MEMORY.md. See 02-memory/README.md for the file layout, loading limits, and how to enable or disable it.

Memory Features Comparison ​

FeatureClaude Web/DesktopClaude Code (CLAUDE.md)
Auto-synthesis✅ Every 24h❌ Manual
Cross-project✅ Shared❌ Project-specific
Team access✅ Shared projects✅ Git-tracked
Searchable✅ Built-in✅ Through /memory
Editable✅ In-chat✅ Direct file edit
Import/Export✅ Yes✅ Copy/paste
Persistent✅ 24h+✅ Indefinite

MCP Protocol ​

Overview ​

MCP (Model Context Protocol) is a standardized way for Claude to access external tools, APIs, and real-time data sources. Unlike Memory, MCP provides live access to changing data.

MCP Architecture ​

MCP Ecosystem ​

MCP Setup Process ​

Available MCP Servers Table ​

MCP ServerPurposeCommon ToolsAuthReal-time
FilesystemFile operationsread, write, deleteOS permissions✅ Yes
GitHubRepository managementlist_prs, create_issue, pushOAuth✅ Yes
SlackTeam communicationsend_message, list_channelsToken✅ Yes
DatabaseSQL queriesquery, insert, updateCredentials✅ Yes
Google DocsDocument accessread, write, shareOAuth✅ Yes
AsanaProject managementcreate_task, update_statusAPI Key✅ Yes
StripePayment datalist_charges, create_invoiceAPI Key✅ Yes
MemoryPersistent memorystore, retrieve, deleteLocal❌ No

Practical Examples ​

Ready-to-use MCP server configurations live in 05-mcp/: github-mcp.json, database-mcp.json, filesystem-mcp.json, and multi-mcp.json (four servers in one file).

05-mcp/README.md covers the full claude mcp add syntax, transports, scopes, OAuth, and enterprise allowlisting.

MCP vs Memory: Decision Matrix ​

Request/Response Pattern ​


Agent Skills ​

Overview ​

Agent Skills are reusable, model-invoked capabilities packaged as folders containing instructions, scripts, and resources. Claude automatically detects and uses relevant skills.

Skill Architecture ​

Skill Loading Process ​

Skill Types & Locations Table ​

TypeLocationScopeSharedSyncBest For
Pre-builtBuilt-inGlobalAll usersAutoDocument creation
Personal~/.claude/skills/IndividualNoManualPersonal automation
Project.claude/skills/TeamYesGitTeam standards
PluginVia plugin installVariesDependsAutoIntegrated features

Pre-built Skills ​

Bundled Skills ​

Claude Code now includes 10 bundled skills available out of the box:

SkillCommandPurpose
Batch/batchRun operations across multiple files or items
Claude API/claude-apiInteract with the Anthropic API directly
Code Review/code-reviewReview the current diff for correctness bugs at a chosen effort level. A distinct skill from /simplify (quality/reuse cleanups), which was split back out in v2.1.154. Explicit invocation only since v2.1.215
Simplify/simplifyQuality, reuse, and cleanup review — distinct from /code-review again since v2.1.154
Debug/debugSystematic debugging of issues with root cause analysis
Fewer Permission Prompts/fewer-permission-promptsScan transcripts and propose a prioritized allowlist for common read-only tools
Loop/loopSchedule recurring tasks on a timer
Run/runLaunch and drive the project's app to verify a change (v2.1.145+)
Run Skill Generator/run-skill-generatorScaffold a new skill from a description (v2.1.145+)
Verify/verifyVerify that a change actually works (v2.1.145+). Explicit invocation only since v2.1.215

These bundled skills are always available and do not require installation or configuration.

Practical Examples ​

Six complete skills — with their scripts, templates, and reference files — live in 03-skills/:

  • code-review-specialist/ — review checklist, finding template, and two Python metrics scripts
  • refactor/ — code-smell catalog, refactoring catalog, plan template, and two analysis scripts
  • doc-generator/ — API documentation generation from source
  • blog-draft/ — outline and draft templates with a versioned output convention
  • brand-voice/ — tone rules and message templates (demonstrates user-invocable: false)
  • claude-md/ — create, update, and audit CLAUDE.md files

See 03-skills/README.md for the full frontmatter reference and progressive-disclosure model.

Skill Discovery & Invocation ​

Skill vs Other Features ​


Claude Code Plugins ​

Overview ​

Claude Code Plugins are bundled collections of customizations (slash commands, subagents, MCP servers, and hooks) that install with a single command. They represent the highest-level extension mechanism—combining multiple features into cohesive, shareable packages.

Architecture ​

Plugin Loading Process ​

Plugin Types & Distribution ​

TypeScopeSharedAuthorityExamples
OfficialGlobalAll usersAnthropicPR Review, Security Guidance
CommunityPublicAll usersCommunityDevOps, Data Science
OrganizationInternalTeam membersCompanyInternal standards, tools
PersonalIndividualSingle userDeveloperCustom workflows

Plugin Definition Structure ​

yaml
---
name: plugin-name
version: "1.0.0"
description: "What this plugin does"
author: "Your Name"
license: MIT

# Plugin metadata
tags:
  - category
  - use-case

# Requirements
requires:
  - claude-code: ">=2.1.0"

# Components bundled
components:
  - type: commands
    path: commands/
  - type: agents
    path: agents/
  - type: mcp
    path: mcp/
  - type: hooks
    path: hooks/

# Configuration
config:
  auto_load: true
  enabled_by_default: true
---

Plugin Structure ​

my-plugin/
├── .claude-plugin/
│   └── plugin.json
├── commands/
│   ├── task-1.md
│   ├── task-2.md
│   └── workflows/
├── agents/
│   ├── specialist-1.md
│   ├── specialist-2.md
│   └── configs/
├── skills/
│   ├── skill-1.md
│   └── skill-2.md
├── hooks/
│   └── hooks.json
├── .mcp.json
├── .lsp.json
├── settings.json
├── templates/
│   └── issue-template.md
├── scripts/
│   ├── helper-1.sh
│   └── helper-2.py
├── docs/
│   ├── README.md
│   └── USAGE.md
└── tests/
    └── plugin.test.js

Practical Examples ​

Three complete, installable plugins live in 07-plugins/:

  • pr-review/ — review commands, three specialist agents, GitHub MCP, and a pre-review hook
  • documentation/ — doc generation commands, three agents, and reusable templates
  • devops-automation/ — deploy/rollback/status/incident commands, three agents, Kubernetes MCP, and shell scripts

Each includes its .claude-plugin/plugin.json manifest and directory layout.

Plugin Marketplace ​

Plugin Installation & Lifecycle ​

Plugin Features Comparison ​

FeatureSlash CommandSkillSubagentPlugin
InstallationManual copyManual copyManual configOne command
Setup Time5 minutes10 minutes15 minutes2 minutes
BundlingSingle fileSingle fileSingle fileMultiple
VersioningManualManualManualAutomatic
Team SharingCopy fileCopy fileCopy fileInstall ID
UpdatesManualManualManualAuto-available
DependenciesNoneNoneNoneMay include
MarketplaceNoNoNoYes
DistributionRepositoryRepositoryRepositoryMarketplace

Plugin Use Cases ​

Use CaseRecommendationWhy
Team Onboarding✅ Use PluginInstant setup, all configurations
Framework Setup✅ Use PluginBundles framework-specific commands
Enterprise Standards✅ Use PluginCentral distribution, version control
Quick Task Automation❌ Use CommandOverkill complexity
Single Domain Expertise❌ Use SkillToo heavy, use skill instead
Specialized Analysis❌ Use SubagentCreate manually or use skill
Live Data Access❌ Use MCPStandalone, don't bundle

When to Create a Plugin ​

Publishing a Plugin ​

Steps to publish:

  1. Create plugin structure with all components
  2. Write .claude-plugin/plugin.json manifest
  3. Create README.md with documentation
  4. Test locally with /plugin install ./my-plugin
  5. Submit to plugin marketplace
  6. Get reviewed and approved
  7. Published on marketplace
  8. Users can install with one command

Example Plugin README ​

See the three complete plugins in 07-plugins/ — pr-review/, documentation/, and devops-automation/ each ship a full README.md, manifest, commands, agents, and MCP config you can copy wholesale.

Plugin vs Manual Configuration ​

Manual Setup (2+ hours):

  • Install slash commands one by one
  • Create subagents individually
  • Configure MCPs separately
  • Set up hooks manually
  • Document everything
  • Share with team (hope they configure correctly)

With Plugin (2 minutes):

bash
/plugin install pr-review
# ✅ Everything installed and configured
# ✅ Ready to use immediately
# ✅ Team can reproduce exact setup

Comparison & Integration ​

Feature Comparison Matrix ​

FeatureInvocationPersistenceScopeUse Case
Slash CommandsManual (/cmd)Session onlySingle commandQuick shortcuts
SubagentsAuto-delegatedIsolated contextSpecialized taskTask distribution
MemoryAuto-loadedCross-sessionUser/team contextLong-term learning
MCP ProtocolAuto-queriedReal-time externalLive data accessDynamic information
SkillsAuto-invokedFilesystem-basedReusable expertiseAutomated workflows

Interaction Timeline ​

Practical Integration Example: Customer Support Automation ​

Architecture ​

Request Flow ​

markdown
## Customer Support Request Flow

### 1. Incoming Email
"I'm getting error 500 when trying to upload files. This is blocking my workflow!"

### 2. Memory Lookup
- Loads CLAUDE.md with support standards
- Checks customer history: VIP customer, 3rd incident this month

### 3. MCP Queries
- GitHub MCP: List open issues (finds related bug report)
- Database MCP: Check system status (no outages reported)
- Slack MCP: Check if engineering is aware

### 4. Skill Detection & Loading
- Request matches "Technical Support" skill
- Loads support response template from Skill

### 5. Subagent Delegation
- Routes to Tech Support Subagent
- Provides context: customer history, error details, known issues
- Subagent has full access to: read, bash, grep tools

### 6. Subagent Processing
Tech Support Subagent:
- Searches codebase for 500 error in file upload
- Finds recent change in commit 8f4a2c
- Creates workaround documentation

### 7. Skill Execution
Response Generator Skill:
- Uses Brand Voice guidelines
- Formats response with empathy
- Includes workaround steps
- Links to related documentation

### 8. MCP Output
- Posts update to #support Slack channel
- Tags engineering team
- Updates ticket in Jira MCP

### 9. Response
Customer receives:
- Empathetic acknowledgment
- Explanation of cause
- Immediate workaround
- Timeline for permanent fix
- Link to related issues

Complete Feature Orchestration ​

When to Use Each Feature ​

Selection Decision Tree ​


Summary Table ​

AspectSlash CommandsSubagentsMemoryMCPSkillsPlugins
Setup DifficultyEasyMediumEasyMediumMediumEasy
Learning CurveLowMediumLowMediumMediumLow
Team BenefitHighHighMediumHighHighVery High
Automation LevelLowHighMediumHighHighVery High
Context ManagementSingle-sessionIsolatedPersistentReal-timePersistentAll features
Maintenance BurdenLowMediumLowMediumMediumLow
ScalabilityGoodExcellentGoodExcellentExcellentExcellent
ShareabilityFairFairGoodGoodGoodExcellent
VersioningManualManualManualManualManualAutomatic
InstallationManual copyManual configN/AManual configManual copyOne command

Quick Start Guide ​

Week 1: Start Simple ​

  • Create 2-3 slash commands for common tasks
  • Enable Memory in Settings
  • Document team standards in CLAUDE.md

Week 2: Add Real-time Access ​

  • Set up 1 MCP (GitHub or Database)
  • Use /mcp to configure
  • Query live data in your workflows

Week 3: Distribute Work ​

  • Create first Subagent for specific role
  • Ask Claude to create it, or add a .claude/agents/<name>.md file (the /agents wizard was removed)
  • Test delegation with simple task

Week 4: Automate Everything ​

  • Create first Skill for repeated automation
  • Use Skill marketplace or build custom
  • Combine all features for full workflow

Ongoing ​

  • Review and update Memory monthly
  • Add new Skills as patterns emerge
  • Optimize MCP queries
  • Refine Subagent prompts

Hooks ​

Overview ​

Hooks are event-driven shell commands that execute automatically in response to Claude Code events. They enable automation, validation, and custom workflows without manual intervention.

Hook Events ​

Claude Code supports 33 hook events across five hook types (command, http, mcp_tool, prompt, agent):

Hook EventTriggerUse Cases
SessionStartSession begins/resumes/clear/compactEnvironment setup, initialization
SetupInitial environment setup (one-time per session)Provision tooling, install deps
InstructionsLoadedCLAUDE.md or rules file loadedValidation, transformation, augmentation
UserPromptSubmitUser submits promptInput validation, prompt filtering
UserPromptExpansionUser prompt expanded (@-mentions, slash commands resolved)Transform or inspect expanded prompt
PreToolUseBefore any tool runsValidation, approval gates, logging
PermissionRequestPermission dialog shownAuto-approve/deny flows
PermissionDeniedUser denies a permission promptLogging, analytics, policy enforcement
PostToolUseAfter tool succeedsAuto-formatting, notifications, cleanup
PostToolUseFailureTool execution failsError handling, logging
PostToolBatchAfter a batch of tool uses completesAggregate reporting, batched validation
NotificationNotification sentAlerting, external integrations
MessageDisplayWhile assistant message text is displayedTransform or hide displayed message text
SubagentStartSubagent spawnedContext injection, initialization
SubagentStopSubagent finishesResult validation, logging
StopClaude finishes respondingSummary generation, cleanup tasks
StopFailureAPI error ends turnError recovery, logging
TeammateIdleAgent team teammate idleWork distribution, coordination
TaskCompletedTask marked complete. Only fires when the todo tools are enabled — available by default only on Claude 3.x models, Opus 4 through 4.7, Sonnet 4 through 4.6, and Haiku 4.5; CLAUDE_CODE_ENABLE_TODO_TOOLS=1 restores them (v2.1.233)Post-task processing
TaskCreatedTask created via TaskCreate. Only fires when the todo tools are enabled — available by default only on Claude 3.x models, Opus 4 through 4.7, Sonnet 4 through 4.6, and Haiku 4.5; CLAUDE_CODE_ENABLE_TODO_TOOLS=1 restores them (v2.1.233)Task tracking, logging
ConfigChangeConfig file changesValidation, propagation
CwdChangedWorking directory changesDirectory-specific setup
DirectoryAddedNew working directory registered mid-session via /add-dir or the SDK register_repo_root control requestSet up tooling for a newly added directory
FileChangedWatched file changesFile monitoring, rebuild triggers
PreCompactBefore context compactionState preservation
PostCompactAfter compaction completesPost-compact actions
PreModelSwitchBefore a requested model switch is appliedGate or veto model changes
PostModelSwitchAfter the session's model changesLog or react to model changes
WorktreeCreateWorktree being createdEnvironment setup, dependency install
WorktreeRemoveWorktree being removedCleanup, resource deallocation
ElicitationMCP server requests user inputInput validation
ElicitationResultUser responds to elicitationResponse processing
SessionEndSession terminatesCleanup, final logging

Common Hooks ​

Hooks are configured in ~/.claude/settings.json (user-level) or .claude/settings.json (project-level):

json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "prettier --write $CLAUDE_FILE_PATH"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "eslint $CLAUDE_FILE_PATH"
          }
        ]
      }
    ]
  }
}

Hook Environment Variables ​

  • $CLAUDE_FILE_PATH - Path to file being edited/written
  • $CLAUDE_TOOL_NAME - Name of tool being used
  • $CLAUDE_SESSION_ID - Current session identifier
  • $CLAUDE_PROJECT_DIR - Project directory path

Best Practices ​

✅ Do:

  • Keep hooks fast (< 1 second)
  • Use hooks for validation and automation
  • Handle errors gracefully
  • Use absolute paths

❌ Don't:

  • Make hooks interactive
  • Use hooks for long-running tasks
  • Hardcode credentials

See: 06-hooks/ for detailed examples


Checkpoints and Rewind ​

Overview ​

Checkpoints allow you to save conversation state and rewind to previous points, enabling safe experimentation and exploration of multiple approaches.

Key Concepts ​

ConceptDescription
CheckpointSnapshot of conversation state including messages, files, and context
RewindReturn to a previous checkpoint, discarding subsequent changes
Branch PointCheckpoint from which multiple approaches are explored

Accessing Checkpoints ​

Checkpoints are created automatically with every user prompt. To rewind:

bash
# Press Esc twice to open the checkpoint browser
Esc + Esc

# Or use the /rewind command
/rewind

When you select a checkpoint, you choose from five options:

  1. Restore code and conversation -- Revert both to that point
  2. Restore conversation -- Rewind messages, keep current code
  3. Restore code -- Revert files, keep conversation
  4. Summarize from here -- Compress conversation into a summary
  5. Never mind -- Cancel

Use Cases ​

ScenarioWorkflow
Exploring ApproachesSave → Try A → Save → Rewind → Try B → Compare
Safe RefactoringSave → Refactor → Test → If fail: Rewind
A/B TestingSave → Design A → Save → Rewind → Design B → Compare
Mistake RecoveryNotice issue → Rewind to last good state

Configuration ​

json
{
  "autoCheckpoint": true
}

See: 08-checkpoints/ for detailed examples


Advanced Features ​

Planning Mode ​

Create detailed implementation plans before coding.

Activation:

bash
/plan Implement user authentication system

Benefits:

  • Clear roadmap with time estimates
  • Risk assessment
  • Systematic task breakdown
  • Opportunity for review and modification

Extended Thinking ​

Deep reasoning for complex problems.

Activation:

  • Toggle with Alt+T (or Option+T on macOS) during a session
  • Set MAX_THINKING_TOKENS environment variable for programmatic control
bash
# Enable extended thinking via environment variable
export MAX_THINKING_TOKENS=50000
claude -p "Should we use microservices or monolith?"

Benefits:

  • Thorough analysis of trade-offs
  • Better architectural decisions
  • Consideration of edge cases
  • Systematic evaluation

Background Tasks ​

Run long operations without blocking the conversation.

Usage:

bash
User: Run tests in background

Claude: Started task bg-1234

/task list           # Show all tasks
/task status bg-1234 # Check progress
/task show bg-1234   # View output
/task cancel bg-1234 # Cancel task

Permission Modes ​

Control what Claude can do.

ModeDescriptionUse Case
manualStandard permissions with prompts for sensitive actions (renamed from default in v2.1.200; default still works as an alias)General development
acceptEditsAutomatically accept file edits without confirmationTrusted editing workflows
planAnalysis and planning only, no file modificationsCode review, architecture planning
autoAutomatically approve safe actions, prompt only for risky onesBalanced autonomy with safety
dontAskExecute all actions without confirmation promptsExperienced users, automation
bypassPermissionsFull unrestricted access, no safety checksCI/CD pipelines, trusted scripts

Usage:

bash
claude --permission-mode plan          # Read-only analysis
claude --permission-mode acceptEdits   # Auto-accept edits
claude --permission-mode auto          # Auto-approve safe actions
claude --permission-mode dontAsk       # No confirmation prompts

Headless Mode (Print Mode) ​

Run Claude Code without interactive input for automation and CI/CD using the -p (print) flag.

Usage:

bash
# Run specific task
claude -p "Run all tests"

# Pipe input for analysis
cat error.log | claude -p "explain this error"

# CI/CD integration (GitHub Actions)
- name: AI Code Review
  run: claude -p "Review PR changes and report issues"

# JSON output for scripting
claude -p --output-format json "list all functions in src/"

Scheduled Tasks ​

Run tasks on a repeating schedule using the /loop command.

Usage:

bash
/loop every 30m "Run tests and report failures"
/loop every 2h "Check for dependency updates"
/loop every 1d "Generate daily summary of code changes"

Scheduled tasks run in the background and report results when complete. They are useful for continuous monitoring, periodic checks, and automated maintenance workflows.

Chrome Integration ​

Claude Code can integrate with the Chrome browser for web automation tasks. This enables capabilities like navigating web pages, filling forms, taking screenshots, and extracting data from websites directly within your development workflow.

Session Management ​

Manage multiple work sessions.

Commands:

bash
/resume                # Resume a previous conversation
/rename "Feature"      # Name the current session
/fork                  # Fork into a new session
claude -c              # Continue most recent conversation
claude -r "Feature"    # Resume session by name/ID

Interactive Features ​

Keyboard Shortcuts:

  • Ctrl + R - Search command history
  • Tab - Autocomplete
  • ↑ / ↓ - Command history
  • Ctrl + L - Clear screen

Multi-line Input:

bash
User: \
> Long complex prompt
> spanning multiple lines
> \end

Configuration ​

Complete configuration example:

json
{
  "planning": {
    "autoEnter": true,
    "requireApproval": true
  },
  "extendedThinking": {
    "enabled": true,
    "showThinkingProcess": true
  },
  "permissions": {
    "defaultMode": "manual"
  }
}

There is no settings.json block for background tasks — the feature is controlled by the CLAUDE_CODE_DISABLE_BACKGROUND_TASKS environment variable, and concurrency by CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (default 20).

See: 09-advanced-features/ for comprehensive guide


Models and Reasoning Effort ​

Claude Code supports the following models with adaptive reasoning effort:

ModelContext WindowEffort LevelsDefault Effort (Claude Code)
Claude Opus 5.51M tokens (native)low, medium, high, xhigh, maxmedium — default model and default Opus model since v2.1.280 (requires Claude Code v2.1.280+)
Claude Sonnet 5.51M tokens (native)low, medium, high, xhigh, maxmedium — default Sonnet model on the Anthropic API since v2.1.284 (requires Claude Code v2.1.284+)
Claude Haiku 5.51M tokens (native)low, medium, high, xhigh, maxmedium — default Haiku model on the Anthropic API since v2.1.293 (requires Claude Code v2.1.293+)
Claude Opus 51M tokens (native)low, medium, high, xhigh, maxhigh — default Opus model from v2.1.219 until v2.1.280 (requires Claude Code v2.1.219+)
Claude Sonnet 51M tokens (native)low, medium, high, xhigh, maxhigh — default model for Pro/Team Standard from v2.1.197 until v2.1.280 (now Opus 5.5)
Claude Opus 4.81M tokens (native)low, medium, high, xhigh, maxhigh (since v2.1.154)
Claude Opus 4.7 (legacy)1M tokens (native)low, medium, high, xhigh, maxxhigh (since Opus 4.7 launch, 2026-04-16)
Claude Sonnet 4.61M tokenslow, medium, high, maxhigh for Pro/Max subscribers (raised from medium in v2.1.117)
Claude Haiku 4.5200K tokens— (no effort support)—

Note: xhigh is available on Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7; max works on Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5, Opus 4.8/4.7/4.6 and Sonnet 4.6 (session-only). Haiku 4.5 does not support effort levels.

Note: v2.1.117 fixed a bug where Opus 4.7 sessions computed /context against 200K instead of the native 1M window — upgrade to v2.1.117 or later to actually get the 1M context on Opus 4.7. Opus 5 and Opus 4.8 also have a native 1M-token window.

Note: /cost and /stats merged into /usage in v2.1.118. /usage is now the canonical command with tabs for cost/stats/etc.; /cost and /stats remain as shortcut aliases that open the corresponding tab. As of v2.1.149, the cost view also breaks spending down by category (skills, subagents, plugins, and per-MCP-server costs).

Resources ​


Last Updated: October 10, 2026 Claude Code Version: 2.1.296 Sources: