claude@cli:~/docs$ cat claude-code.md

Claude Code CLI: The Definitive Technical Reference

# Claude Code CLI guide: configuration hierarchy, permission rules, hooks, MCP integrations, subagents, skills, remote execution, and enterprise patterns.

words: 31946 read_time: 160m updated: 2026-02-25 09:15
$ less claude-code.md

Claude Code CLI: The Definitive Technical Reference

TL;DR: Claude Code is an agentic CLI that reads your codebase, executes commands, and modifies files through a layered system of permissions, hooks, MCP integrations, and subagents. Master five core systems (configuration, permissions, hooks, MCP, and subagents) and you unlock force-multiplier productivity. Choose the model tier that fits each task — Opus for complex reasoning, Sonnet for general work, Haiku for fast exploration — or standardize on Opus if quality is your only variable. Use hooks (not prompts) for anything that must always execute.

Claude Code operates as an agentic system, not a chat interface with programming knowledge. The CLI reads your codebase, executes commands, modifies files, manages git workflows, connects to external services via MCP, and delegates complex tasks to specialized subagents. Everything flows through a command-line interface that integrates into how developers actually work.

The difference between casual and effective Claude Code usage comes down to five core systems. Master these and Claude Code becomes a force multiplier:

  1. Configuration hierarchy: controls behavior
  2. Permission system: gates operations
  3. Hook system: enables deterministic automation
  4. MCP protocol: extends capabilities
  5. Subagent system: handles complex multi-step tasks

Key Takeaways

  • Five systems determine your effectiveness: configuration hierarchy, permissions, hooks, MCP, and subagents control everything from behavior to automation.
  • Push work to the Delegation Layer: subagents prevent context bloat by isolating exploration in clean context windows, returning only summaries.
  • Hooks guarantee execution; prompts do not: use hooks for linting, formatting, and security checks that must run every time regardless of model behavior.
  • Model tiering saves cost without sacrificing quality: route subagent exploration to cheaper models and reserve Opus for genuine architectural reasoning — or standardize on Opus if quality is your only variable.
  • MCP connects Claude to your toolchain: databases, GitHub, Sentry, and 3,000+ integrations extend Claude beyond file reading and bash commands.

I spent months pushing Claude Code to its limits across production codebases, CI/CD pipelines, and enterprise deployments. This guide distills that experience into the complete reference I wish existed when I started. Every feature includes actual syntax, real configuration examples, and the edge cases that trip up experienced users.

How to Use This Guide

This is a 5,000+ line reference — you don’t need to read it cover to cover. Start where your experience level fits:

Experience Start Here Then Explore
New to Claude Code How Do I Install?Quick StartMental Model Configuration, Permissions
Daily user Hooks, Subagents, Skills MCP, Plan Mode
Team lead / enterprise Enterprise DeploymentBest Practices Decision Frameworks, Workflow Recipes
Migrating from another tool Audience-Specific Guidance Decision Frameworks

Use your browser’s Ctrl+F / Cmd+F to search for specific flags, commands, or configuration keys. The Quick Reference Card at the end provides a scannable summary of all major commands.


How Claude Code Works: The Mental Model

Before diving into features, understand how Claude Code’s architecture shapes everything you do with it. The system operates in three layers:

┌─────────────────────────────────────────────────────────┐
                    CLAUDE CODE LAYERS                    
├─────────────────────────────────────────────────────────┤
  EXTENSION LAYER                                         
  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐    
     MCP       Hooks     Skills     Plugins     
  └─────────┘  └─────────┘  └─────────┘  └─────────┘    
  External tools, deterministic automation, domain       
  expertise, packaged extensions                          
├─────────────────────────────────────────────────────────┤
  DELEGATION LAYER                                        
  ┌─────────────────────────────────────────────────┐    
                Subagents (up to 10 parallel)           
     Explore | Plan | General-purpose | Custom          
  └─────────────────────────────────────────────────┘    
  Isolated contexts for focused work, returns summaries  
├─────────────────────────────────────────────────────────┤
  CORE LAYER                                              
  ┌─────────────────────────────────────────────────┐    
           Main Conversation Context                    
     Tools: Read, Edit, Bash, Glob, Grep, etc.         
  └─────────────────────────────────────────────────┘    
  Your primary interaction; limited context; costs money 
└─────────────────────────────────────────────────────────┘

Core Layer: Your main conversation. Every message, file read, and tool output consumes context from a shared window (200K tokens standard98, 1M tokens with Opus 4.6 or extended context models). When context fills, Claude loses track of earlier decisions and quality degrades. This layer costs money per token.

Delegation Layer: Subagents spawn with clean contexts, do focused work, and return summaries. The exploration results don’t bloat your main conversation; only the conclusions return. Route subagents to cheaper model tiers for exploration, or use your primary model throughout if quality matters more than cost.

Extension Layer: MCP connects external services (databases, GitHub, Sentry). Hooks guarantee execution of shell commands regardless of model behavior. Skills encode domain expertise that Claude applies automatically. Plugins package all of these for distribution.

The key insight: Most users work entirely in the Core Layer, watching context bloat and costs climb. Power users push exploration and specialized work to the Delegation Layer, keep the Extension Layer configured for their workflow, and use the Core Layer only for orchestration and final decisions.


Table of Contents

  1. How Do I Install Claude Code?
  2. Quick Start: Your First Session
  3. Core Interaction Modes
  4. Configuration System Deep Dive
  5. Which Model Should I Choose?
  6. What Does Claude Code Cost?
  7. Decision Frameworks
  8. How Does the Permission System Work?
  9. How Do Hooks Work?
  10. What Is MCP (Model Context Protocol)?
  11. What Are Subagents?
  12. What Is Extended Thinking Mode?
  13. Output Styles
  14. Slash Commands
  15. How Do Skills Work?
  16. Plugin System
  17. How Does Memory Work?
  18. Image and Multimodal Input
  19. How Does Git Integration Work?
  20. How Do I Use Claude Code in My IDE?
  21. Advanced Usage Patterns
  22. Remote & Background Agents [RESEARCH PREVIEW]
  23. Claude in Chrome
  24. Claude Code in Slack [RESEARCH PREVIEW]
  25. Performance Optimization
  26. How Do I Debug Issues?
  27. Enterprise Deployment
  28. Keyboard Shortcuts Reference
  29. Best Practices
  30. Workflow Recipes
  31. Migration Guide
  32. Audience-Specific Guidance
  33. Quick Reference Card
  34. Changelog
  35. References

How Do I Install Claude Code?

System Requirements

Claude Code runs on macOS 10.15+, Ubuntu 20.04+/Debian 10+, and Windows 10+ through WSL or Git Bash. The system requires 4 GB RAM minimum and an active internet connection.99 Shell compatibility works best with Bash, Zsh, or Fish.

For Windows, both WSL 1 and WSL 2 work. Git Bash also works if you prefer native Windows. Alpine Linux and other musl-based systems require additional packages:

apk add libgcc libstdc++ ripgrep
export USE_BUILTIN_RIPGREP=0

Installation Methods

Native installation (recommended)

The native binary provides the cleanest experience with no Node.js dependency:

# macOS and Linux
curl -fsSL https://claude.ai/install.sh | bash

# Homebrew alternative
brew install --cask claude-code

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

For version-specific installation:

# Install specific version
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58

# Install latest explicitly
curl -fsSL https://claude.ai/install.sh | bash -s latest

# Windows PowerShell - specific version
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58

NPM installation (deprecated)

Note: As of v2.1.15, npm installations show a deprecation notice. The native binary is now the recommended installation method. Migrate with claude install.

For legacy environments where npm is still needed:

npm install -g @anthropic-ai/claude-code

Never use sudo with npm installation. It creates permission issues that complicate everything downstream.

Migration from existing installation

If you have an older npm-based installation, migrate to the native binary:

claude install

Authentication Options

Claude Code supports three authentication paths, each with different tradeoffs:

Claude Console (API billing)

Connect to Anthropic’s API directly through platform.claude.com (previously console.anthropic.com). Create an account, set up billing, and authenticate through the CLI. The Console provides usage-based billing with full API access. A dedicated “Claude Code” workspace is created automatically; you cannot create API keys for this workspace, but you can monitor usage.

Claude Pro or Max subscription

Use your claude.ai account credentials. The subscription covers both the web interface and CLI usage under a single monthly plan. The subscription simplifies billing for individual users who want predictable costs.

Enterprise platforms

AWS Bedrock, Google Vertex AI, and Microsoft Foundry each provide enterprise-grade access with existing cloud billing relationships:

# AWS Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
export AWS_PROFILE=your-profile

# Google Vertex AI
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=us-east5
export ANTHROPIC_VERTEX_PROJECT_ID=your-project

# Microsoft Foundry
export CLAUDE_CODE_USE_FOUNDRY=1
export ANTHROPIC_FOUNDRY_RESOURCE=your-resource-name
# Optional: API key auth (otherwise uses Entra ID)
export ANTHROPIC_FOUNDRY_API_KEY=your-key

For enterprise deployments behind proxies or through LLM gateways:

# Corporate proxy
export HTTPS_PROXY='https://proxy.example.com:8080'

# LLM gateway (skip native auth)
export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_BEDROCK_BASE_URL='https://your-gateway.com/bedrock'
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1

Verification

claude doctor

The command reports installation type, version, system configuration, and any detected issues.

Authentication Management (v2.1.41+)

Manage authentication without entering the REPL:97

claude auth login          # Log in or switch accounts
claude auth status         # Check current auth state (account, plan, expiry)
claude auth logout         # Clear stored credentials

Common workflow for switching between accounts or organizations:

claude auth logout && claude auth login

See also: How Do I Debug Issues? for troubleshooting authentication failures.

Updates

Claude Code auto-updates by default, checking at startup and periodically during sessions. Updates download in the background and apply on next launch.

Disable auto-updates:

export DISABLE_AUTOUPDATER=1

Or in settings.json:

{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}

Manual update:

claude update

Uninstallation

Native installation (macOS/Linux/WSL):

rm -f ~/.local/bin/claude
rm -rf ~/.claude-code

Native installation (Windows PowerShell):

Remove-Item -Path "$env:LOCALAPPDATA\Programs\claude-code" -Recurse -Force
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\WindowsApps\claude.exe" -Force

Clean configuration (removes all settings):

rm -rf ~/.claude
rm ~/.claude.json
rm -rf .claude
rm -f .mcp.json

Quick Start: Your First Session

1. Install and launch:

claude                           # Launch in current directory

2. Navigate to a project:

cd ~/my-project && claude        # Or launch from any git repo

3. Ask Claude to do something:

> "Explain the architecture of this project"
> "Find all TODO comments and create a summary"
> "Add input validation to the signup form"

4. Use key shortcuts during your session:

/cost                            # Check token usage and cost
/compact                         # Free up context when it gets large
Alt+T                            # Toggle extended thinking for hard problems
Ctrl+C                           # Cancel current response

5. Continue later:

claude -c                        # Resume your most recent session
claude --resume                  # Pick from session list

Expert tip: Create a CLAUDE.md file in your project root with build commands, coding conventions, and architecture notes. Claude reads it every session — it’s the single highest-leverage thing you can do for quality.


Core Interaction Modes

Interactive REPL

Launch Claude Code without arguments to enter the interactive read-eval-print loop:

cd your-project
claude

The REPL maintains conversation context across turns. Type queries directly, receive responses, and continue until you exit with /exit or Ctrl+D.

Start with an initial prompt to focus the session:

claude "explain the authentication flow in this project"

Expert tip: The REPL persists state across compaction events. When context grows too large, Claude automatically summarizes older conversation while preserving key decisions and code snippets. You can trigger this manually with /compact or add custom instructions for what to preserve.

Non-Interactive Mode

Print mode (-p) executes a single query and exits:

# Direct query
claude -p "list all TODO comments in this project"

# Process piped input
cat error.log | claude -p "identify the root cause of these failures"

# Chain with other tools
claude -p "generate a README" > README.md

For structured output suitable for parsing in scripts:

claude -p "count lines by file type" --output-format json

The JSON output includes everything you need for automation:

{
  "type": "result",
  "subtype": "success",
  "total_cost_usd": 0.0034,
  "is_error": false,
  "duration_ms": 2847,
  "duration_api_ms": 1923,
  "num_turns": 4,
  "result": "Response text here...",
  "session_id": "abc-123-def"
}

For real-time processing of streaming output:

claude -p "build the application" --output-format stream-json | while read line; do
  echo "$line" | jq -r 'select(.result) | .result'
done

Output format options:

Format Flag Use Case
Text (default) --output-format text Human-readable output, piping to files
JSON --output-format json Script parsing, CI/CD integration
Stream JSON --output-format stream-json Real-time processing, progress monitoring

Exit codes:

Code Meaning
0 Success
1 Error (runtime failure, API error, or Claude reported an error)

Controlling agentic behavior in -p mode:

# Limit autonomous turns (prevents runaway loops)
claude -p "refactor the auth module" --max-turns 10

# Allow specific tools without prompting
claude -p "fix lint errors" --allowedTools "Edit,Bash(npm run lint)"

# Use with a specific model
claude -p "explain this code" --model claude-sonnet-4-5-20250929

CI/CD integration pattern:

# In a GitHub Action or CI pipeline
result=$(claude -p "review this diff for security issues" --output-format json 2>/dev/null)
is_error=$(echo "$result" | jq -r '.is_error')
if [ "$is_error" = "true" ]; then
  echo "Review failed"
  exit 1
fi
echo "$result" | jq -r '.result'

Session Management

Sessions persist conversation history for continuation. Session persistence is essential for complex multi-session work:

# Continue most recent session
claude -c

# Continue with additional prompt
claude -c -p "now add error handling"

# Resume specific session by ID
claude -r "abc123" "implement the remaining tests"

# Fork a session for parallel exploration
claude -r "base-session" --fork-session "try a different approach"

PR-linked sessions (v2.1.27+): Start a session linked to a specific pull request:81

claude --from-pr 123                                    # By PR number
claude --from-pr https://github.com/org/repo/pull/123   # By URL

Sessions also auto-link to PRs when you create them via gh pr create during a session. This makes it easy to resume work on a specific PR later.

Named sessions (Dec 2025): Name and manage sessions for easy recall:

# Name current session
> /rename auth-refactor

# Resume by name or number
> /resume 1                    # Resume first session
> /resume auth-refactor        # Resume by name
claude --resume auth-refactor  # Resume from terminal
claude -r 3                    # Resume by number from terminal

# Fork for parallel exploration
claude --resume auth-refactor --fork-session

Note: --session-id requires a valid UUID (e.g., 550e8400-e29b-41d4-a716-446655440000). For human-readable session naming, use /rename and --resume instead.

Claude Code stores sessions as JSONL transcripts. Agent execution assigns unique agentId values with transcripts stored as agent-{agentId}.jsonl. Resume preserves full context from previous conversations.

Plan Mode

Plan mode restricts Claude to read-only exploration—no file edits, no bash execution, no destructive actions. Claude designs an implementation approach, writes it to a plan file, and waits for your approval before executing anything.

Entering plan mode:

# Cycle through modes during a session
Shift+Tab           # Cycles: normal → plan → auto-accept

# Or ask Claude directly
"Plan how to refactor the auth module"   # Claude may enter plan mode automatically

How it works:

  1. Claude enters plan mode (automatically for complex tasks, or via Shift+Tab)
  2. Explores the codebase using read-only tools: Read, Glob, Grep, WebSearch, WebFetch
  3. Writes a plan to .claude/plans/{session-slug}.md
  4. Exits plan mode with ExitPlanMode, presenting the plan for your review
  5. You approve, request changes, or reject

Available tools in plan mode: Read, Glob, Grep, LS, WebSearch, WebFetch, AskUserQuestion. Editing tools (Edit, Write, Bash, NotebookEdit) are blocked.

After plan approval (v2.1.32+): Claude offers three options: - “Yes, clear context and auto-accept edits” (Shift+Tab) — starts fresh with full context for the plan - “Yes, and manually approve edits” — preserves context, you approve each change - “Yes, auto-accept edits” — preserves context, Claude executes without per-edit approval

Auto-clearing context on approval is the recommended workflow. It gives the plan a fresh context window, which significantly improves plan adherence—Claude stays on track longer without old conversation interfering.

When to use plan mode: - New feature implementations with architectural decisions - Multi-file refactors where you want to review the approach first - Unfamiliar codebases where exploration should precede modification - Any task where multiple valid approaches exist and you want input

Expert tip: The more time you spend in plan mode, the more likely Claude will succeed at implementation. Plan mode is effectively free exploration—no risky tool calls, no wasted edits. Use it liberally.


Configuration System Deep Dive

Claude Code uses a layered configuration system. Understanding the hierarchy is essential because higher levels override lower ones, and enterprise settings cannot be bypassed at all.

Configuration Hierarchy

Level Location Scope Can Override
Enterprise /etc/claude-code/managed-settings.json (Linux) All users No
/Library/Application Support/ClaudeCode/managed-settings.json (macOS)
C:\Program Files\ClaudeCode\managed-settings.json (Windows)
CLI flags Command-line arguments Current session Yes
Local project .claude/settings.local.json Personal, current project Yes
Shared project .claude/settings.json Team via git Yes
User ~/.claude/settings.json All your projects Yes
State ~/.claude.json Runtime state, OAuth, MCP N/A

Expert tip: Use .claude/settings.local.json for personal preferences in shared projects (add it to .gitignore). Use .claude/settings.json for team-wide configuration that gets checked into version control.

Complete settings.json Reference

A full configuration demonstrating all major options:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "model": "claude-sonnet-4-5-20250929",
  "permissions": {
    "allow": [
      "Read",
      "Glob",
      "Grep",
      "Bash(npm run:*)",
      "Bash(git:*)",
      "Bash(make:*)",
      "Edit(src/**)",
      "Write(src/**)",
      "mcp__github"
    ],
    "deny": [
      "Read(.env*)",
      "Read(secrets/**)",
      "Bash(rm -rf:*)",
      "Bash(sudo:*)",
      "Edit(package-lock.json)",
      "Edit(.git/**)"
    ],
    "ask": [
      "WebFetch",
      "Bash(curl:*)",
      "Bash(docker:*)"
    ],
    "additionalDirectories": [
      "../shared-lib",
      "../docs"
    ],
    "defaultMode": "acceptEdits"
  },
  "env": {
    "NODE_ENV": "development",
    "DEBUG": "app:*"
  },
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "npx prettier --write \"$FILE_PATH\""
          }
        ]
      }
    ]
  },
  "sandbox": {
    "enabled": false,
    "autoAllowBashIfSandboxed": true,
    "excludedCommands": ["git", "docker"]
  },
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  },
  "includeCoAuthoredBy": true,
  "cleanupPeriodDays": 30,
  "outputStyle": "Explanatory",
  "language": "en",
  "respectGitignore": true,
  "showTurnDuration": true,
  "plansDirectory": ".claude/plans",
  "spinnerVerbs": ["Thinking", "Processing", "Analyzing"],
  "spinnerTipsOverride": {
    "tips": ["Custom tip 1", "Custom tip 2"],
    "excludeDefault": true
  }
}

Environment Variables Reference

Authentication and API:

ANTHROPIC_API_KEY=sk-ant-...                    # Direct API authentication
ANTHROPIC_AUTH_TOKEN=token                      # Custom authorization header
ANTHROPIC_CUSTOM_HEADERS="X-Key: val"           # Additional request headers

Model configuration:

ANTHROPIC_MODEL=claude-opus-4-6                 # Override default model
ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-6    # Opus 4.6 (Feb 2026)
ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5-20250929
ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5-20251001
CLAUDE_CODE_SUBAGENT_MODEL=sonnet               # Model for subagents
MAX_THINKING_TOKENS=10000                       # Enable extended thinking
CLAUDE_CODE_MAX_OUTPUT_TOKENS=4000              # Limit output length
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1          # Enable agent teams (v2.1.32+)

Cloud provider configuration:

CLAUDE_CODE_USE_BEDROCK=1                       # Use AWS Bedrock
CLAUDE_CODE_USE_VERTEX=1                        # Use Google Vertex AI
CLAUDE_CODE_USE_FOUNDRY=1                       # Use Microsoft Foundry
ANTHROPIC_BEDROCK_BASE_URL=https://...          # Custom Bedrock endpoint
CLAUDE_CODE_SKIP_BEDROCK_AUTH=1                 # Skip Bedrock auth (for gateways)
CLAUDE_CODE_SKIP_VERTEX_AUTH=1                  # Skip Vertex auth
AWS_BEARER_TOKEN_BEDROCK=token                  # Bedrock bearer token
VERTEX_REGION_CLAUDE_3_7_SONNET=us-west1        # Override Vertex region

Behavior control:

DISABLE_AUTOUPDATER=1                           # Prevent automatic updates
DISABLE_TELEMETRY=1                             # Opt out of usage telemetry
DISABLE_ERROR_REPORTING=1                       # Disable Sentry
DISABLE_BUG_COMMAND=1                           # Disable /bug command
DISABLE_COST_WARNINGS=1                         # Hide cost warnings
DISABLE_PROMPT_CACHING=1                        # Disable prompt caching globally
DISABLE_PROMPT_CACHING_SONNET=1                 # Disable for Sonnet only
DISABLE_PROMPT_CACHING_OPUS=1                   # Disable for Opus only
DISABLE_NON_ESSENTIAL_MODEL_CALLS=1             # Skip non-critical API calls

Tool configuration:

BASH_DEFAULT_TIMEOUT_MS=30000                   # Bash command timeout (30s)
BASH_MAX_TIMEOUT_MS=600000                      # Maximum bash timeout (10min)
BASH_MAX_OUTPUT_LENGTH=50000                    # Bash output limit
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1     # Reset CWD after each bash
MCP_TIMEOUT=5000                                # MCP server startup timeout
MCP_TOOL_TIMEOUT=30000                          # MCP tool execution timeout
MAX_MCP_OUTPUT_TOKENS=25000                     # MCP output limit
SLASH_COMMAND_TOOL_CHAR_BUDGET=15000            # Slash command context limit

Network and proxy:

HTTP_PROXY=http://proxy:8080                    # HTTP proxy
HTTPS_PROXY=https://proxy:8080                  # HTTPS proxy
NO_PROXY=localhost,example.com                  # Bypass proxy for domains
CLAUDE_CODE_CLIENT_CERT=/path/to/cert           # mTLS certificate
CLAUDE_CODE_CLIENT_KEY=/path/to/key             # mTLS private key
CLAUDE_CODE_CLIENT_KEY_PASSPHRASE=pass          # mTLS passphrase

UI and terminal:

CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1            # Don't update terminal title
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL=1             # Skip IDE extension install
CLAUDE_CODE_SHELL=/bin/zsh                      # Override shell detection
USE_BUILTIN_RIPGREP=1                           # Use included ripgrep (default)
CLAUDE_CONFIG_DIR=~/.myconfig                   # Custom config directory
IS_DEMO=1                                       # Hide sensitive UI elements[^37]
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1          # Disable background tasks and Ctrl+B[^46]
CLAUDE_CODE_TMPDIR=/path/to/tmp                 # Override temp directory[^50]
CLAUDE_CODE_DISABLE_1M_CONTEXT=1               # Disable 1M context window (use standard 200K)[^103]
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=120000       # Plugin marketplace git timeout (default 120s, was 30s)[^105]

SDK caller identity (v2.1.51+):

CLAUDE_CODE_ACCOUNT_UUID=uuid                  # Provide account UUID synchronously for SDK callers
CLAUDE_CODE_USER_EMAIL=[email protected]        # Provide user email for SDK callers
CLAUDE_CODE_ORGANIZATION_UUID=uuid             # Provide organization UUID for SDK callers

Debugging:

ANTHROPIC_LOG=debug                             # Enable API request logging

Which Model Should I Choose?

Choosing the right model for each task significantly impacts both cost and quality. Claude Code provides flexible model switching at multiple levels.

Available Models

Alias Model Best For Input/1M Output/1M
opus Claude Opus 4.6 Complex reasoning, architecture, long-context work $5.00 $25.00
sonnet Claude Sonnet 4.6 Daily coding, balanced performance $3.00 $15.00
haiku Claude Haiku 4.5 Simple tasks, fast operations $1.00 $5.00
default Account-dependent General purpose Varies Varies
opus[1m] Opus 4.6 with 1M context Massive codebases, long sessions $10.00 $37.50
sonnet[1m] Sonnet 4.6 with 1M context Large codebases $6.00 $22.50
opusplan Opus (plan) + Sonnet (execute) Complex refactoring Hybrid Hybrid

Opus 4.6 (February 5, 2026): The latest flagship model with 1M token context window (beta), 128K max output, adaptive thinking, and agent teams.86 Same pricing as Opus 4.5 ($5/$25 per MTok). Long context (>200K input) costs $10/$37.50 per MTok. Model ID: claude-opus-4-6.1

Sonnet 4.6 (February 17, 2026): The new balanced model replacing Sonnet 4.5 as the default across claude.ai and Claude Cowork.100 Same pricing as Sonnet 4.5 ($3/$15 per MTok). Improved agentic search performance while consuming fewer tokens. Supports extended thinking, adaptive thinking, and a 1M token context window (beta). 64K max output. Knowledge cutoff: August 2025 (reliable), January 2026 (training data). Model ID: claude-sonnet-4-6. Sonnet 4.5 is now a legacy model.100

Why these price differences matter: A typical coding session consumes 50K-200K input tokens and 10K-50K output tokens. With Haiku, that’s $0.10-$0.45 per session. With Opus, the same session costs $0.50-$2.25, 5x more. Reserve Opus for genuinely hard problems.1

When to Use Each Model

Haiku: Use for subagents doing exploration, simple file searches, quick questions. It’s ~5x cheaper than Opus and responds faster. Perfect for background tasks where you don’t need deep reasoning.

Sonnet: The workhorse for daily development. Handles most coding tasks well: implementing features, fixing bugs, writing tests, code review. Use this as your default. Sonnet 4.6 (February 2026) delivers improved agentic search and better token efficiency compared to Sonnet 4.5, with adaptive thinking support and the 1M context window beta.100

Opus: Reserve for genuinely complex reasoning: architectural decisions, tricky debugging, understanding complex systems, security analysis. Opus 4.6 (February 2026) is a significant step up: it plans more carefully, sustains agentic tasks longer, operates more reliably in large codebases, and catches its own mistakes better during code review.86 It features a 1M token context window in beta and introduces adaptive thinking that automatically determines reasoning depth. According to Anthropic, on Terminal-Bench 2.0, Opus 4.6 achieves the highest industry agentic coding score. On GDPval-AA (economically valuable knowledge work), Anthropic reports it outperforms GPT-5.2 by ~144 Elo points.86 Note: Pro subscription users have access to Opus as part of their subscription.20

Opusplan: A hybrid mode that uses Opus for planning (where reasoning quality matters most) and Sonnet for execution (where speed matters). Excellent for complex refactoring where you want the best plan but don’t need Opus-level reasoning for each individual edit.

Switching Models

During session:

> /model opus
> /model sonnet
> /model haiku

At startup:

claude --model opus

Via environment:

export ANTHROPIC_MODEL=opus

In settings.json:

{
  "model": "claude-sonnet-4-5-20250929"
}

For subagents specifically:

export CLAUDE_CODE_SUBAGENT_MODEL=haiku

Extended Context

For large codebases or long sessions, enable 1M token context:

claude --model sonnet[1m]
claude --model opus[1m]           # Opus 4.6 with 1M context (beta)

Or within a session:

> /model sonnet[1m]
> /model opus[1m]

Opus 4.6 is the first Opus-class model with native 1M context support. It achieves 76% accuracy on the 8-needle 1M variant of MRCR v2 (competitors score ~18.5%), making it the strongest model for long-context retrieval.86

Extended context costs more per token (2x input, 1.5x output when >200K input tokens). Use it when you actually need it, not as a default.

Checking Current Model

> /status

The command shows current model, account info, applied settings, and other session state.

Model picker labels (v2.1.51+): The /model picker now shows human-readable labels (e.g., “Sonnet 4.6”) instead of raw model IDs for pinned versions, with upgrade hints when newer versions are available.105

Fast Mode (v2.1.36+)

Fast mode provides significantly faster output from the same model; it does not switch to a cheaper model. Toggle it during a session with /fast.93

> /fast            # Toggle fast mode on/off

Pricing (Opus 4.6 fast mode):

Standard Fast Mode
Input $5/MTok $30/MTok (6x)
Output $25/MTok $150/MTok (6x)

Fast mode pricing applies across the full context window, including requests over 200K input tokens — there is no additional long context surcharge in fast mode.1 Fast mode pricing stacks with prompt caching and data residency multipliers, but NOT with long context pricing. Fast mode is not available with the Batch API.

When to use fast mode: - Iterating rapidly on small changes where latency is the bottleneck - Generating tests, boilerplate, or repetitive code where speed matters more than cost - Working through a list of similar tasks sequentially

When NOT to use fast mode: - Long-running agentic tasks (cost adds up fast at 6x rates) - Background subagent work (nobody’s waiting for the output) - Budget-conscious sessions

Opus 4.6 fast mode now includes the full 1M context window (v2.1.50+). Previously, fast mode was limited to standard context; now you get the same 1M token capacity at fast mode speeds.103

Expert tip: Fast mode pairs well with the opusplan hybrid: use fast mode during the Sonnet execution phase for rapid iteration while keeping standard rates for Opus planning. Note that /fast requires /extra-usage to be enabled first (v2.1.37 fix).93


What Does Claude Code Cost?

Understanding and controlling costs is essential for sustainable Claude Code usage. See also Model Selection for model capabilities and Decision Frameworks for choosing the right model per task.

Viewing Costs

> /cost

Output:

Total cost:            $0.55
Total duration (API):  6m 19.7s
Total duration (wall): 6h 33m 10.2s
Total code changes:    247 lines added, 89 lines removed

Subscription Plans

Plan Price Usage Access
Free $0 Limited No Claude Code access
Pro $20/month 5x Free Claude Code + Opus access20
Max (5x) $100/month 5x Pro Priority access, enhanced performance
Max (20x) $200/month 20x Pro Highest priority, can buy additional usage

Rate limits (August 2025): Anthropic introduced weekly rate limits for paid subscribers. Max subscribers can purchase additional usage beyond the rate limit at standard API rates.21

API Token Pricing (February 2026)186

For API-billed users, per-million-token pricing:

Model Input Output Notes
Haiku 4.5 $1 $5 Speed and efficiency
Sonnet 4.6 $3 $15 Balanced intelligence/cost (replaces Sonnet 4.5)
Opus 4.6 $5 $25 Flagship (same price as Opus 4.5)
Opus 4.5 $5 $25 Previous flagship

Long context pricing (>200K input tokens):

Model Standard Input Long Input Standard Output Long Output
Opus 4.6 $5 $10 $25 $37.50
Sonnet 4.6/4.5/4 $3 $6 $15 $22.50

The 200K threshold is based on total input tokens (including cache reads/writes). When exceeded, Anthropic bills all tokens at the long context rate.1

Data residency pricing: Specifying US-only inference via inference_geo adds a 1.1× multiplier on all token pricing (Opus 4.6+ models only).1

Prompt caching significantly reduces repeated input costs: cache writes cost 1.25× base (5-min cache) or 2× (1-hr cache), but cache reads cost only 0.1×, a 90% savings. For RAG systems and code assistants with repeated context, caching can reduce costs 88-95%.

Batch API offers 50% discounts with 24-hour turnaround for non-urgent tasks like overnight test suites.

Multiple Accounts Policy59

Can you have multiple Claude accounts? Yes, for legitimate use cases. Anthropic explicitly permits multiple accounts when they serve distinct purposes.

What’s allowed:

Scenario Example Status
Household members You and spouse each have Max accounts Allowed
Work + Personal Personal account + employer-managed work account Allowed
Individual + Team Personal Pro/Max alongside organization account Allowed
Same network Multiple accounts from same home WiFi Allowed
Same computer Switching between accounts on one machine Allowed

Technical limits: - Up to 3 accounts can be verified with the same phone number - Multiple paid subscriptions from the same IP/network are explicitly supported - Accounts are completely separate; no chat or project transfer between them

What’s prohibited (per the Usage Policy): - Creating accounts to evade bans after being banned - Coordinating malicious activity across accounts to avoid detection - Using multiple accounts to circumvent rate limits or free tier credits

Real-world note: In January 2026, power user Jeffrey Emanuel (@doodlestein) had 22 Max accounts auto-flagged and temporarily banned. Anthropic employee Thariq (@trq212) resolved it within 4 hours after confirming legitimate use. If you’re using Claude Code extensively for both work and personal projects across multiple accounts, that’s exactly what the service is designed for, but don’t try to game the system.

When in doubt: Contact Anthropic Support to confirm your specific setup in writing.

Cost Factors

Factor Impact Optimization
Model choice Opus >> Sonnet >> Haiku Use Haiku for simple tasks
Input tokens More context = more cost Keep CLAUDE.md focused
Output tokens Longer responses cost more Set MAX_OUTPUT_TOKENS
Thinking tokens Extended thinking adds cost Use only when needed
Prompt caching Reduces repeated input costs Keep enabled (default)

Real-World Cost Examples

Task Model Input Output Cost
Quick file search Haiku 20K 2K $0.03
Bug fix with tests Sonnet 100K 30K $0.75
Architecture review Opus 150K 50K $2.00
Full-day session (Sonnet) Sonnet 500K 150K $3.75
Full-day session (mixed) Haiku+Sonnet 500K 150K ~$2.00

Cost-saving insight: Using Haiku for exploration subagents and Sonnet for implementation typically reduces costs 40-50% compared to using Sonnet for everything.

Team Cost Management

Recommended TPM/RPM by team size:

Team Size TPM per User RPM per User
1-5 200k-300k 5-7
5-20 100k-150k 2.5-3.5
20-50 50k-75k 1.25-1.75
50-100 25k-35k 0.62-0.87
100+ 10k-20k 0.25-0.5

Hidden Tool Fees

Beyond per-token pricing, some tools incur separate charges:16

Tool Fee Notes
Code execution $0.05/session-hour First 1,550 hrs/org/month free. Free when web_search or web_fetch tools are included in the request.40
Web search $10/1,000 searches Token costs still apply. Failed searches are not billed.
Web fetch Free No additional charges beyond standard token costs for fetched content.1
Bash tool +245 input tokens/call Overhead per invocation
Text editor +~700 input tokens/call Typical overhead

These add up in agent loops. A 100-iteration debug cycle with Bash costs ~24,500 extra input tokens in overhead alone.

Cost-Saving Strategies

  1. Use Haiku for subagents: Most exploration doesn’t need Sonnet
  2. Enable prompt caching: Default, but verify it’s not disabled
  3. Set max turns: claude --max-turns 5 prevents runaway conversations
  4. Use plan mode for exploration: No execution = no accidental expensive operations
  5. Compact proactively: Smaller context = fewer tokens
  6. Limit output: export CLAUDE_CODE_MAX_OUTPUT_TOKENS=2000
  7. Batch API for non-urgent work: 50% off both input and output tokens

Monitoring Usage

  • Claude Console: platform.claude.com (requires Admin or Billing role)
  • Workspace limits: Set spending limits per workspace
  • Bedrock/Vertex: Use native cloud cost monitoring
  • LiteLLM: For detailed per-user tracking with third-party providers

Background Token Usage

Some operations consume tokens in the background: - Conversation summarization for /resume - /cost and /status commands - Auto-compaction

Typically under $0.04 per session.

Claude Code Analytics API (Team/Enterprise)53

Programmatically access your organization’s Claude Code usage analytics and productivity metrics via the Admin API.

Endpoint: GET /v1/organizations/usage_report/claude_code

Requirements: - Admin API key (sk-ant-admin...) - Team or Enterprise plan - Admin, Billing, or Developer role

Available Metrics:

Metric Description
num_sessions Distinct Claude Code sessions initiated
lines_of_code.added/removed Total lines of code added/removed
commits_by_claude_code Number of git commits created
pull_requests_by_claude_code Number of PRs created
terminal_type Environment (vscode, iTerm.app, tmux, etc.)
customer_type api (API customers) or subscription (Pro/Team)

Example Request:

curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2026-01-15" \
  -H "x-api-key: sk-ant-admin..." \
  -H "anthropic-version: 2023-06-01"

Use Cases: - Developer productivity analysis (sessions, commits, PRs) - Tool usage metrics (acceptance/rejection rates for Edit, Write, etc.) - Cost tracking and allocation across teams - ROI justification for AI coding tools

Note: Data appears within 1 hour of activity completion. Only data older than 1 hour is included in responses for consistency.


Decision Frameworks

Knowing features exists isn’t enough. You need to know when to use each. These decision trees transform knowledge into action.

Which Model Should I Use?

START  Is the task simple? (file search, quick question, formatting)
         
         ├── YES  Use Haiku
                  Cost: ~$0.03/task
                  Speed: Fastest
         
         └── NO  Does it require deep reasoning?
                  (architecture, complex debugging, security analysis)
                  
                  ├── YES  Use Opus 4.6
                           Cost: ~$2.00/task
                           Quality: Highest (1M context, adaptive thinking)
                  
                  └── NO  Use Sonnet (default)
                           Cost: ~$0.75/task
                           Balance: Best overall

Rule of thumb: Start with Sonnet. Drop to Haiku for subagents. Escalate to Opus 4.6 only when Sonnet’s answer feels shallow. With agent teams (v2.1.32+), Opus can coordinate multiple agents working in parallel on different subtasks.86

Command vs Skill vs Subagent vs Agent Team?

Do you want explicit control over when it runs?

├── YES  Use Slash Command
         Example: /deploy, /test, /security-review
         You invoke it. You control timing.

└── NO  Should the expertise apply automatically based on context?
         
         ├── YES  Use Skill
                  Example: Security patterns, domain rules, code standards
                  Claude recognizes context and applies expertise.
         
         └── NO  Does the work need isolated context?
                  
                  ├── YES  Is there one subtask or many parallel subtasks?
                           
                           ├── ONE  Use Subagent (Task tool)
                                    Example: Deep exploration, parallel analysis
                                    Prevents context bloat in main conversation.
                           
                           └── MANY  Use Agent Team (v2.1.32+)
                                     Example: 5 agents reviewing different modules simultaneously
                                     Opus coordinates; each agent works independently.
                  
                  └── NO  Just prompt directly
                           Not everything needs abstraction.

Hook vs Prompt?

Must the action ALWAYS happen, regardless of Claude's judgment?

├── YES  Use Hook (deterministic)
         Examples:
         - Format code after every edit
         - Log all bash commands
         - Block access to .env files
         Claude cannot skip, forget, or decide otherwise.

└── NO  Use Prompt (probabilistic)
         Examples:
         - "Consider adding tests"
         - "Think about edge cases"
         - "Review for security if relevant"
         Claude decides based on context.

When to Use Extended Thinking?

Is this a genuinely hard problem?

├── Architectural decision with many tradeoffs  YES, use thinking
├── Complex debugging with unclear root cause  YES, use thinking
├── Security analysis requiring careful reasoning  YES, use thinking
├── Understanding unfamiliar codebase  YES, use thinking

├── Routine bug fix  NO, skip thinking
├── Simple refactoring  NO, skip thinking
├── Code formatting  NO, skip thinking
└── Quick questions  NO, skip thinking

Toggle with Alt+T during session. Higher thinking budgets cost more; start with minimum and increase only if responses feel rushed.

Opus 4.6 adaptive thinking: Opus 4.6 automatically adjusts thinking depth based on problem complexity. For most tasks, explicit thinking budget control isn’t necessary — Opus scales up for hard problems and stays fast for simple ones. Manual thinking toggling is most useful with Sonnet when you want to force deeper analysis.

Which Execution Surface?

Where should this work happen?

├── Requires YOUR local files and tools
   
   ├── Interactive, iterative work  Main REPL session
   ├── One-shot scripted task  claude -p "prompt" (print mode)
   ├── CI/CD automation  claude -p --json (non-interactive + structured output)
   └── Parallel isolated tasks  Subagents via Task tool

├── Requires SOMEONE ELSE'S environment
   
   └── Remote codebase or server  Background agent (cloud)

└── Doesn't require any environment
    
    ├── Research or analysis  Subagent with Explore type
    └── Web content extraction  WebFetch / WebSearch tools
Scenario Surface Why
Debug a failing test Main REPL Needs local files, iterative
Triage 20 GitHub issues Background agent Long-running, no local files needed
Review a PR Subagent or --from-pr Isolated context, focused output
Generate changelog claude -p One-shot, scriptable
Lint + test on every commit Hook (PreCommit) Must always run, deterministic
Search for a pattern across repos Subagent (Explore) Prevents context bloat
Apply a migration to staging Background agent Needs remote access
Quick code explanation Main REPL or /fast Interactive, fast response needed
Multi-module refactor Agent team Parallel work across files

Agent Teams vs Subagents vs Parallel Sessions

Do you need multiple agents working on related subtasks?
│
├── YES  Are the subtasks independent (no shared state)?
│         │
│         ├── YES  Can they share the same codebase?
│                  │
│                  ├── YES  Use Agent Team (v2.1.32+)                           Opus coordinates. Agents share repo access.
│                           Example: "Review auth, API, and DB modules in parallel"                  │
│                  └── NO  Use Parallel Sessions (separate terminals)                           Each has its own working directory.
│                           Example: "Fix repo-A and repo-B simultaneously"         │
│         └── NO  Use Sequential Subagents                  Results from one feed into the next.
│                  Example: "Explore → Plan → Implement"
│
└── NO  Use Single Subagent or Main REPL
Approach Max Parallelism Shared Context Coordination Cost
Agent Team 5-10 agents Shared repo, separate contexts Opus orchestrates High (N agents)
Subagents Unlimited (you manage) None (isolated) You orchestrate via prompts Medium per agent
Parallel Sessions Limited by terminals None Manual Medium per session

Which Hook Type?

What kind of automation do you need?
│
├── Run a shell command at a specific event?
│   │
│   └── Use Command Hook       Trigger: PreToolUse, PostToolUse, Notification, Stop, SubagentStop       Example: "Run prettier after every file edit"       Config: hooks.PostToolUse[].command = "prettier --write $FILE"
│
├── Modify Claude's system prompt based on context?
│   │
│   └── Use Prompt Hook (v2.1.35+)
│       Trigger: Same events
│       Example: "Inject project rules when working in /src/auth/"
│       Config: hooks.PreToolUse[].prompt = "When editing auth files..."

└── Have Claude make a judgment call before proceeding?

    └── Use Agent Hook (v2.1.35+)
        Trigger: Same events
        Example: "Evaluate if this bash command is safe before running"
        Config: hooks.PreToolUse[].agent = { prompt: "Is this safe?" }

When to Use /fast?

Is response speed more important than depth right now?

├── YES  Use /fast
         Same Opus 4.6 model, faster output
         Good for: quick questions, simple edits, code explanations,
                   file searches, formatting tasks

└── NO  Stay in normal mode
         Good for: architecture decisions, complex debugging,
                   security reviews, multi-file refactors,
                   anything requiring deep reasoning

/fast toggles fast mode for the current session. It uses the same model (Opus 4.6) with optimized output speed — it does NOT switch to a cheaper model.


How Does the Permission System Work?

Claude Code’s permission system provides fine-grained control over what operations can execute. Understanding it is essential for both security and workflow efficiency. See also Enterprise Deployment for managed settings that enforce permissions organization-wide.

Permission Tiers

Read-only tools (auto-approved): - Read - Read file contents - Glob - Find files by pattern - Grep - Search file contents - WebSearch - Search the web - LSP - Code intelligence (go-to-definition, find references, hover docs)25

LSP Tool capabilities (v2.0.74+): The LSP tool provides IDE-like code intelligence: - Go-to-definition: Jump to where a symbol is defined - Find references: List all usages of a symbol across the codebase - Hover docs: Get type information and documentation for any symbol - Works with TypeScript, Python, Go, Rust, and other languages with LSP support - Requires language server to be available (typically installed with your toolchain)

Modification tools (require approval): - Edit - Modify existing files - Write - Create new files - Bash - Execute shell commands - WebFetch - Fetch URL contents - NotebookEdit - Modify Jupyter notebooks

The first time a modification tool runs, Claude Code prompts for approval. Approvals persist for the session unless explicitly configured otherwise.

Permission Modes

Mode Behavior Use Case
default Prompt on first use of each tool Normal development
acceptEdits Auto-approve file edits, prompt for bash Trusted projects
plan No execution or editing allowed Analysis only
bypassPermissions Skip all prompts CI/CD automation

YOLO Mode (v2.0.68+): For fully autonomous operation, use the --dangerously-skip-permissions flag. The flag says yes to everything: file edits, bash commands, all tool calls. The word “dangerous” is intentional. Use in sandboxed environments or when you fully trust the codebase.61

claude --dangerously-skip-permissions

Set mode via CLI:

claude --permission-mode acceptEdits

Toggle during session:

Shift+Tab  # Cycles through modes

In settings.json:

{
  "permissions": {
    "defaultMode": "acceptEdits"
  }
}

Permission Rules Syntax

Fine-grained rules control specific operations. Rules are evaluated in order: first match wins.

Bash command patterns:

{
  "allow": [
    "Bash(npm run build)",
    "Bash(npm run test:*)",
    "Bash(git commit:*)",
    "Bash(make:*)"
  ],
  "deny": [
    "Bash(rm -rf:*)",
    "Bash(sudo:*)",
    "Bash(curl|wget:*)"
  ]
}

The asterisk provides prefix matching: Bash(npm run test:*) allows npm run test, npm run test:unit, and npm run test:integration.

Important limitation: Bash patterns match prefixes only, not regex. A pattern like Bash(curl http:*) won’t match curl -X GET http://... because the options come before the URL. For reliable blocking, deny the command entirely: Bash(curl:*).

File operation patterns:

{
  "allow": [
    "Edit(src/**)",
    "Write(src/**)",
    "Read(docs/**)"
  ],
  "deny": [
    "Read(.env*)",
    "Read(secrets/**)",
    "Edit(.git/**)",
    "Edit(node_modules/**)"
  ]
}

Path syntax: - Relative paths: Edit(src/**) - relative to working directory - Absolute from settings file: Edit(/build/**) - relative to settings file location - True absolute: Edit(//tmp/**) - starts with // - Home directory: Read(~/.zshrc)

MCP tool patterns:

{
  "allow": [
    "mcp__github",
    "mcp__database__query",
    "mcp__myserver__*"
  ],
  "deny": [
    "mcp__dangerous_server",
    "mcp__untrusted__*"
  ]
}

Use wildcard syntax mcp__server__* to allow or deny all tools from a specific MCP server.39 Wildcard syntax is useful for quickly enabling all tools from trusted servers or blocking entire servers from untrusted sources.

WebFetch patterns:

{
  "allow": [
    "WebFetch(domain:github.com)",
    "WebFetch(domain:api.example.com)"
  ]
}

Additional Directories

Extend Claude’s access beyond the current project:

{
  "permissions": {
    "additionalDirectories": [
      "../shared-lib",
      "../docs",
      "~/reference-projects/design-system"
    ]
  }
}

Additional directories are essential for monorepos or when Claude needs to reference code in sibling directories.

Sandbox Mode

Enable filesystem and network isolation:

> /sandbox

Or configure in settings:

{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true,
    "excludedCommands": ["git", "docker"],
    "network": {
      "allowUnixSockets": ["~/.ssh/agent-socket"],
      "allowLocalBinding": true
    }
  }
}

When sandboxed: - Filesystem access restricted to project directory - Network access controlled - Certain commands excluded from sandbox restrictions - Bash commands auto-allowed if autoAllowBashIfSandboxed is true

Expert tip: Sandbox mode is excellent for running Claude on untrusted codebases. Enable it when exploring unfamiliar projects or when you want an extra layer of protection. Internal Anthropic testing found sandboxing reduces permission prompts by 84%.45 The sandbox uses OS-level primitives (macOS seatbelt, Linux bubblewrap) for filesystem and network isolation, so even a successful prompt injection is fully contained. Anthropic has open-sourced the sandbox runtime for teams building their own agents.89

Security notes (v2.1.34+): Commands excluded from sandboxing via sandbox.excludedCommands or dangerouslyDisableSandbox could previously bypass the Bash ask permission rule when autoAllowBashIfSandboxed was enabled; this was fixed in v2.1.34.94 As of v2.1.38, writes to .claude/skills are blocked in sandbox mode, preventing prompt injection from modifying skill definitions.95


How Do Hooks Work?

Hooks execute deterministic shell commands at specific points in Claude Code’s workflow. Unlike prompting Claude to perform actions, hooks guarantee execution regardless of model behavior. They’re essential for enforcing team standards and automating repetitive tasks. See Decision Frameworks for the “Which Hook Type?” decision tree covering command, prompt, and agent hooks.

Why hooks instead of prompts: Telling Claude “always run Prettier after editing files” works sometimes. But Claude might forget, prioritize speed, or decide the change is “too small.” Hooks guarantee execution: every Edit or Write triggers your formatter, every time, no exceptions. For compliance, security, and team standards, deterministic beats probabilistic.7

Available Events

Event Timing Can Block Purpose
PreToolUse Before tool executes Yes Validate, log, or block operations
PostToolUse After tool completes No Format output, run linters, trigger builds
PostToolUseFailure After tool fails No Log failures, send alerts, provide corrective feedback
UserPromptSubmit User sends prompt Yes Add context, validate input, inject data
Notification Alert triggered No Custom notification handling
Stop Claude finishes response Yes Prevent premature stopping, enforce completion criteria. Includes last_assistant_message (v2.1.47+)
SubagentStart Subagent spawns No Log agent type, inject context via additionalContext
SubagentStop Subagent completes Yes Prevent subagent from stopping, enforce quality gates. Includes last_assistant_message (v2.1.47+)
TeammateIdle Agent team member idles Yes Enforce quality gates before teammate stops (v2.1.33+)
TaskCompleted Task marked complete Yes Enforce completion criteria, run tests (v2.1.33+)
SessionStart Session begins No Environment setup, load context, set env vars
SessionEnd Session closes No Cleanup, final logging
ConfigChange Config file changes during session Yes Audit settings changes, enforce security policies (v2.1.49+)
WorktreeCreate Worktree being created Yes Custom VCS setup (replaces default git behavior) (v2.1.50+)
WorktreeRemove Worktree being removed No Custom VCS cleanup (v2.1.50+)
PreCompact Before context compaction No Validation, logging
PermissionRequest Permission dialog shown Yes Custom approval logic

Hook Configuration

Define hooks in settings.json or a dedicated hooks.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "npx prettier --write \"$FILE_PATH\""
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/validate-bash.sh"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/inject-context.sh"
          }
        ]
      }
    ]
  }
}

Matchers

The matcher field determines which tools trigger a hook:

{"matcher": "*"}              // Match all tools
{"matcher": "Bash"}           // Match Bash only
{"matcher": "Edit|Write"}     // Match Edit or Write
{"matcher": "mcp__github"}    // Match MCP server tools
{"matcher": ""}               // Match for events without tools (like UserPromptSubmit)

Hook Input/Output Protocol

Hooks receive JSON on stdin:

{
  "tool_name": "Bash",
  "tool_input": {
    "command": "npm test",
    "description": "Run test suite"
  },
  "session_id": "abc-123"
}

Stop/SubagentStop hooks (v2.1.47+) receive an additional last_assistant_message field containing Claude’s final response text, so hooks can inspect the output without parsing transcript files:

{
  "session_id": "abc-123",
  "last_assistant_message": "I've completed the refactoring. Here's what changed..."
}

Exit codes control behavior: - 0: Success: operation proceeds. Stdout shown in verbose mode (Ctrl+O). For UserPromptSubmit and SessionStart, stdout is added to context. - 2: Blocking error: operation stops. Stderr becomes the error message fed back to Claude. - 1, 3, etc.: Non-blocking error: operation continues. Stderr shown as warning in verbose mode.

For advanced control, hooks can output JSON:

{
  "decision": "allow",
  "message": "Command validated and modified",
  "modifications": {
    "tool_input": {
      "command": "npm test -- --coverage"
    }
  }
}

PreToolUse decision control (preferred format): PreToolUse hooks use hookSpecificOutput for richer control: three outcomes (allow/deny/ask) plus the ability to modify tool input and inject context:96

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "permissionDecisionReason": "Command validated and modified",
    "updatedInput": {
      "command": "npm test -- --coverage --ci"
    },
    "additionalContext": "Note: This database has a 5-second query timeout."
  }
}
Field Values Description
permissionDecision "allow", "deny", "ask" Allow bypasses permissions, deny blocks, ask prompts user
permissionDecisionReason String Shown to user (allow/ask) or to Claude (deny)
updatedInput Object Modifies tool input before execution
additionalContext String Injected into Claude’s context for that turn51

Note: Top-level decision and reason fields are deprecated for PreToolUse. Use hookSpecificOutput.permissionDecision and hookSpecificOutput.permissionDecisionReason instead. Other events (PostToolUse, Stop, etc.) still use top-level decision.96

Async Hooks (January 2026)

Hooks can now run in the background without blocking Claude Code’s execution. Add async: true to your hook configuration:88

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/notify-slack.sh",
            "async": true
          }
        ]
      }
    ]
  }
}

When to use async hooks: - Notifications (Slack, email, Pushover) that shouldn’t slow down the session - Logging and telemetry that can run in the background - Non-critical post-processing (analytics, backups)

When NOT to use async hooks: - Formatting (must complete before next edit) - Validation (must block on failure) - Any hook that needs to modify tool input/output

Prompt-Based and Agent-Based Hooks (v2.1.32+)

Beyond shell command hooks (type: "command"), Claude Code supports two LLM-powered hook types that evaluate conditions using AI reasoning rather than scripts.96

Prompt hooks (type: "prompt") send a single-turn prompt to a fast Claude model. The model returns { "ok": true } to allow or { "ok": false, "reason": "..." } to block:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "prompt",
            "prompt": "Evaluate if Claude should stop: $ARGUMENTS. Check if all requested tasks are complete and tests pass.",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

Agent hooks (type: "agent") spawn a subagent with tool access (Read, Grep, Glob) for multi-turn verification. Use these when checking requires inspecting actual files or test output:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "agent",
            "prompt": "Verify all unit tests pass. Run the test suite and check results. $ARGUMENTS",
            "timeout": 120
          }
        ]
      }
    ]
  }
}

Use $ARGUMENTS as a placeholder for the hook’s JSON input. Both types support model (defaults to fast model) and timeout fields. Supported events: PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, UserPromptSubmit, Stop, SubagentStop, TaskCompleted. TeammateIdle does not support prompt/agent hooks.

Hook Environment Variables

Hooks have access to environment variables for resolving paths:96

Variable Available In Description
$CLAUDE_PROJECT_DIR All hooks Project root directory (quote for paths with spaces)
${CLAUDE_PLUGIN_ROOT} Plugin hooks Plugin’s root directory
$CLAUDE_ENV_FILE SessionStart only File path for persisting env vars for subsequent Bash commands
$CLAUDE_CODE_REMOTE All hooks Set to "true" in remote web environments

Persist environment variables from SessionStart:

#!/bin/bash
if [ -n "$CLAUDE_ENV_FILE" ]; then
  echo 'export NODE_ENV=production' >> "$CLAUDE_ENV_FILE"
fi
exit 0

HTTP hook security (v2.1.51+): HTTP hooks that interpolate environment variables into headers now require an explicit allowedEnvVars list. This prevents arbitrary environment variable exfiltration through header values. HTTP hooks are also routed through the sandbox network proxy when sandboxing is enabled, enforcing the domain allowlist. HTTP hooks are not supported for SessionStart/Setup events.105

{
  "hooks": {
    "PostToolUse": [{
      "hooks": [{
        "type": "command",
        "command": "curl -H 'Authorization: Bearer $MY_TOKEN' https://api.example.com/notify",
        "allowedEnvVars": ["MY_TOKEN"]
      }]
    }]
  }
}

Hook workspace trust (v2.1.51+): statusLine and fileSuggestion hook commands now require workspace trust acceptance before executing in interactive mode, closing a potential security vector.105

Practical Hook Examples

Auto-format TypeScript files after editing:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "bash -c '[[ \"$FILE_PATH\" == *.ts ]] && npx prettier --write \"$FILE_PATH\" || true'"
          }
        ]
      }
    ]
  }
}

Log all bash commands:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.command' >> ~/.claude/bash-history.log"
          }
        ]
      }
    ]
  }
}

Block access to sensitive files:

#!/bin/bash
# .claude/hooks/protect-files.sh
data=$(cat)
path=$(echo "$data" | jq -r '.tool_input.file_path // empty')

if [[ "$path" == *".env"* ]] || [[ "$path" == *"secrets/"* ]] || [[ "$path" == *".pem"* ]]; then
  echo "Blocked: Cannot access sensitive file $path" >&2
  exit 2  # Exit 2 = block the tool call. Exit 1 = non-blocking error (hook failure only).
fi
exit 0

Run tests after code changes:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "bash -c '[[ \"$FILE_PATH\" == *.test.ts ]] || npm run test:affected'"
          }
        ]
      }
    ]
  }
}

Custom notification system:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "notify-send 'Claude Code' 'Waiting for your input'"
          }
        ]
      }
    ]
  }
}

Inject dynamic context into prompts:

#!/bin/bash
# .claude/hooks/inject-context.sh
# Add current git branch and recent commits to every prompt

branch=$(git branch --show-current 2>/dev/null)
commits=$(git log --oneline -3 2>/dev/null | tr '\n' ' ')

if [ -n "$branch" ]; then
  echo "[Context: Branch '$branch', Recent: $commits]"
fi
exit 0

Hook Debugging

Enable debug mode to troubleshoot hooks:

claude --debug

Debug mode logs: - Hook execution times - Input/output data - Error messages and stack traces - Decision results (allow/reject/ask)

Component-Scoped Hooks (v2.1.0+)

Hooks can be defined directly in Skills, subagents, and slash commands using frontmatter. These hooks are scoped to the component’s lifecycle and only run when that component is active.41

Skill with embedded hooks:

---
name: secure-deployment
description: Deployment skill with security validation
hooks:
  PreToolUse:
    - matcher: Bash
      command: ".claude/hooks/validate-deploy.sh"
  PostToolUse:
    - matcher: Bash
      command: ".claude/hooks/log-deploy.sh"
  Stop:
    - command: ".claude/hooks/cleanup.sh"
      once: true  # Run only once per session
---

Supported events: PreToolUse, PostToolUse, Stop

The once option (skills and slash commands only) ensures the hook runs only once per session, which is useful for cleanup or finalization tasks.

Long-Running Sessions Strategy

For overnight or unattended Claude Code sessions, configure hooks to keep Claude on track without manual intervention. The key insight: use linting and testing hooks as guardrails that force Claude to fix issues before continuing.64

The “Don’t Stop Until Tests Pass” Pattern:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "npm run lint && npm run typecheck",
            "timeout": 60000
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npm test || echo 'Tests failing - Claude should fix before stopping'"
          }
        ]
      }
    ]
  }
}

Strategy for overnight sessions:

  1. Pre-flight check: Use a Setup hook to verify environment is ready
  2. Continuous validation: PostToolUse hooks run tests after each change
  3. Gate completion: Stop hooks verify all acceptance criteria before Claude declares “done”
  4. Notification: Stop hooks can notify you via Slack/Pushover when Claude finishes or gets stuck

Combine with --dangerously-skip-permissions in a sandboxed container for fully autonomous overnight runs. Claude will keep iterating until tests pass or it exhausts its options.

Deep Dive: Why each of 95 production hooks exists, the failures that created them, and the four-layer lifecycle architecture


What Is MCP (Model Context Protocol)?

MCP extends Claude Code with access to external tools, databases, APIs, and services through a standardized protocol. The ecosystem has exploded: MCP now has 100 million monthly downloads and 3,000+ servers indexed on MCP.so (January 2026), cementing its position as the industry standard for connecting AI to tools and data.354 Understanding MCP is essential for integrating Claude into your existing toolchain.

Why MCP matters for developers: Without MCP, Claude Code can only read files and run bash commands. With MCP, Claude can query your production database, create Jira tickets, review GitHub PRs, check Sentry errors, and interact with any API your team uses, all from natural language requests. The protocol standardizes how AI tools connect to external services, preventing vendor lock-in. See Decision Frameworks for guidance on when to use MCP vs other extension mechanisms.

Remote MCP Support (June 2025)

Claude Code now supports remote MCP servers with native OAuth authentication.28 Connect to tools and data sources without managing local servers. Just authenticate once and Claude Code handles token refresh automatically.

# Connect to remote MCP server with OAuth
claude mcp add --transport http linear https://mcp.linear.app/sse
# Browser opens for OAuth flow, tokens stored securely

claude.ai MCP Connectors (v2.1.46+)

Claude Code can now use MCP connectors configured in your claude.ai account. This bridges the gap between web and CLI: MCP servers you’ve set up through the claude.ai interface are automatically available in Claude Code without re-configuring them locally.102

MCP Tool Search (v2.1.7+)

As MCP servers grew in capability (some exposing 50+ tools), tool descriptions began consuming excessive context. MCP Tool Search solves this by dynamically loading tool descriptions only when needed, a form of lazy loading for AI tools.54

Performance impact: Internal benchmarks show dramatic accuracy improvements: - Opus 4: 49% → 74% on MCP evaluations - Opus 4.5: 79.5% → 88.1% on MCP evaluations - Token overhead reduction: 85%

How it works: When MCP tool descriptions exceed 10% of context window (default threshold), Claude Code defers loading full descriptions until they’re actually needed. Claude sees tool names but fetches descriptions on-demand.

Configuration:

{
  "mcpToolSearchAutoEnable": "auto:15"  // Enable when tools exceed 15% of context
}

Values: - true - Always enable tool search - false - Always disable (load all tool descriptions upfront) - auto:N - Enable when tools exceed N% of context (0-100)

Expert tip: With Tool Search enabled, you can connect to many more MCP servers without worrying about context limits. The 95% context reduction means servers that previously competed for context now coexist peacefully.

Interactive MCP Setup Wizard

Run claude mcp add without arguments to launch a step-by-step interface for adding MCP servers. The wizard walks through transport type selection, authentication, and configuration.15

Transport Types

HTTP (recommended for remote servers):

claude mcp add --transport http github https://api.githubcopilot.com/mcp/

# With authentication
claude mcp add --transport http api https://api.example.com/mcp \
  --header "Authorization: Bearer $API_TOKEN"

SSE (deprecated but functional):

claude mcp add --transport sse asana https://mcp.asana.com/sse \
  --header "X-API-Key: your-key"

Stdio (local servers):

# PostgreSQL
claude mcp add --transport stdio postgres \
  --env "DATABASE_URL=postgresql://user:pass@localhost/db" \
  -- npx -y @anthropic-ai/mcp-server-postgres

# Custom server
claude mcp add --transport stdio custom -- python /path/to/server.py --port 8000

Windows requires a cmd wrapper for stdio:

claude mcp add --transport stdio my-server -- cmd /c npx -y @some/package

Scope Management

MCP servers exist at three scopes with clear precedence (local overrides project overrides user):

Scope Storage Visibility Use Case
Local ~/.claude.json (project path) Just you, this project Personal API keys
Project .mcp.json Entire team via git Shared integrations
User ~/.claude.json (root) You, all projects Personal tools

Specify scope during installation:

claude mcp add --scope project --transport http github https://...
claude mcp add --scope user --transport stdio personal-tool -- ./my-tool

Configuration File Format

The .mcp.json file defines project-level servers:

{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "database": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-server-postgres"],
      "env": {
        "DATABASE_URL": "${DATABASE_URL}"
      }
    },
    "sentry": {
      "type": "http",
      "url": "https://mcp.sentry.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${SENTRY_API_KEY}"
      }
    },
    "internal-api": {
      "type": "http",
      "url": "${API_BASE_URL:-https://api.example.com}/mcp",
      "headers": {
        "X-API-Key": "${INTERNAL_API_KEY}"
      }
    }
  }
}

Environment variables expand using ${VAR} syntax with optional defaults: ${VAR:-default}.

MCP Management Commands

claude mcp list                      # View all configured servers
claude mcp get github                # Get specific server details
claude mcp remove github             # Remove a server
claude mcp reset-project-choices     # Reset project-scoped approvals
claude mcp add-from-claude-desktop   # Import from Claude Desktop
claude mcp add-json weather '{"type":"http","url":"..."}'  # Add from JSON

# Within Claude Code REPL
> /mcp                               # Interactive MCP management

OAuth Authentication

For servers requiring OAuth:

> /mcp
# Follow browser-based OAuth flow
# Tokens stored securely and auto-refreshed
# Use "Clear authentication" to revoke access

Using MCP Resources and Prompts

Reference resources:

@github:issue://123
@postgres:schema://users
@docs:file://api/authentication

MCP prompts as slash commands:

/mcp__github__list_prs
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug title" high

Output Limits

Claude Code limits MCP output to prevent context overflow: - Warning threshold: 10,000 tokens - Default maximum: 25,000 tokens

Increase if needed:

export MAX_MCP_OUTPUT_TOKENS=50000
Server Purpose Key Capabilities
GitHub Repository management PRs, issues, CI/CD, code review
PostgreSQL Database access Query, schema inspection, data analysis
Sentry Error monitoring Error lookup, stack traces, deployment correlation
Linear Project management Issues, projects, sprints
Jira/Atlassian Enterprise PM Tickets, boards, workflows
Playwright Web automation E2E testing, accessibility trees
Stripe Payments Transaction lookup, customer data
Cloudflare Infrastructure DNS, workers, analytics
Supabase Backend-as-service Database, auth, storage
Context7 Documentation Real-time, version-specific library docs
Figma Dev Mode Design-to-code Layer hierarchy, auto-layout, tokens42
Sequential Thinking Problem solving Structured reasoning, reflective process43
Magic UI Components React + Tailwind marketing components

Practical MCP Patterns

GitHub workflow:

> Review PR #456
> List all open issues assigned to me
> Create a bug issue for the authentication failure we found

Database queries:

> What's our total revenue this quarter?
> Show the schema for the users table
> Find customers with no purchases in 90 days

Error monitoring:

> What errors occurred in production today?
> Show the stack trace for error ABC123
> Which deployment introduced these errors?

Enterprise MCP Configuration

System administrators can enforce MCP policies via managed-mcp.json:

{
  "allowedMcpServers": [
    { "serverName": "github" },
    { "serverName": "sentry" },
    { "serverCommand": ["npx", "-y", "@approved/server"] }
  ],
  "deniedMcpServers": [
    { "serverName": "dangerous-server" }
  ]
}

Location: - macOS: /Library/Application Support/ClaudeCode/managed-mcp.json - Linux: /etc/claude-code/managed-mcp.json - Windows: C:\ProgramData\ClaudeCode\managed-mcp.json

Denylist takes absolute precedence. Commands must match exactly including argument order.

MCP Apps (January 2026)

Anthropic launched MCP Apps, an extension to the Model Context Protocol that enables interactive tool UIs directly inside the Claude interface.78 MCP Apps let users view, edit, and interact with content from external services without leaving Claude, including Asana, Box, Canva, Figma, Hex, monday.com, and Slack. Any MCP server can supply an interactive UI that renders inside Claude. While MCP Apps currently appear in the claude.ai web interface, the underlying MCP protocol extensions are relevant to Claude Code’s MCP ecosystem as servers adopt the new interactive capabilities.

API Platform: Code Execution Tool v2 (January 2026)

Anthropic launched v2 of the Code Execution Tool in public beta, replacing the original Python-only sandbox with Bash command execution and direct file manipulation.79 Key changes: - Execute Bash commands (not just Python) in sandboxed containers - Write and run code in any language - Programmatic tool calling (also public beta): Claude can call tools from within code execution, reducing latency and token usage in multi-tool workflows

The v2 tool primarily affects API users but signals the direction for Claude Code’s cloud execution capabilities.


What Are Subagents?

Subagents are specialized Claude instances that handle complex tasks independently. They’re one of the most powerful features in Claude Code and one of the least understood. Mastering subagents dramatically expands what you can accomplish. See Decision Frameworks for guidance on Agent Teams vs Subagents vs Parallel Sessions.

Why subagents exist: Claude Code’s main conversation has a single context window. Everything you discuss, every file Claude reads, every tool output: all of it consumes that context. In long sessions, context fills up, Claude loses track of earlier decisions, and performance degrades. Subagents solve this by isolating work: exploration results don’t bloat your main conversation, only the summary returns. Claude can also run up to 10 subagents in parallel, enabling concurrent work that would be impossible sequentially.2

How Subagents Work

When Claude encounters a task that benefits from focused attention (deep exploration, multi-step analysis, specialized work), it can spawn a subagent. The subagent:

  1. Starts with a clean context (no pollution from main conversation)
  2. Has access to specified tools
  3. Operates with a specific model (often cheaper/faster)
  4. Returns results to the main conversation

The architecture prevents context overflow while enabling complex workflows.

Built-In Subagent Types

Explore (fast, read-only): - Model: Haiku (ultra-fast) - Mode: Strictly read-only - Tools: Glob, Grep, Read, and safe bash commands (ls, git status, git log, git diff, find, cat, head, tail) - Thoroughness levels: Quick, Medium, Very thorough - Use for: Codebase exploration, finding files, understanding structure

General-purpose: - Model: Sonnet - Mode: Full read/write - Tools: All available tools - Use for: Complex research + modification tasks

Plan: - Model: Sonnet (or Opus with opusplan) - Mode: Read-only - Tools: Read, Glob, Grep, Bash - Use for: Planning complex implementations before execution

Triggering Subagents

Claude automatically delegates to subagents based on task type. You can also explicitly request them:

> Use the explore agent to find all authentication-related files

> Have a subagent analyze the database schema thoroughly

> Spawn an agent to research how error handling works in this codebase

Expert tip: For complex tasks, explicitly request subagent delegation. “Use an explore agent to find…” prevents context bloat in your main conversation.

Creating Custom Subagents

Define subagents in .claude/agents/ (project) or ~/.claude/agents/ (personal):

---
name: security-reviewer
description: Expert security code reviewer. Use PROACTIVELY after any code changes to authentication, authorization, or data handling.
tools: Read, Grep, Glob, Bash
model: opus
permissionMode: plan
---

You are a senior security engineer reviewing code for vulnerabilities.

When invoked:
1. Identify the files that were recently changed
2. Analyze for OWASP Top 10 vulnerabilities
3. Check for secrets, hardcoded credentials, SQL injection
4. Report findings with severity levels and remediation steps

Focus on actionable security findings, not style issues.

Configuration fields:

Field Required Options Purpose
name Yes Lowercase + hyphens Unique identifier
description Yes Natural language When to invoke (include “PROACTIVELY” to encourage auto-delegation)
tools No Comma-separated Inherits all tools if omitted. Supports Task(agent_type) to restrict spawnable agents
disallowedTools No Comma-separated Tools to deny, removed from inherited or specified list
model No sonnet, opus, haiku, inherit Defaults to inherit (same model as main conversation)
permissionMode No default, acceptEdits, delegate, dontAsk, bypassPermissions, plan Permission handling. delegate restricts to team management tools only
maxTurns No Integer Maximum agentic turns before the subagent stops
memory No user, project, local Persistent memory scope for agent (v2.1.33+)
skills No Comma-separated Auto-load skill content into subagent context at startup
mcpServers No Server names or inline definitions MCP servers available to this subagent
hooks No Hook configuration object Lifecycle hooks scoped to this subagent’s execution
background No true, false Always run as background task (v2.1.49+)
isolation No worktree Run in temporary git worktree for isolated repo copy (v2.1.49+)

Restricting spawnable subagents (v2.1.33+): The tools field supports Task(agent_type) syntax to limit which subagent types an agent can spawn. For example, tools: Read, Grep, Task(Explore) allows the agent to use Read and Grep directly but only delegate to Explore-type subagents. The restriction prevents over-delegation in constrained agents.

CLI-Defined Subagents (v2.1.32+)

Define subagents as JSON at launch for quick testing or automation. These exist only for the session and aren’t saved to disk:96

claude --agents '{
  "code-reviewer": {
    "description": "Expert code reviewer. Use proactively after code changes.",
    "prompt": "You are a senior code reviewer. Focus on code quality and security.",
    "tools": ["Read", "Grep", "Glob", "Bash"],
    "model": "sonnet"
  }
}'

The --agents flag accepts JSON with the same frontmatter fields as file-based subagents: description, prompt, tools, disallowedTools, model, permissionMode, mcpServers, hooks, maxTurns, skills, and memory.

Managing Subagents

> /agents                    # Interactive management
> /agents create             # Create new subagent
> /agents edit               # Modify existing
> /agents delete             # Remove subagent
> /agents list               # View all

CLI listing (v2.1.50+): List all configured agents from the command line without starting an interactive session:

claude agents                # Shows agents grouped by source (built-in, user, project, plugin)

Remote control (v2.1.51+): The claude remote-control subcommand serves your local environment for external builds, enabling all users to access local-environment capabilities remotely:105

claude remote-control        # Start serving local environment for external builds

Running Agents in Background

For long-running tasks:

> Run a thorough security review in the background

> /agents  # Check status of running agents

Retrieve results later with the agent ID.

Advanced Patterns

Chained subagents:

> First use the code-analyzer subagent to find performance issues, then use the optimizer subagent to fix them

Parallel exploration:

> Have three explore agents search in parallel:
> 1. Authentication code
> 2. Database models
> 3. API routes

Resumable agents: Agents can be resumed with their ID to continue previous work:

> Resume agent abc123 and continue the analysis

Async Subagents (December 2025)

Asynchronous subagents enable multitasking and parallel execution for large-scale projects:

> Run security review in the background while I continue frontend work
> /tasks                    # Check status of running agents

Async agents return results via the unified TaskOutputTool, enabling efficient pipeline-style workflows.

Permission Denial Resilience (v2.1.0+)

Starting in v2.1.0, subagents continue working after permission denials instead of stopping entirely. When a subagent hits a permissions wall, it tries alternative approaches automatically. The change makes autonomous workflows more resilient and reduces the need for human intervention.47

Agent Teams (February 2026, Research Preview)

Agent Teams coordinate multiple Claude Code instances working together. One session acts as the team lead, spawning teammates that work independently in their own context windows, communicating directly with each other via a shared mailbox and task list.8691

Unlike subagents (which run within a single session and only report back to the caller), teammates are full independent sessions that can message each other, challenge each other’s findings, and self-coordinate.

Enable:

// settings.json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

Or via environment: export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Architecture:

Component Role
Team lead Main session that creates the team, spawns teammates, coordinates work
Teammates Separate Claude Code instances working on assigned tasks
Task list Shared work items that teammates claim and complete (file-locked)
Mailbox Messaging system for inter-agent communication

Display modes:

Mode How Best For
in-process (default) All teammates in main terminal. Shift+Up/Down to select. Any terminal
tmux / iTerm2 Each teammate in its own split pane Visual monitoring

Configure in settings: "teammateMode": "in-process" or "tmux". Or per-session: claude --teammate-mode in-process.

Key controls: - Shift+Down: Cycle through teammates (in-process mode; wraps back to lead after last teammate) - Shift+Tab: Enable delegate mode (restricts lead to coordination only, no code changes) - Ctrl+T: Toggle shared task list - Enter on teammate: View their session; Escape to interrupt their turn

When to use agent teams vs subagents:

Subagents Agent Teams
Communication Report results back only Teammates message each other directly
Coordination Main agent manages all work Shared task list with self-coordination
Best for Focused tasks where only result matters Complex work requiring discussion and collaboration
Token cost Lower Higher (each teammate = separate context window)

Best use cases: - Research and review (multiple perspectives simultaneously) - New modules/features (teammates each own separate pieces) - Debugging with competing hypotheses (test different theories in parallel) - Cross-layer coordination (frontend, backend, tests each owned by different teammate)

Plan approval for teammates: For complex or risky tasks, require teammates to plan before implementing. The teammate works in read-only plan mode until the lead reviews and approves their approach:

Spawn an architect teammate to refactor the authentication module.
Require plan approval before they make any changes.

The lead makes approval decisions autonomously. Influence its judgment with criteria: “only approve plans that include test coverage” or “reject plans that modify the database schema.”

Example prompts:

Create an agent team to review PR #142. Spawn three reviewers:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Spawn a team with 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.

Storage: Team configs live at ~/.claude/teams/{team-name}/config.json (members array with name, agent ID, agent type). Task lists at ~/.claude/tasks/{team-name}/. Tasks support dependencies: blocked tasks unblock automatically when their dependencies complete.91

Hook integration: Use TeammateIdle (exit code 2 to send feedback and keep teammate working) and TaskCompleted (exit code 2 to prevent completion) hooks to enforce quality gates on teammates.

Limitations (experimental): - No session resumption for in-process teammates (/resume won’t restore them) - One team per session; no nested teams - Teammates can’t spawn their own teams - Split panes require tmux or iTerm2 (not supported in VS Code terminal, Windows Terminal, or Ghostty) - All teammates start with the lead’s permission mode - Token-intensive: each teammate is a separate Claude instance

Agent Skills (December 2025)

Agent Skills are organized folders of instructions, scripts, and resources that agents discover and load dynamically.31 They provide composable, portable domain expertise:

.claude/skills/
├── security-review/
   ├── skill.md           # Instructions and prompts
   ├── checklist.md       # Security checklist
   └── common-vulns.sh    # Detection scripts
└── performance-audit/
    ├── skill.md
    └── profiling-guide.md

Skills differ from commands: commands are explicitly invoked, while skills auto-activate based on task context. The Claude Agent SDK (renamed from Claude Code SDK) provides the framework for building custom agents with skill support.32


What Is Extended Thinking Mode?

Extended thinking gives Claude more time to reason through complex problems before responding. It’s particularly valuable for architectural decisions, debugging tricky issues, and tasks requiring careful analysis.

Current State (January 2026)

Extended thinking is now enabled by default with a budget of 31,999 tokens, the maximum budget that was previously triggered by “ultrathink.”70 Anthropic made this change because extended thinking significantly improves performance on complex planning and reasoning tasks.

Important: Natural language triggers like “think”, “think hard”, “think harder”, and “ultrathink” no longer work. Claude now interprets these keywords as regular prompt instructions and does not allocate thinking tokens. The thinking budget is controlled exclusively by the MAX_THINKING_TOKENS environment variable or via /config.70

Supported Models

  • Claude Opus 4.6 (also supports adaptive thinking, which automatically determines reasoning depth)
  • Claude Sonnet 4.6 (also supports adaptive thinking)
  • Claude Opus 4.5
  • Claude Sonnet 4.5
  • Claude Haiku 4.5

Controlling Extended Thinking

Quick toggle during session:

Press Alt+T to toggle thinking on/off

Note: Anthropic changed the thinking toggle from Tab to Alt+T to avoid accidental triggers.39

Via /config: Navigate to /config → Extended Thinking to enable/disable or adjust budget.

Environment variable (permanent):

# Set custom budget (default is 31,999)
export MAX_THINKING_TOKENS=8000
claude

# Double the default for complex tasks
export MAX_THINKING_TOKENS=63999
claude

Disable for cost savings: For simpler tasks where deep reasoning isn’t needed, you can reduce costs by disabling thinking in /config or lowering the budget:

export MAX_THINKING_TOKENS=8000  # Reduce from default 31,999

Thinking Token Budgets

Budget Use Case
1,024 (minimum) Simple reasoning tasks
8,000 Most coding tasks (cost-efficient)
31,999 (default) Complex reasoning, architecture decisions
63,999 (2× default) Exhaustive analysis (requires explicit setting)

Cost consideration: Anthropic bills thinking tokens as output tokens. The default 31,999 budget works well for most tasks, but for simple operations you can save costs by reducing the budget or disabling thinking entirely.

How It Works

When thinking is enabled, Claude performs internal reasoning that influences the answer but does not appear in the output. Claude Code encrypts the thinking and returns it in a signature field for verification.

In multi-turn conversations with tool use, thinking blocks must be passed back to the API to preserve reasoning continuity. Claude Code handles this automatically.

When to Consider Disabling/Reducing

Extended thinking is now the default, but consider reducing the budget or disabling for: - Simple file edits - Routine refactoring - Quick questions - Code formatting - High-volume operations where costs add up

Cache Behavior

Claude Code preserves system prompt caching when thinking parameters change. Changing the thinking budget or enabled status between turns invalidates message caching.


Output Styles

Output styles customize how Claude presents information, which is useful for learning, documentation, or specific team preferences.19

Built-In Styles

Style Purpose
Explanatory Detailed explanations with reasoning
Learning Educational format with concepts explained
Concise Minimal output, just essentials

Setting Output Style

> /output-style Explanatory
> /output-style Learning

Or via settings:

{
  "outputStyle": "Explanatory"
}

Custom Output Styles

Create in .claude/styles/:

# my-style

## Instructions
- Always explain the WHY behind each decision
- Include relevant documentation links
- Format code examples with comments
- End with a "What to do next" section

## Format
Use markdown headers for organization.
Keep explanations under 200 words per section.

Invoke with /output-style my-style.


Slash Commands

Slash commands provide quick access to Claude Code features and enable custom workflows. They’re faster than typing out full prompts for common operations.

Built-In Command Reference

Command Purpose Notes
/init Initialize project with CLAUDE.md Creates memory file with project structure
/memory Edit memory files Opens CLAUDE.md editor
/context View context window usage Shows visual breakdown
/compact Condense conversation history Add focus: /compact focus on tests
/cost Display token usage and cost Session breakdown
/usage Display current plan usage VSCode only (v2.1.14+)
/stats Usage statistics Favorite model, usage graph, streak
/permissions Manage permission settings Interactive interface
/mcp Configure MCP servers Also /mcp enable, /mcp disable
/hooks View hook configuration Debug hooks
/config Open settings interface Full configuration
/resume Resume named session /resume <n> or /resume session-name
/rename Name current session /rename feature-auth
/fork Branch conversation Explore alternatives without losing context
/clear Clear conversation history Fresh start
/vim Enable vim editing mode Modal editing
/ide Connect to IDE VS Code/JetBrains integration
/sandbox Enable sandbox mode Isolation
/status View session status Model, settings, etc.
/statusline Customize status line Configure display
/model Change AI model /model opus
/fast Toggle fast mode Same model, faster output (v2.1.36+)
/output-style Set output style Explanatory, Learning, custom
/agents Manage subagents Create, edit, delete
/bashes List background tasks Long-running commands
/tasks List background agents Monitor async tasks
/export Export conversation Save transcript
/add-dir Add working directories Expand access
/terminal-setup Configure terminal Kitty, Alacritty, Zed, Warp support25
/login Authenticate in session Switch accounts or re-auth
/logout Sign out in session Clear credentials
/doctor Check installation Health check
/bug Report bugs File issue with Anthropic
/release-notes View release notes Check what’s new
/rewind Return to checkpoint Undo changes (or Esc×2)
/theme Manage themes Ctrl+T toggles syntax highlighting
/plugin Manage plugins Install, update, remove plugins
/passes Guest passes (Max only) Share 3 Claude Code Pro trial passes62

Custom Command Creation

Create reusable commands in .claude/commands/ (project) or ~/.claude/commands/ (personal):

---
description: Security-focused code review
allowed-tools: Read, Grep, Glob
model: claude-sonnet-4-5
---

Review this code for security vulnerabilities:

1. Injection attacks (SQL, command, XSS)
2. Authentication and authorization flaws
3. Sensitive data exposure
4. Insecure dependencies

Focus on actionable findings with specific line references.

Save as .claude/commands/security-review.md, invoke with /security-review.

Command Frontmatter Options

---
description: Brief description for /help
allowed-tools: Read, Edit, Bash(npm:*)
model: opus
argument-hint: [arg1] [arg2]
disable-model-invocation: false
---
Option Purpose
description Help text and auto-delegation matching
allowed-tools Restrict available tools
model Override model for this command
argument-hint Document expected arguments
disable-model-invocation Prevent SlashCommand tool usage

Argument Interpolation

All arguments as single string:

---
description: Fix GitHub issue
argument-hint: [issue-number]
---

Fix GitHub issue #$ARGUMENTS following our coding standards.

Usage: /fix-issue 123

Numbered arguments:

---
description: Create component
argument-hint: [name] [type]
---

Create a new $2 component named $1 in src/components/.

Usage: /create-component Button functional

Inline Bash Execution

Execute bash commands within command prompts:

---
description: Git status summary
allowed-tools: Bash(git:*)
---

Current branch: !`git branch --show-current`
Recent commits: !`git log --oneline -5`
Changed files: !`git status --short`

Summarize the current state of this repository.

File References

Include file contents in commands:

---
description: Compare implementations
---

Compare these files:
@src/v1/handler.ts
@src/v2/handler.ts

Which implementation is more maintainable?

Command Namespacing

Organize commands in subdirectories:

.claude/commands/
├── backend/
   ├── test.md
   └── deploy.md
├── frontend/
   ├── test.md
   └── build.md
└── review.md

Commands with the same name show their namespace in help: /test (project:backend) vs /test (project:frontend).


How Do Skills Work?

Skills represent a fundamentally different approach to extending Claude Code. Unlike slash commands that you invoke explicitly, skills are model-invoked—Claude automatically discovers and uses them based on context. You embed domain expertise into a skill, and Claude draws on that expertise whenever the situation calls for it, without you needing to remember to ask.

Why skills change everything: Consider domain expertise: the payment processing rules, the compliance requirements, the architectural patterns your team has refined over years. Without skills, you either re-explain this context every session or hope Claude infers it from code comments. With skills, you encode it once. Claude reads the skill definition and applies that expertise automatically whenever relevant. Your junior developers get senior-level guidance without asking. Your security patterns get enforced without remembering to invoke them.

The distinction matters. A slash command is a shortcut you remember to use. A skill is knowledge Claude always has available. When you create a security review skill with your team’s specific vulnerability patterns and compliance requirements, Claude applies that expertise whenever it encounters relevant code, whether during PR reviews, refactoring, or any task where security matters. You don’t invoke /security-review; Claude recognizes the context and applies the skill automatically.

Skills vs Commands vs Subagents

Understanding when to use each extension mechanism prevents duplication and maximizes effectiveness:

Aspect Slash Commands Skills Subagents
Invocation User-invoked (/command) Model-invoked (automatic) Explicit or auto-delegated
Trigger You remember to use it Claude recognizes context Task requires delegation
Structure Single markdown file Directory with resources Markdown with frontmatter
Context Main conversation Main conversation Separate context window
Complexity Simple prompts Multi-file capabilities Full agent personality
Best for Explicit actions Domain expertise Complex task delegation

Use slash commands when you want explicit control: /deploy, /test, /review PR 456. You decide when to run them.

Use skills when expertise activates automatically: security patterns, code style enforcement, domain-specific knowledge. Claude decides when to apply them.

Use subagents when tasks need isolation: background exploration, parallel analysis, specialized reasoning that shouldn’t pollute your main conversation.

Skill Structure and Location

Skills live in dedicated directories containing a required SKILL.md file plus optional supporting resources:

Personal skills (available across all your projects):

~/.claude/skills/
├── code-reviewer/
│   ├── SKILL.md
│   ├── SECURITY_PATTERNS.md
│   └── PERFORMANCE_CHECKLIST.md
├── sql-analyst/
│   ├── SKILL.md
│   └── QUERY_PATTERNS.md
└── api-designer/
    └── SKILL.md

Project skills (shared with team via git):

.claude/skills/
├── domain-expert/
   ├── SKILL.md
   ├── BUSINESS_RULES.md
   └── DATA_MODELS.md
└── deployment/
    ├── SKILL.md
    └── RUNBOOKS.md

Project skills commit to version control. When teammates pull, they get your skills automatically, with no installation, no configuration. Automatic distribution standardizes expertise across a team.

SKILL.md Format

Every skill requires a SKILL.md file with YAML frontmatter:

---
name: code-reviewer
description: Review code for security vulnerabilities, performance issues, and best practice violations. Use when examining code changes, reviewing PRs, analyzing code quality, or when asked to review or audit code.
allowed-tools: Read, Grep, Glob
---

# Code Review Expertise

## Security Analysis

When reviewing code, check for:

### Input Validation
- All user input sanitized before use
- Parameterized queries for database operations
- Output encoding for rendered content

### Authentication & Authorization
- Session tokens properly validated
- Permission checks before sensitive operations
- No hardcoded credentials or API keys

### Data Exposure
- Sensitive data not logged
- PII properly masked in error messages
- API responses don't leak internal details

## Performance Patterns

### Database
- N+1 query detection
- Missing indexes on filtered columns
- Unbounded result sets

### Memory
- Large object lifecycle management
- Stream processing for big files
- Connection pool exhaustion risks

## Review Output Format

For each finding:
- **File**: path/to/file.ts:123
- **Severity**: Critical | High | Medium | Low
- **Category**: Security | Performance | Maintainability
- **Issue**: Clear description of the problem
- **Recommendation**: Specific fix with code example
- **Rationale**: Why this matters

See [SECURITY_PATTERNS.md](SECURITY_PATTERNS.md) for detailed vulnerability patterns.
See [PERFORMANCE_CHECKLIST.md](PERFORMANCE_CHECKLIST.md) for optimization guidelines.

Frontmatter Reference

Field Required Constraints Purpose
name Yes Lowercase, numbers, hyphens; max 64 chars Unique identifier
description Yes Max 1024 chars Discovery trigger: Claude uses this to decide when to apply the skill
allowed-tools No Comma-separated tool names Restrict Claude’s capabilities when using this skill
context No fork Run skill in isolated context (v2.1.0+). Prevents side effects on main agent state.47

String Substitutions (v2.1.9+): Skills can access session context using ${CLAUDE_SESSION_ID} substitution. Useful for logging, tracking, or generating session-specific outputs.51

The description field is critical. Claude discovers skills by matching your requests against skill descriptions. A vague description means Claude won’t recognize when to use the skill. A specific description with clear trigger conditions means reliable activation.

Poor description:

description: Helps with code

Effective description:

description: Review code for security vulnerabilities, performance issues, and best practice violations. Use when examining code changes, reviewing PRs, analyzing code quality, or when asked to review, audit, or check code.

The effective description includes: - What the skill does (review code for specific issues) - When to use it (examining changes, PRs, quality analysis) - Trigger phrases (review, audit, check)

Tool Restrictions

The allowed-tools field limits what Claude can do when a skill is active. Tool restrictions are essential for read-only or scope-limited skills:

---
name: security-auditor
description: Audit code for security vulnerabilities without making changes
allowed-tools: Read, Grep, Glob
---

With this configuration, Claude can analyze code but cannot edit files, run bash commands, or make modifications. The skill enforces read-only behavior.

Common restriction patterns:

Pattern Tools Use Case
Read-only analysis Read, Grep, Glob Security audits, code review
Safe exploration Read, Grep, Glob, Bash(git log:*), Bash(git diff:*) Historical analysis
Documentation Read, Grep, Glob, Write Generate docs without editing source
Full access (omit field) Skill inherits all available tools

Supporting Files

Skills can include multiple files. Claude reads the main SKILL.md on activation, then accesses supporting files as needed, providing progressive disclosure that manages context efficiently.

Structure pattern:

my-skill/
├── SKILL.md           # Required: overview + quick reference
├── DETAILED_GUIDE.md  # Deep documentation
├── EXAMPLES.md        # Concrete examples
├── PATTERNS.md        # Reference patterns
├── templates/         # Reusable templates
│   └── component.tsx
└── scripts/           # Helper utilities
    └── validate.py

Reference supporting files from SKILL.md:

For detailed security patterns, see [SECURITY_PATTERNS.md](SECURITY_PATTERNS.md).

Use this template for new components:
@templates/component.tsx

Validate configurations with:
```bash
python scripts/validate.py config.json
**Expert tip:** Put essential information in SKILL.md directly. Reserve supporting files for deep reference material. Claude reads SKILL.md immediately but only accesses supporting files when needed. If critical information is buried in a supporting file, Claude might not find it.

### Complete Example: Domain Expert Skill

Here's a production-quality skill for a fintech application:

**Directory structure:**

.claude/skills/payments-domain/ ├── SKILL.md ├── BUSINESS_RULES.md ├── COMPLIANCE.md └── DATA_MODELS.md

**SKILL.md:**
```markdown
---
name: payments-domain
description: Expert knowledge of payment processing domain including transaction flows, compliance requirements, and business rules. Use when working with payment code, transaction handling, refunds, disputes, or financial calculations.
---

# Payments Domain Expertise

## Core Concepts

### Transaction States

PENDING → AUTHORIZED → CAPTURED → SETTLED ↘ VOIDED AUTHORIZED → DECLINED CAPTURED → REFUNDED (partial or full) SETTLED → CHARGEBACK → REPRESENTED

### Money Handling Rules
- ALL monetary values stored as integers (cents, not dollars)
- Currency always explicitly tracked (never assume USD)
- Rounding: HALF_EVEN for calculations, HALF_UP for display
- Never use floating point for money

### Idempotency Requirements
Every payment operation MUST be idempotent:
```typescript
// Required pattern
async function processPayment(idempotencyKey: string, amount: number) {
  const existing = await findByIdempotencyKey(idempotencyKey);
  if (existing) return existing; // Return cached result

  const result = await executePayment(amount);
  await storeWithIdempotencyKey(idempotencyKey, result);
  return result;
}

Quick Reference

Fee Calculations

  • Interchange: 1.5% + $0.10 (debit), 2.1% + $0.10 (credit)
  • Platform fee: 2.9% + $0.30 (standard), 2.2% + $0.30 (enterprise)
  • International: +1% cross-border fee
  • Currency conversion: mid-market rate + 1%

Compliance Thresholds

  • $3,000: Enhanced due diligence trigger
  • $10,000: CTR filing required
  • $25,000: Additional verification required

Refund Windows

  • Full refund: 120 days from capture
  • Partial refund: 180 days from capture
  • Chargeback window: 120 days (Visa), 180 days (Mastercard)

Key Files

  • src/payments/processor.ts - Core payment logic
  • src/payments/refunds.ts - Refund handling
  • src/compliance/aml.ts - AML checks
  • src/models/transaction.ts - Transaction model

See BUSINESS_RULES.md for detailed business logic. See COMPLIANCE.md for regulatory requirements. See DATA_MODELS.md for schema documentation.

With this skill in place, Claude automatically applies payments domain expertise when you work on transaction code, ask about refund logic, or debug payment flows. You don't invoke anything; the expertise is just there.

### Creating Effective Skills

**Start with the description.** Write the description first, then build the skill content to match. The description determines when Claude uses the skill, so get it right:

1. State what the skill provides
2. List specific trigger conditions
3. Include relevant keywords and phrases

**Keep skills focused.** One skill covers one domain or capability:

| Good (focused) | Bad (too broad) |
|----------------|-----------------|
| `security-auditor` | `code-helper` |
| `react-patterns` | `frontend-stuff` |
| `postgres-optimization` | `database-expert` |
| `api-documentation` | `docs-generator` |

If a skill tries to cover too much, its description becomes vague, and Claude won't reliably recognize when to use it.

**Use progressive disclosure.** Put the most important information in SKILL.md directly. Reference supporting files for depth:

```markdown
## Quick Reference
[Essential patterns here - Claude sees this immediately]

## Deep Dive
For full coverage, see [DETAILED_GUIDE.md](DETAILED_GUIDE.md).

Include concrete examples. Abstract descriptions are less useful than concrete patterns:

## Input Validation

### Pattern
```typescript
// Good: Explicit validation with typed errors
const validated = PaymentSchema.safeParse(input);
if (!validated.success) {
  throw new ValidationError(validated.error.issues);
}

// Bad: Implicit coercion
const amount = Number(input.amount); // Silent NaN on invalid input
**Test with realistic requests.** After creating a skill, test whether Claude activates it:

Review this payment processing code for issues

Should activate payments-domain skill

How should I handle refunds?

Should activate payments-domain skill

What’s the weather like?

Should NOT activate payments-domain skill

If Claude doesn't activate the skill when expected, revise the description to include the trigger phrases you're using.

### Team Sharing Strategies

**Git-based sharing (recommended for project skills):**
```bash
# Add skill to project
mkdir -p .claude/skills/team-standard
# Create SKILL.md and supporting files

# Commit
git add .claude/skills/
git commit -m "Add team coding standards skill"
git push

# Teammates get it automatically
git pull
claude  # Skill now available

Cross-project sharing via symlinks:

# Create canonical skill location
mkdir -p ~/shared-skills/security-reviewer
# Create SKILL.md

# Symlink into projects
ln -s ~/shared-skills/security-reviewer ~/.claude/skills/security-reviewer
# Now available in all your projects

Plugin distribution: For broader distribution, package skills into plugins:

my-plugin/
├── .claude-plugin/
│   └── plugin.json
└── skills/
    └── my-skill/
        └── SKILL.md

Skills bundled in plugins become available when users install the plugin.

Debugging Skills

Skill not activating:

  1. Check the description matches your request: yaml # If you're saying "check this code" but description says "review" description: Review OR check code for issues...

  2. Verify file location: ```bash # Personal ls ~/.claude/skills/my-skill/SKILL.md

# Project ls .claude/skills/my-skill/SKILL.md ```

  1. Validate YAML frontmatter:
  2. First line must be exactly ---
  3. Closing --- before markdown content
  4. No tabs in YAML (use spaces)
  5. Name field is lowercase with hyphens only

  6. Run in debug mode: bash claude --debug # Watch for skill loading messages

Skill activating unexpectedly:

Narrow the description. If your skill activates when it shouldn’t, the description is too broad:

# Too broad - activates on any "code" mention
description: Help with code

# Specific - activates only for security contexts
description: Audit code for security vulnerabilities including injection attacks, authentication flaws, and data exposure. Use when specifically asked about security, vulnerabilities, or when reviewing code for security issues.

Supporting files not found:

  • Use relative paths from SKILL.md location
  • Forward slashes only (even on Windows)
  • Check file actually exists: ls .claude/skills/my-skill/REFERENCED.md

When to Create a Skill

Create a skill when: - Domain expertise activates automatically - Multiple team members need the same knowledge - You’re repeatedly explaining the same patterns or rules - Context injects without explicit invocation - Knowledge spans multiple files and needs organization

Don’t create a skill when: - You want explicit control over invocation (use slash command) - The task needs separate context (use subagent) - It’s a one-off prompt (just type it) - The “skill” is really just a single template (use slash command)

Expert tip: If you find yourself repeatedly typing /security-review before working on auth code, convert it to a skill. Make the expertise ambient, not explicitly invoked. If you want explicit invocation, keep it as a command.

Deep Dive: Build a code review skill from scratch — from identifying repeated context to reliable auto-activation


Plugin System

Plugins package Claude Code extensions for distribution. A plugin can include custom commands, subagents, skills, hooks, and MCP servers. Anthropic officially launched the plugin marketplace in December 2025 with 36 curated plugins.47

Plugin Structure

my-plugin/
├── .claude-plugin/
│   └── plugin.json              # Required: metadata
├── commands/                     # Slash commands
│   └── hello.md
├── agents/                       # Subagents
│   └── helper.md
├── skills/                       # Skills
│   └── my-skill/
│       └── SKILL.md
├── hooks/                        # Event handlers
│   └── hooks.json
└── .mcp.json                     # MCP servers

Plugin Manifest

Minimal plugin.json:

{
  "name": "my-plugin",
  "description": "What this plugin does",
  "version": "1.0.0",
  "author": {
    "name": "Your Name"
  }
}

Plugin Management

> /plugin                              # Interactive interface
> /plugin install name@marketplace     # Install
> /plugin enable name@marketplace      # Enable
> /plugin disable name@marketplace     # Disable
> /plugin uninstall name@marketplace   # Remove
> /plugin marketplace add ./local      # Add local marketplace
> /plugin marketplace list             # View marketplaces

Local Development

Create a local marketplace for testing:

mkdir dev-marketplace && cd dev-marketplace
mkdir my-plugin
# Create plugin structure

cd ..
claude
> /plugin marketplace add ./dev-marketplace
> /plugin install my-plugin@dev-marketplace

Plugin Installation Improvements (v2.1.51+)

Plugins now support custom npm registries and specific version pinning when installing from npm sources. The default git timeout for marketplace operations was increased from 30s to 120s, configurable via CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS.105

Plugin Components

  • Commands: Available as slash commands (/plugin-command)
  • Agents: Appear in /agents list
  • Skills: Auto-load based on skill config
  • Hooks: Merged with user/project hooks, run in parallel
  • MCP Servers: Auto-start when plugin enabled

How Does Memory Work?

Claude Code’s memory system enables persistent context across sessions. Effective memory management is the difference between Claude understanding your project deeply and treating every session as a fresh start.

CLAUDE.md Hierarchy

Location Scope Shared Use Case
/Library/Application Support/ClaudeCode/CLAUDE.md (macOS) Enterprise All users Company standards
./CLAUDE.md or ./.claude/CLAUDE.md Project Via git Team context
~/.claude/CLAUDE.md User All projects Personal preferences
./CLAUDE.local.md Project-local Never Personal project notes

Effective CLAUDE.md Structure

# Project Context

## Architecture
- Monorepo with packages in /packages
- React frontend in /packages/ui
- Node.js API in /packages/api
- Shared types in /packages/types
- PostgreSQL database via Prisma

## Code Standards
- TypeScript strict mode everywhere
- ESLint + Prettier enforced (pre-commit hooks)
- No default exports
- JSDoc on all public APIs
- Tests required for all new code

## Commands
- `npm test` - Run all tests
- `npm run test:watch` - Watch mode
- `npm run lint` - Check linting
- `npm run lint:fix` - Auto-fix lint issues
- `npm run build` - Production build
- `npm run dev` - Start dev servers
- `npm run db:migrate` - Run migrations
- `npm run db:seed` - Seed database

## Patterns

### API Endpoints
Create in packages/api/src/routes/
Use Zod for request/response validation
All endpoints need OpenAPI documentation

### React Components
Create in packages/ui/src/components/
Use React Query for server state
Prefer composition over inheritance

### Database
Prisma schema in packages/api/prisma/
Always create migration for schema changes
Use transactions for multi-table operations

## Important Notes
- NEVER commit .env files
- API runs on :3000, UI on :3001
- Local DB: postgres://localhost:5432/myapp
- Feature flags in packages/api/src/flags.ts

## Recent Decisions
- 2025-12-01: Migrated to React Query v5
- 2025-11-15: Adopted Zod for all validation
- 2025-11-01: Moved to ESM modules

# Summary Instructions
When using compact, focus on:
- Recent code changes
- Test results
- Architecture decisions made this session

File Imports

Reference other files within CLAUDE.md:

See @README.md for project overview
Coding standards: @docs/STYLE_GUIDE.md
API documentation: @docs/API.md
Personal preferences: @~/.claude/preferences.md

Import syntax: - Relative: @docs/file.md - Absolute from project: @/absolute/path.md - Home directory: @~/.claude/file.md - Maximum depth: 5 levels of imports

Memory Rules Directory

For more organized memory, use .claude/rules/ to store categorized rule files:18

.claude/rules/
├── testing.md          # Testing conventions
├── security.md         # Security requirements
├── api-patterns.md     # API design patterns
└── deployments.md      # Deployment procedures

Rules load automatically and provide structured context without cluttering CLAUDE.md.

Quick Memory Addition

Use the # prefix to add notes during a session:

# Always run tests before committing
# The payment module is especially fragile
# Use the new logger from packages/api/src/logger.ts

You’ll be prompted to select which memory file to store the note in.

Auto Memory (v2.1.32+)

Claude Code now automatically records and recalls project context across sessions.87 As you work, Claude writes observations—patterns, conventions, debugging insights, key file paths—to a persistent memory file at:

~/.claude/projects/{project-path}/memory/MEMORY.md

You’ll see Recalled memories at session start and Wrote memories during the session. Auto memory differs from the # prefix:

Auto Memory # Prefix
Trigger Claude decides implicitly You decide explicitly
Content Patterns, conventions, architecture Specific facts or instructions
Storage MEMORY.md (auto-managed) User-selected memory file
Editing Claude manages; you can edit the file directly You control what’s stored

Auto memory is always loaded into your system prompt (first 200 lines). Keep it concise—create separate topic files (e.g., debugging.md, patterns.md) linked from MEMORY.md for detailed notes.

To opt out, pass --no-memory at startup (disables all memory, including CLAUDE.md). There is no flag to disable auto-memory specifically while keeping CLAUDE.md active (this is a requested feature).

Context Management Commands

View context usage:

> /context

Shows a visual grid of context allocation across system prompt, conversation, tools, and file contents.

Compact conversation:

> /compact
> /compact focus on the authentication changes
> /compact preserve test output and error messages

Intelligently summarizes older conversation while preserving key information.

Custom compaction instructions (in CLAUDE.md):

# Summary Instructions
When using compact, focus on:
- Test output and failures
- Code changes made this session
- Architecture decisions

Extended thinking for context:

export MAX_THINKING_TOKENS=10000

More thinking tokens means more reasoning capacity but higher costs.

Context Optimization Strategies

  1. Use specific file references instead of asking Claude to search
  2. Clear unrelated conversations with /clear between tasks
  3. Compact proactively during long sessions
  4. Use subagents to isolate exploratory work
  5. Break complex tasks into focused interactions
  6. Resume sessions for ongoing work rather than re-explaining

Image and Multimodal Input

Claude Code can analyze images: screenshots, diagrams, mockups, error messages, database schemas.

Input Methods

  1. Drag and drop: Drag image files into the Claude Code window
  2. Paste: Ctrl+V (not Cmd+V on Mac) to paste from clipboard
  3. Path reference: “Analyze this image: /path/to/screenshot.png”

Viewing Attached Images

When Claude references an image in its response, clickable image links allow direct viewing:34

[Image #1]   # Click to open in default image viewer
[Image #2]   # Navigate attached screenshots

Clickable links help when reviewing screenshots or debugging visual issues. Click the reference to see exactly what Claude analyzed.

Use Cases

  • Debug UI issues: “Here’s a screenshot of the bug, what’s causing it?”
  • Implement designs: “Build this component based on the mockup”
  • Analyze diagrams: “Explain this architecture diagram”
  • Database schemas: “Create Prisma models matching this ERD”
  • Error analysis: “What does this error screenshot mean?”

Expert tip: When implementing from mockups, include multiple screenshots showing different states (default, hover, loading, error). The more visual context, the better the implementation.

PDF Reading (v2.1.30+)

Claude Code can read and analyze PDF documents with page-level control:83

Basic PDF reading:

> Analyze this PDF: /path/to/document.pdf

Read specific page ranges:

> Read pages 1-5 of the PDF: /path/to/report.pdf

Or programmatically via the Read tool with pages parameter: - pages: "1-5" - Read pages 1 through 5 - pages: "1,3,7" - Read specific pages - pages: "10-" - Read from page 10 to end

Limits: - Maximum 100 pages per request - Maximum 20MB file size - Large PDFs (>10 pages) return a lightweight reference when @-mentioned, with full content loaded on-demand


How Does Git Integration Work?

Claude Code has deep git integration with built-in safety protocols.

Safety Protocols

  • Respects .gitignore automatically
  • Won’t modify branches without permission
  • Shows diffs before commits
  • Follows project’s commit conventions
  • Never force pushes without explicit request
  • Checks authorship before amending commits

Common Workflows

Create commits:

> commit these changes
> create a commit with a meaningful message

Claude will: 1. Run git status and git diff 2. Analyze changes 3. Generate a conventional commit message 4. Wait for approval before committing

Create pull requests:

> create a PR for this feature
> summarize the changes and create a PR

Review code:

> review the changes in this PR
> what could go wrong with these changes?

GitHub Actions Integration

Automate Claude in CI/CD with the official action:

Quick setup:

> /install-github-app

Manual workflow file:

name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]
  issue_comment:
    types: [created]

jobs:
  claude-review:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Review this PR for bugs, security issues, and performance problems"
          claude_args: "--max-turns 5"

For Bedrock (with OIDC):

- name: Configure AWS
  uses: aws-actions/configure-aws-credentials@v4
  with:
    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
    aws-region: us-west-2

- uses: anthropics/claude-code-action@v1
  with:
    use_bedrock: "true"
    claude_args: '--model us.anthropic.claude-sonnet-4-5-20250929-v1:0'

How Do I Use Claude Code in My IDE?

VS Code Extension

Requirements: VS Code 1.98.0+

Installation: Search “Claude Code” in Extensions marketplace

Features: - Sidebar panel (Spark icon) - Plan mode with diff preview - Auto-accept edits toggle - Extended thinking toggle - File attachment and image pasting - Conversation history - Multiple simultaneous sessions

Security Note: Anthropic patched a WebSocket authentication bypass vulnerability (CVE-2025-52882) in IDE extensions v1.0.24+. Ensure your extension is updated; Anthropic removed all vulnerable versions from extension stores.38

Third-party provider configuration (in .claude/settings.json):

{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "us-east-1",
    "AWS_PROFILE": "your-profile"
  }
}

JetBrains Plugin

Supported: IntelliJ IDEA, PyCharm, WebStorm, GoLand, PhpStorm, DataGrip

Installation: Settings → Plugins → Search “Claude Code” → Install → Restart

Key shortcuts: - Cmd+Esc (Mac) / Ctrl+Esc (Windows): Quick launch - Cmd+Option+K (Mac) / Alt+Ctrl+K (Windows): Add file reference

Features: - Diff viewing in IDE diff viewer - Selection context auto-sharing - Diagnostic integration - Multiple sessions

WSL2 configuration: Set Claude command to:

wsl -d Ubuntu -- bash -lic "claude"

Terminal Integration

Connect an external terminal to your IDE:

> /ide

Claude Code auto-detects VS Code, Cursor, Windsurf, and JetBrains IDEs.

Slack Integration (December 2025)

Claude Code now integrates directly with Slack, enabling developers to delegate coding tasks from chat threads.14

How it works: 1. Mention @Claude in a Slack channel or thread 2. Claude reviews the message to determine if it’s a coding task 3. A Claude Code session automatically starts on Anthropic infrastructure 4. Claude gathers context from recent channel/thread messages 5. Progress updates post back to your Slack thread 6. Links to review changes and open PRs provided on completion

Use cases: - Bug investigation from bug reports posted in Slack - Quick code reviews based on team feedback - Small feature implementations from feature requests

Requirements: - Claude app installed via Slack App Marketplace - Paid Slack plan - Access to Claude Code on the web

Privacy: Claude respects Slack’s existing permission structure. It cannot access conversations or repositories you aren’t authorized to see. Conversations are not used for model training.


Advanced Usage Patterns

Headless and CI Mode

Run Claude Code in scripts and CI pipelines:

#!/bin/bash
# Automated code review

result=$(claude -p "Review this code for quality issues" \
  --output-format json \
  --allowedTools "Read,Grep,Glob" \
  --permission-mode plan \
  --disable-slash-commands \
  --max-turns 5)

if echo "$result" | jq -e '.result | test("critical|high severity")' > /dev/null; then
  echo "Issues found:"
  echo "$result" | jq -r '.result'
  exit 1
fi

echo "Review passed"
exit 0

Piping and Chaining

# Analyze logs
cat production.log | claude -p "summarize errors" > error-summary.md

# Process multiple files
find . -name "*.ts" -exec cat {} \; | claude -p "find security issues"

# Chain with jq
claude -p "generate config" --output-format json | jq -r '.result' > config.json

Background Tasks

Run long operations without blocking:

> start the build in the background

Or press Ctrl+B during command execution.

Manage background tasks:

> /bashes                    # List running tasks
> get output from task xyz   # Retrieve output

Parallel Sessions with Git Worktrees

# Create worktrees for parallel work
git worktree add ../project-feature-a -b feature-a
git worktree add ../project-bugfix bugfix-123

# Run Claude in each worktree (separate project dirs = separate sessions)
cd ../project-feature-a && claude
cd ../project-bugfix && claude

Each worktree is an independent project directory with its own session.

JSON Output Parsing

result=$(claude -p "analyze this code" --output-format json)

# Extract fields
echo "Result: $(echo $result | jq -r '.result')"
echo "Cost: $(echo $result | jq -r '.total_cost_usd')"
echo "Session: $(echo $result | jq -r '.session_id')"
echo "Duration: $(echo $result | jq -r '.duration_ms')ms"

Programmatic Session Management

# Name the current session for easy recall (inside Claude: /rename feature-auth)
# Then resume by name later:
claude --resume "feature-auth"

# Continue most recent session
claude -c "continue implementing the tests"

# List recent sessions to find one (shows up to 50 sessions, v2.1.47+)
claude --resume          # interactive picker

Remote & Background Agents [RESEARCH PREVIEW]

Claude Code extends beyond your local terminal through two complementary features: Remote (cloud execution with local teleportation) and Background Agents (parallel task execution without blocking your terminal). Both use the & prefix and share the same cloud infrastructure.

The Core Concept

The web interface at claude.ai/code runs Claude Code in the cloud. Tasks execute in the background while you’re away from your terminal. When you’re ready to continue, teleport the session to your local machine and pick up exactly where Claude left off.

Remote execution enables workflows that were not possible before: - Start a complex refactoring task from your phone, let it run while you commute, then finish on your workstation - Queue up multiple tasks on the web interface, review results when you return to your desk - Hand off long-running operations to the cloud when you need to close your laptop

The & Prefix

Send a task to run on Claude Code web in the background:

& Build a complete REST API for user management with authentication, CRUD operations, and proper error handling

The & prefix dispatches your prompt to the cloud. Claude works on it asynchronously. You can close your terminal, switch devices, or continue with other work. The web interface at claude.ai/code shows your running and completed sessions.

The --teleport Flag

Pull a cloud session into your local terminal:

claude --teleport session_abc123

The flag retrieves the session state from the web and resumes it locally. You get the full conversation history, any files Claude modified, and can continue the interaction as if you’d been there the whole time.

The session ID appears in the web interface. Click on any session to see its ID and current status.

Requirements

Claude Code Remote is available for Pro, Max, Team (premium seats), and Enterprise (premium seats) subscribers.73 The web interface runs on Anthropic’s infrastructure, executing the same Claude Code capabilities you have locally (file operations, bash commands, MCP integrations) but in a managed cloud environment. Anthropic expanded Team and Enterprise access in January 2026; account admins can toggle access in Claude settings.

iOS App (November 2025): Claude Code is also available on the Claude iOS app, allowing you to kick off coding tasks on the go and monitor agent progress from your phone.22 You can start tasks while away from your desk and later teleport them to your terminal when you’re ready to review.

Practical Workflow

Morning commute:

& Review all PRs assigned to me and prepare summaries with recommendations

At your desk:

# Check what completed
# Visit claude.ai/code to see session list

# Pull the session locally to review and act on recommendations
claude --teleport pr-review-session-xyz

Before leaving work:

& Run the full test suite, fix any failures, and prepare a summary of what was changed

Next morning:

claude --teleport test-fixes-session-abc
# Review what Claude did overnight, make final adjustments

Claude Code Security [RESEARCH PREVIEW] (February 2026)

Claude Code Security is a vulnerability scanning capability built into Claude Code on the web.104 It scans codebases for security vulnerabilities and suggests targeted patches for human review.

Availability: Limited research preview for Enterprise, Team, and open-source maintainers.

How it works: 1. Point Claude Code Security at a repository 2. It scans the codebase for vulnerabilities 3. Results include specific patch suggestions for review 4. Human review required before applying changes

This feature leverages Opus 4.6’s demonstrated ability to find 500+ zero-day vulnerabilities in open-source code out-of-the-box.86

Current Status

Claude Code Remote is currently in research preview. Expect the feature to evolve as Anthropic gathers feedback. The core workflow (cloud execution with local teleportation) enables continuous AI development: Claude works while you’re away from your keyboard, and you pick up exactly where it left off.

Current limitation: Session teleportation is currently one-way only: you can pull web sessions into your terminal, but you cannot push an existing terminal session to the web. There’s no way to continue a local session on a remote machine (e.g., an AWS instance via SSH) yet.

Background Agents

Background agents run while you continue working, with no waiting for long-running tasks to complete.17

How Background Agents Work:

Instead of blocking your terminal while Claude runs a complex task, background agents: 1. Execute independently in a separate process 2. Continue working even if you close your terminal 3. Report results when complete via notification 4. Can be monitored and managed while running

Starting a Background Agent

Using Ctrl+B: While Claude is working, press Ctrl+B to send the current task to the background. Your terminal becomes available immediately.

Using the & prefix:

& Run all tests and fix any failures
& Refactor the authentication module to use JWT
& Generate complete API documentation

The & prefix dispatches to Claude Code Remote (cloud execution). For local background execution, use Ctrl+B on an already-running task.

Monitoring Background Tasks

> /tasks                    # List all running tasks
> /task status abc123       # Check specific task
> /task cancel abc123       # Stop a task
> /task output abc123       # View task output so far

Parallel Background Workflows

Run multiple agents simultaneously:

& Fix all failing tests in src/
& Update documentation for the API module
& Run security scan on the codebase

Each runs independently. Monitor progress with /tasks and pull results as they complete.


Claude in Chrome (December 2025)

Claude Code now integrates with your browser through the Claude in Chrome extension, enabling direct browser control from your terminal.24

Prerequisites

  • Chrome or Chromium-based browser (Edge, Brave, Arc all work)
  • Claude Code v2.0+ running in a terminal
  • Pro, Max, Team, or Enterprise plan (extension not available on Free)
  • Chrome extension installed from https://claude.ai/chrome

Setup

  1. Install the Chrome extension from https://claude.ai/chrome
  2. Grant the extension permissions when prompted (page access is required for browser control)
  3. Launch Claude Code — the integration is automatically detected via local WebSocket
  4. Use natural language to control your browser

The extension communicates with Claude Code over a local WebSocket connection. Both must be running simultaneously.

Capabilities

Browser automation from terminal:

> Navigate to github.com and open my repositories
> Fill out this form with the test user data
> Take a screenshot of the current page
> Click the submit button and wait for the page to load

Web scraping and testing:

> Extract all product prices from this e-commerce page
> Run through the signup flow and report any issues
> Check if the mobile menu works correctly

Use Cases

  • E2E testing: Run integration tests directly from Claude Code
  • Web scraping: Extract data from pages without writing browser automation code
  • Form filling: Automate repetitive web workflows
  • Visual verification: Screenshot and analyze page layouts

The Chrome integration runs within your existing browser session, accessing your logged-in state and cookies, which is useful for testing authenticated flows.

Limitations

  • No multi-tab support: Claude controls the active tab only; it cannot orchestrate across multiple tabs simultaneously
  • JavaScript dialogs block execution: alert(), confirm(), and prompt() dialogs pause the extension — avoid triggering them in automated flows
  • No incognito access unless you explicitly enable the extension in incognito mode
  • WebSocket connection: If Claude Code restarts, the Chrome extension must reconnect (usually automatic within seconds)
  • Use read_page for element refs from the accessibility tree; interact using ref, not coordinates

Claude Code in Slack (December 2025) [RESEARCH PREVIEW]

Anthropic launched Claude Code in Slack, allowing developers to delegate coding tasks directly from chat threads.26

How It Works

  1. Tag @Claude in any Slack channel or thread
  2. Describe the coding task with context
  3. Claude analyzes Slack messages to determine the repository
  4. Progress updates appear in the thread
  5. Claude shares links to review work and open PRs

Example Workflow

@Claude The login form validation is broken on mobile devices.
Can you fix it? Check the bug report from earlier in this thread.

Claude will: 1. Read the thread for context 2. Identify the relevant repository 3. Clone and analyze the codebase 4. Post progress updates 5. Create a PR with the fix 6. Share the PR link for review

Benefits

  • Context awareness: Claude reads Slack history for bug reports, feature requests, and discussions
  • Team visibility: Progress updates in threads keep everyone informed
  • Low friction: No terminal or IDE required; start from chat
  • GitHub integration: PRs created automatically with proper descriptions

Prerequisites

  • Slack workspace with Claude app installed (workspace admin must approve)
  • GitHub repository connected to the Slack workspace
  • Pro, Max, Team, or Enterprise plan
  • Claude must have write access to the target repository (branch creation, PR creation)

Limitations

  • Repository detection: Claude infers the repository from Slack context (channel topic, recent messages, thread content). If ambiguous, specify the repo explicitly: @Claude in repo org/my-app, fix the login bug
  • No local file access: Slack Claude runs entirely in the cloud — it clones the repo, makes changes, and creates PRs. It cannot access your local filesystem
  • Thread context window: Claude reads the current thread but has limited context from other channels or DMs
  • Approval flow: All changes go through PR review — Claude never pushes directly to main
  • Rate limits: Subject to your plan’s Claude Code usage limits (shared with CLI and web usage)

Slack integration is currently in research preview for Pro, Max, Team, and Enterprise users.


Performance Optimization

Reducing Latency

Model selection: - Haiku: Fastest responses, lowest cost - Sonnet: Good balance - Opus: Best quality, highest latency

Streaming: All responses stream by default, so you see output as it’s generated.

Prompt caching: Enabled by default. Reduces latency for repeated context (system prompts, tool definitions).

Caching Strategies

Claude Code automatically caches system prompts and tool definitions: - Cache duration: 5 minutes (ephemeral) - Cache hit: Reduced input tokens and faster response

Multi-turn conversations cache thinking blocks from previous turns.

Disable caching per model if needed:

export DISABLE_PROMPT_CACHING_SONNET=1
export DISABLE_PROMPT_CACHING_OPUS=1
export DISABLE_PROMPT_CACHING_HAIKU=1

Parallel Operations

Subagent parallelization: Multiple subagents can run simultaneously. Each operates independently without polluting main context.

Background bash: Long-running commands don’t block the conversation:

> run the full test suite in the background

Git worktrees (v2.1.49+): Start Claude in an isolated git worktree for parallel work without affecting your main working tree:

claude --worktree            # or -w; creates worktree in .claude/worktrees/
claude -w --name feature-x   # Named worktree

Subagents also support isolation: "worktree" in their definitions, giving each subagent an isolated repo copy that is automatically cleaned up if no changes are made.103 For non-git VCS, configure WorktreeCreate/WorktreeRemove hooks to handle custom setup and teardown.103

Memory Optimization

  • Specific file references: @src/auth.ts instead of “find the auth file”
  • Targeted searches: “search in src/api” not “search everywhere”
  • Fresh sessions: /clear between unrelated tasks
  • Custom compaction: Add instructions to CLAUDE.md for what to preserve
  • Tool result disk persistence (v2.1.51+): Tool results larger than 50K characters are now persisted to disk (lowered from 100K), reducing context window usage and improving conversation longevity in long sessions105
  • BashTool login shell skip (v2.1.51+): BashTool now skips the login shell -l flag by default when a shell snapshot is available, improving command execution performance. Previously required setting CLAUDE_BASH_NO_LOGIN=true105

How Do I Debug Issues?

Installation Issues

WSL path problems:

npm config set os linux
npm install -g @anthropic-ai/claude-code --force --no-os-check
which npm  # Should start with /usr not /mnt/c

Node version conflicts (nvm): Add to ~/.bashrc or ~/.zshrc:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

Permission errors: Use native installation instead of npm:

curl -fsSL https://claude.ai/install.sh | bash

Authentication Issues

# Complete reset
/logout
rm -rf ~/.config/claude-code/auth.json
claude  # Fresh login

Performance Issues

High CPU/memory: - Use /compact to reduce context - Restart between major tasks - Add large directories to .gitignore - Run claude doctor

Slow search: Install system ripgrep:

# macOS
brew install ripgrep

# Windows
winget install BurntSushi.ripgrep.MSVC

# Linux
sudo apt install ripgrep

Then:

export USE_BUILTIN_RIPGREP=0

Slow on WSL: - Move project to Linux filesystem (not /mnt/c/) - Use specific directory filters in searches

IDE Integration Issues

JetBrains not detected (WSL2):

Option 1 - Windows Firewall:

wsl hostname -I  # Get WSL IP
New-NetFirewallRule -DisplayName "Allow WSL2" -Direction Inbound -Protocol TCP -Action Allow -RemoteAddress 172.21.0.0/16

Option 2 - Mirrored networking (add to ~/.wslconfig):

[wsl2]
networkingMode=mirrored

Then: wsl --shutdown

Escape key not working in JetBrains: Settings → Tools → Terminal → Uncheck “Move focus to the editor with Escape”

Authentication Management (v2.1.41+)

claude auth login                # Log in or switch accounts
claude auth status               # Check current authentication state
claude auth logout               # Log out and clear stored credentials

Use claude auth logout && claude auth login to reset authentication when switching between API key and OAuth, or between organizations.

Debug Mode

claude --debug                    # Full debug output
ANTHROPIC_LOG=debug claude       # API request logging
claude doctor                    # Health check
/debug                           # Troubleshoot current session (v2.1.30+)

The /debug command (v2.1.30+) provides session-specific diagnostics including: - Current model and context usage - Active MCP servers and their status - Permission state and recent denials - Memory pressure indicators

Configuration Reset

# Reset user settings
rm ~/.claude.json
rm -rf ~/.claude/

# Reset project settings
rm -rf .claude/
rm .mcp.json

Common Error Messages

Error Cause Solution
“Rate limit exceeded” Too many requests Wait or reduce frequency
“Context length exceeded” Conversation too long Use /compact or /clear
“Authentication failed” Invalid or expired token Run claude auth login
“Tool not permitted” Permission denied Check settings.json permissions
“MCP server failed to start” Server misconfigured Check claude mcp get <name>

Enterprise Deployment

Cloud Provider Comparison

Feature Anthropic Direct AWS Bedrock Google Vertex Microsoft Foundry
Auth API key IAM/API key GCP credentials Entra ID/API key
Cost tracking Console AWS Cost Explorer GCP Billing Azure Cost Mgmt
Audit logging Limited CloudTrail Cloud Audit Logs Azure Monitor
SSO No IAM IAM Entra ID

Managed Settings Deployment

Deploy organization-wide policies via managed-settings.json:

Location: - macOS: /Library/Application Support/ClaudeCode/managed-settings.json - Linux: /etc/claude-code/managed-settings.json - Windows: C:\Program Files\ClaudeCode\managed-settings.json

Example policy:

{
  "permissions": {
    "allow": [
      "Read",
      "Glob",
      "Grep",
      "Bash(npm run:*)",
      "Bash(git:*)"
    ],
    "deny": [
      "Bash(rm -rf:*)",
      "Bash(curl:*)",
      "Read(.env*)",
      "WebFetch"
    ],
    "defaultMode": "default"
  },
  "model": "claude-opus-4-6",
  "disableBypassPermissionsMode": "disable",
  "allowManagedPermissionRulesOnly": true,
  "allowManagedHooksOnly": true
}

Managed-only settings keys:

Key Effect
allowManagedPermissionRulesOnly Prevent user/project settings from defining permission rules; only managed rules apply
allowManagedHooksOnly Prevent user/project/plugin hooks from loading; only managed and SDK hooks run
strictKnownMarketplaces Allowlist of plugin marketplaces (empty array = lockdown)
allowedMcpServers Allowlist of MCP servers users can configure (empty array = lockdown)
deniedMcpServers Denylist of MCP servers (takes precedence over allowlist)
disableBypassPermissionsMode Prevent --dangerously-skip-permissions

Users cannot override managed settings. Managed settings have highest precedence in the configuration hierarchy.

Enterprise CLAUDE.md

Deploy organization-wide context:

Location: - macOS: /Library/Application Support/ClaudeCode/CLAUDE.md - Linux: /etc/claude-code/CLAUDE.md

Content:

# Company Standards

## Security Requirements
- Never commit secrets or credentials
- All external API calls require security review
- Use parameterized queries for all database access

## Code Standards
- Follow company style guide at @docs/STYLE.md
- All PRs require two approvals
- Test coverage minimum: 80%

## Approved Tools
- npm, yarn, pnpm for package management
- Jest for testing
- ESLint + Prettier for formatting

Rollout Strategy

  1. Start with documentation: Get CLAUDE.md right before deploying
  2. Pilot group: Begin with 5-10 developers
  3. Q&A phase: Let pilots use Claude for code exploration
  4. Guided development: Progress to small bug fixes
  5. Full deployment: Roll out with managed settings
  6. Monitor costs: Track per-team usage

Audit and Compliance

Data handling: - Session transcripts stored locally by default (no data leaves the machine beyond API calls) - API requests go to api.anthropic.com (direct) or through your cloud provider (Bedrock/Vertex/Foundry) - Anthropic’s commercial terms state that API inputs/outputs are not used for model training - For data residency requirements, use Bedrock (AWS regions) or Vertex (GCP regions) to keep API traffic within specific geographies

SSO and identity: - Anthropic Direct: OAuth-based authentication via claude login (no SAML/SSO — use cloud providers for SSO requirements) - AWS Bedrock: IAM roles and SSO via AWS IAM Identity Center - Google Vertex: GCP IAM with Workforce Identity Federation for SAML/OIDC - Microsoft Foundry: Entra ID with native SSO

Compliance frameworks: - Anthropic publishes a SOC 2 Type II report (available under NDA via sales) - Cloud providers (AWS, GCP, Azure) carry their own compliance certifications (SOC 2, HIPAA BAA, ISO 27001, FedRAMP) — routing through them inherits their compliance posture - For regulated industries (healthcare, finance), route through a cloud provider with the appropriate BAA or compliance addendum rather than using the direct API

Logging and monitoring: - Use cloud provider logging for enterprise audit (CloudTrail, Cloud Audit Logs, Azure Monitor) - Consider LiteLLM proxy for detailed usage tracking across teams - Managed settings enforce compliance policies - The Analytics API provides daily usage aggregates per user (see below)

Analytics API (Admin)

Enterprise and Team plans have access to the Claude Code Analytics API for programmatic usage tracking.

Endpoint: GET /v1/organizations/usage_report/claude_code

Authentication: Requires Admin API key (sk-ant-admin...), provisioned in Console by org admins.

Metrics Available:

Category Metrics
Productivity Sessions, lines added/removed, commits, PRs per user
Tool Usage Acceptance/rejection rates by tool (Edit, Write, NotebookEdit)
Cost Estimated cost breakdown by user and model

Request Parameters: - starting_at - Date for daily aggregation (YYYY-MM-DD) - Returns user-level data for the specified day

Example:

curl -X GET "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2026-01-25" \
  -H "x-api-key: sk-ant-admin-..." \
  -H "anthropic-version: 2023-06-01"

Limitations: - Daily aggregates only (~1hr delay for consistency) - For real-time monitoring, use OpenTelemetry integration - Only tracks 1st party API usage (not Bedrock/Vertex)

Cost: Free for organizations with Admin API access.


Keyboard Shortcuts Reference

General Controls

Shortcut Action
Ctrl+C Cancel current operation
Ctrl+D Exit session (EOF)
Ctrl+L Clear screen (keeps history)
Ctrl+O Toggle verbose output
Ctrl+R Search command history
Ctrl+V Paste image from clipboard
Ctrl+B Background current operation
Ctrl+F Kill all background agents (v2.1.47+)
Ctrl+Y Yank (paste from kill ring)
Ctrl+S Stash prompt draft (saves current input)
Alt+Y Yank-pop (cycle kill ring after Ctrl+Y)
Esc Esc Rewind last change
Tab Accept prompt suggestion
! + Tab Bash history autocomplete (v2.1.14+)
Shift+Tab Cycle permission modes
Alt+P / Option+P Switch models while typing prompt
Alt+T Toggle thinking mode (safer alternative)
Ctrl+T Toggle syntax highlighting in /theme
Ctrl+G Open external editor (in AskUserQuestion “Other” input)
Shift+Down Cycle agent team teammates (wraps around, v2.1.47+)
Up/Down Navigate command history
? Show shortcuts

Customizable keybindings (v2.1.18+): Run /keybindings to customize keyboard shortcuts. Supports context-specific bindings, chord sequences (multi-key combos), and full personalization. Claude Code stores keybindings in ~/.claude/keybindings.json. See keybindings docs for the full configuration reference.77

Prompt suggestions (Dec 2025): Claude now suggests prompts to speed up your workflow. Press Tab to accept a suggestion or Enter to submit your own prompt.13

Multiline Input

Method Keys
Escape newline \ then Enter
macOS Option+Enter
Out-of-box (v2.1.0+) Shift+Enter in iTerm2, WezTerm, Ghostty, Kitty37
Other terminals Shift+Enter (run /terminal-setup first)
Control character Ctrl+J
Custom keybinding (v2.1.47+) Bind any key to chat:newline via /keybindings102

Quick Prefixes

Prefix Action Example
# Add to memory # Always use TypeScript
/ Slash command /review
! Direct bash ! git status
@ File reference @src/index.ts
& Send to cloud & Build the API

File reference performance (Jan 2026): @ mentions are now 3x faster in git repos. Claude Code also respects .ignore and .rgignore files when suggesting file completions, which is useful for excluding build artifacts or generated files from suggestions.35

Vim Mode

Enable with /vim:

Normal mode: - h/j/k/l - Navigation - w/e/b - Word movement - 0/$ - Line start/end - gg/G - Buffer start/end - dd - Delete line - cc/C - Change line/to end - dw/de/db - Delete word variations - x - Delete character - . - Repeat last edit

Insert mode: - i/I - Insert before/at line start - a/A - Insert after/at line end - o/O - Open line below/above - Esc - Return to normal mode


Best Practices

Session Strategy

Name sessions with /rename inside Claude, then resume by name:

# Inside a session, name it:
> /rename feature-auth

# Later, resume by name:
claude --resume "feature-auth"

# Or continue the most recent session:
claude -c

Resume sessions for ongoing work rather than re-explaining context.

CLAUDE.md Design

Keep it scannable. Claude reads this every session, and dense prose wastes context.

Focus on the non-obvious. Document project-specific patterns, unusual conventions, decisions. Skip what Claude can infer from code.

Update continuously. Add notes during development with #. Review and consolidate weekly.

Include command reference. Document the commands you run constantly.

Security: Untrusted Repositories

Warning: When cloning and running Claude Code on untrusted repositories, be aware that CLAUDE.md files, .claude/settings.json, and hook scripts in the repository are read and potentially executed. Malicious repos can use these to inject prompts, override permissions, or execute arbitrary commands. Always review CLAUDE.md, .claude/settings.json, and any hook scripts before running Claude Code on repos you don’t own. Use --dangerously-skip-permissions only on trusted codebases.

Custom Commands

Create commands for repetitive workflows:

---
description: Start new feature
allowed-tools: Bash(git:*), Read, Edit
---

1. Create branch: !`git checkout -b feature/$ARGUMENTS`
2. Pull latest main
3. Set up boilerplate
4. Begin implementation

Effective Prompting

Be specific:

# Good
"Add email validation to LoginForm in src/components/LoginForm.tsx"

# Too vague
"Improve the login"

Reference files directly:

"Review @src/auth/middleware.ts for security issues"

Provide constraints:

"Refactor using the same pattern as @src/repositories/UserRepository.ts"

Use subagents for exploration:

"Have an explore agent find all places where we handle errors"

Cost Control

  • Use /cost regularly
  • Use Haiku for simple tasks and subagents
  • Set MAX_THINKING_TOKENS only when needed
  • Use --max-turns for automated scripts
  • Compact proactively in long sessions

Security

  • Configure .claude/settings.json deny rules for sensitive files
  • Use sandbox mode for untrusted projects
  • Never allow Bash(rm -rf:*) or Bash(sudo:*)
  • Use hooks to block access to secrets
  • Deploy managed settings for enterprise

Community Tips and Techniques5658

The Claude Code community has discovered powerful patterns that go beyond official documentation. These tips come from power users including Boris Cherny (Claude Code creator) and the 40+ tips repository.

Use Plan Mode Before Coding

If you remember one tip, make it this one. The more time you spend planning, the more likely Claude will succeed. Press Shift+Tab to cycle to plan mode before starting implementation. See Plan Mode for full documentation.

Clear Context Frequently

Use /clear often. Every time you start something new, clear the chat. You don’t need old history consuming tokens or triggering expensive compaction calls. Just clear it and move on.

Use Images and Screenshots

Claude excels with visual input. On macOS: Cmd+Ctrl+Shift+4 captures screenshot to clipboard, then Ctrl+V to paste directly into Claude Code. Use this to share UI mockups, error messages, or design references.

Install the GitHub App for PR Reviews

Run /install-github-app and Claude will automatically review your PRs. Automatic review is particularly valuable as AI-assisted development increases PR volume. Claude often catches logic errors and security issues that human reviewers miss.

Container-Based Autonomous Operation

For fully autonomous operation, run Claude Code in a Docker container with tmux as the control layer. Your local Claude Code controls the containerized instance, which can run long-running or experimental tasks without manual approval. If something goes wrong, it’s sandboxed.

# Conceptual pattern (varies by setup)
# Local Claude Code → tmux → Container Claude Code
# Results pulled back when complete

Docker Sandbox Mode (Quick Start): Run Claude Code inside a Docker container for full isolation when exploring untrusted codebases or running experimental prompts.63

# Run Claude Code in a Docker container (mount your project as a volume)
docker run -it --rm -v /path/to/project:/workspace anthropic/claude-code

# Or use the open-source sandbox runtime
# See: github.com/anthropic-experimental/sandbox-runtime

Use sandbox mode when: - Exploring unfamiliar or untrusted codebases - Testing experimental prompts that might modify files - Running autonomous sessions you want completely isolated - Learning Claude Code without risk to your actual files

Gemini CLI as Fallback

Claude Code’s WebFetch tool can’t access certain sites (like Reddit). Create a skill that tells Claude to use Gemini CLI as a fallback. Gemini has web access and can fetch content from sites Claude can’t reach directly.

Meta-Agent Factory Pattern

Instead of creating agents that do tasks, create an agent that creates other agents. The pattern multiplies productivity genuinely for complex automation workflows, not through clever recursion.

Claude Squad: Multi-Agent Manager

Claude Squad manages multiple Claude Code instances in parallel, each in its own tmux session with isolated worktrees. Run several agents simultaneously on different tasks, monitor their progress from a single dashboard, and pull results back when complete.65

# Install (Homebrew)
brew install claude-squad

# Or install via script (puts `cs` in ~/.local/bin)
curl -fsSL https://raw.githubusercontent.com/smtg-ai/claude-squad/main/install.sh | bash

# Launch the TUI — manages instances, tasks, and git worktrees
cs

# Auto-accept mode (experimental)
cs --autoyes

Use cases: - Parallelize independent features across agents - Run exploratory prompts without blocking your main session - Scale autonomous coding beyond a single context window

Power User Productivity Stats

Boris Cherny demonstrated Claude Code’s potential: in 30 days, he landed 259 PRs with 497 commits: 40,000 lines added and 38,000 removed. The numbers demonstrate what is possible when Claude Code is fully integrated into the development workflow.

People to Follow

Stay current with Claude Code developments by following these accounts:

Anthropic Team (Primary Sources)

Who Platform Why Follow
Boris Cherny @boris_cherny Claude Code creator. Ships features, announces updates, hosts meetups. Primary source.
Cat Wu @_catwu Anthropic. Claude Code feature announcements, subagent updates.
@adocomplete X Advent of Claude series - in-depth daily tutorials (hooks, plugins, prompt stashing).
Thariq @trq212 Anthropic engineer on Claude Code team. Resolves issues, posts updates.
Anthropic @AnthropicAI Official announcements and major releases.

Top Content Creators

Who Focus Notable
@dani_avila7 Tutorials Hooks in-depth guide, rules explanation
@mattpocockuk MCP/Tips 10-lesson MCP tutorial, Docker sandbox, JSON optimization
ykdojo GitHub Tips 40+ tips repo, status line script, system prompt optimization
@ai_for_success MCP/Workflows Hyperbrowser MCP, documentation caching patterns
@jerryjliu0 Agents Step-by-step agent building tutorials

Key Resources

  • GitHub Releases: anthropics/claude-code/releases - Watch for releases only
  • Discord: Anthropic community channels
  • Full list: See ~/.claude/docs/following-list.md for 20+ curated accounts

Boris and the Anthropic team share features as they ship, often the fastest way to learn about new capabilities before documentation catches up.

Common Anti-patterns

Learning what NOT to do often provides more value than best practices. These patterns consistently cause problems:

Cost Anti-patterns

Anti-pattern Problem Solution
Using Opus for everything 5x cost, often unnecessary Default Sonnet, Opus only for architecture
Never checking /cost Surprise bills Check cost after major tasks
Extended thinking on simple tasks Wasted tokens Toggle off (Alt+T) for routine work
Running explore in main context Context bloat Use Explore subagent instead

Context Anti-patterns

Anti-pattern Problem Solution
Ignoring context until it bloats Degraded reasoning, forgotten decisions /compact proactively at 50% capacity
Reading entire files when you need sections Wastes context on irrelevant code Reference specific line ranges
Never using subagents Everything fills main context Delegate exploration and analysis
Giant CLAUDE.md files Context waste every session Keep it under 500 lines, use imports

Workflow Anti-patterns

Anti-pattern Problem Solution
Creating overlapping skills and commands Confusion, unpredictable behavior One mechanism per purpose
Prompts for guaranteed actions Claude may skip or forget Use hooks for must-run actions
No hooks for formatting Inconsistent code style Hook every Edit/Write for formatter
Allowing all bash by default Security risk Explicit allowlist for safe commands

Configuration Anti-patterns

Anti-pattern Problem Solution
All config in user settings Nothing shared with team Project settings for team standards
Committing personal preferences Overrides teammates Use settings.local.json for personal
No deny rules Claude can touch sensitive files Deny .env, credentials, secrets
Ignoring managed settings Enterprise policies bypassed Managed settings for compliance

Prompt Anti-patterns

Anti-pattern Problem Solution
“Make it better” Vague, poor results Specify exactly what “better” means
Not referencing files Claude guesses paths Use @path/to/file.ts syntax
Ignoring Claude’s questions Works on wrong assumptions Answer before proceeding
Providing full docs when snippet suffices Context waste Extract relevant sections

Workflow Recipes

End-to-end patterns for common scenarios.

Recipe 1: Starting a New Project

# 1. Initialize
cd my-project
claude

# 2. Let Claude understand the codebase
> "Explore this codebase and summarize the architecture"

# 3. Set up project configuration
> /init

# 4. Create CLAUDE.md with learned patterns
> "Create CLAUDE.md documenting the patterns you observed"

# 5. Add team commands
> "Create a /test command that runs our test suite"
> "Create a /deploy command for staging deployment"

Recipe 2: Daily Development Flow

# 1. Continue yesterday's session
claude -c

# 2. Quick context recap
> "What did we work on yesterday?"

# 3. Check current state
> /status

# 4. Work on feature (Sonnet handles most tasks)
> "Implement the user profile endpoint"

# 5. Proactive context management
> /compact  # Before context exceeds 50%

# 6. Check spending
> /cost

# 7. End session cleanly
> "Summarize what we accomplished today"

Recipe 3: Complex Refactoring

# 1. Use Opus for planning, Sonnet for execution
> /model opusplan

# 2. Plan the refactoring
> "Plan refactoring our authentication from sessions to JWT"

# 3. Review the plan
# (Claude presents approach, you approve or modify)

# 4. Execute with Sonnet
> "Execute the plan"

# 5. Verify nothing broke
> "Have an explore agent verify all auth-related tests pass"

# 6. Review the diff
> !git diff

Recipe 4: PR Review Automation

# In CI/CD (GitHub Actions, etc.)
cat pr_diff.txt | claude -p "Review this PR diff for:" \
  --output-format json \
  --permission-mode plan \
  --max-turns 5 << EOF
- Security vulnerabilities
- Performance issues
- Code style violations
- Missing test coverage
Provide findings in JSON format.
EOF

Recipe 5: Debugging Production Issues

# 1. Configure Sentry MCP for error access
claude --add-mcp sentry

# 2. Get error context
> "Fetch the last 10 errors from Sentry for the auth service"

# 3. Deep dive with thinking
> Alt+T  # Enable extended thinking
> "Analyze these errors and identify the root cause"

# 4. Fix and verify
> "Implement a fix and add a regression test"
> !npm test

Migration Guide

Coming from other AI coding tools? Here’s how concepts map.

From GitHub Copilot

Copilot Concept Claude Code Equivalent
Tab completion Not a primary focus: Claude Code does agentic editing
Chat + agentic CLI REPL conversation with tool execution
Copilot instructions CLAUDE.md + Skills
Specialized agents (Explore, Plan) Subagents (Task tool) + agent teams
MCP support 300+ MCP integrations + remote OAuth
ACP (Agent Client Protocol) Hooks (12+ lifecycle events)
IDE + CLI Terminal-native + IDE extensions

What you gain: OS-level sandboxing, 12+ hook lifecycle events, remote MCP with OAuth, subagent delegation with isolated context, and --teleport for cloud-to-local handoff. Copilot CLI (Jan 2026+) now has agentic capabilities — the comparison is feature differentiation, not a capability gap.

From Cursor

Cursor Concept Claude Code Equivalent
Composer Session with full tool access
Chat REPL with subagent delegation
Codebase indexing Real-time file access (Glob, Grep, Read)
Tab autocomplete Not primary focus
IDE-integrated Terminal-native + IDE extensions
MCP support (built-in) MCP support (300+ integrations, remote OAuth)
Cursor rules (.mdc) + AGENTS.md CLAUDE.md + Skills
Background agents Remote agents (& prefix, --teleport)

What you gain: 12+ hook lifecycle events for automation, subagent delegation with isolated context, OS-level sandboxing (seatbelt/bubblewrap), remote MCP with native OAuth, and terminal-native workflow. Both tools support MCP — Claude Code differentiates with remote OAuth and tool search auto-deferral.

From ChatGPT / Claude Web

Web Interface Claude Code
Copy-paste code Direct file access
Manual file creation Writes files directly
No execution Full bash, git, npm, etc.
Context resets Session continuity (-c flag)
No codebase awareness Glob, Grep, Read tools
No automation Hooks, CI/CD integration

What you gain: Everything. Web interfaces require copy-paste workflows; Claude Code operates directly on your codebase.

Key Mindset Shifts

  1. Stop copying code. Claude Code writes to files directly.
  2. Stop context-switching. MCP brings external tools into the session.
  3. Delegate aggressively. Subagents handle exploration without bloating your context.
  4. Automate with hooks. Formatting, linting, logging happen automatically.
  5. Think in sessions. Continue work with -c, not fresh conversations.

Audience-Specific Guidance

For developers: - Haiku costs ~5x less than Opus; use it for subagents and simple tasks - Use /compact proactively during long sessions to manage context - Session IDs encoding context (feature-${branch}-${timestamp}) help locate previous work - Prefix common prompts with # to add to persistent memory without extra typing

For DevOps and platform teams: - Headless mode (-p flag) enables CI/CD integration with JSON output for parsing - Hooks guarantee execution regardless of model behavior; use for linting, formatting, security checks - MCP extends capabilities to databases, GitHub, Sentry, and 300+ integrations - Background tasks (& prefix) run on Claude Code Remote for asynchronous execution

For security teams: - Permission rules evaluated first-match-wins; structure allow/deny lists carefully - Sandbox mode isolates filesystem and network for untrusted codebases - Bash patterns match prefixes only, so Bash(curl:*) blocks all curl, not just specific URLs - Enterprise managed settings cannot be overridden by users

For team leads: - Skills auto-activate based on context; embed domain expertise without explicit invocation - Project skills commit to git; teammates get standardized expertise automatically - Cost tracking via /cost shows session breakdown; budget 10k-300k TPM per user based on team size - Custom commands in .claude/commands/ create reusable workflows

For enterprise architects: - Managed settings deploy organization-wide policies via /etc/claude-code/managed-settings.json - AWS Bedrock, Google Vertex AI, and Microsoft Foundry integrate with existing cloud billing - Opus 4.6 with 1M context window enables processing entire codebases in a single prompt - Agent teams (v2.1.32+) enable parallel multi-agent coordination for complex tasks - Start pilot with 5-10 developers before full rollout


Quick Reference Card

Print this. Tape it to your monitor.

╔═══════════════════════════════════════════════════════════════╗
                    CLAUDE CODE QUICK REFERENCE                 
╠═══════════════════════════════════════════════════════════════╣
  MODELS                                                        
    haiku     $1/$5/M     Exploration, simple tasks            
    sonnet    $3/$15/M    Daily coding (default)               
    opus      $5/$25/M    Opus 4.6: architecture, hard probs  
    opus[1m]  $10/$37.50  Opus 4.6 with 1M context (beta)     
    sonnet[1m] $6/$22.50/M Large codebases (1M context)        
╠═══════════════════════════════════════════════════════════════╣
  ESSENTIAL COMMANDS                                            
    /compact        Reduce context (do at 50% capacity)        
    /cost           Check session spending                     
    /model opus     Switch to Opus                             
    /status         Show current state                         
    /init           Set up project config                      
    /mcp            Configure integrations                     
    claude agents   List all configured agents (CLI)           
    claude -w       Start in isolated git worktree             
    claude remote-control  Serve local env for external builds 
╠═══════════════════════════════════════════════════════════════╣
  KEYBOARD SHORTCUTS                                            
    Alt+T           Toggle extended thinking                   
    Shift+Tab       Cycle permission modes                     
    Ctrl+C          Interrupt current operation                
    Ctrl+F          Kill all background agents                 
    Esc  Esc       Rewind last change                         
    Ctrl+L          Clear screen                               
╠═══════════════════════════════════════════════════════════════╣
  PREFIXES                                                      
    #message        Add to persistent memory                   
    @path/file      Reference file in prompt                   
    !command        Execute bash directly                      
    &task           Send to cloud (async)                      
╠═══════════════════════════════════════════════════════════════╣
  CONFIG FILE HIERARCHY (first found wins)                      
    .claude/settings.local.json    Personal (gitignored)       
    .claude/settings.json          Project (shared)            
    ~/.claude/settings.json        User global                 
    /etc/.../managed-settings.json Enterprise (locked)         
    CLAUDE.md                      Project context             
╠═══════════════════════════════════════════════════════════════╣
  DAILY WORKFLOW                                                
    1. claude -c              Continue session                 
    2. Work on features       Use Sonnet                       
    3. /compact               Before context bloats            
    4. /cost                  Check spending                   
    5. Summarize              Clean exit                       
╠═══════════════════════════════════════════════════════════════╣
  DECISION RULES                                                
    Simple task?         Haiku                                
    Hard reasoning?      Opus                                 
    Everything else?     Sonnet                               
    Must always run?     Hook (not prompt)                    
    Auto-apply wisdom?   Skill (not command)                  
    Needs isolation?     Subagent                             
╚═══════════════════════════════════════════════════════════════╝

Changelog

The reference is a living document. Updates are applied as Claude Code evolves.

Date Change Source
2026-02-25 Guide v2.9: Added v2.1.52–v2.1.56 bug fixes. Fixed Agent Teams navigation (Shift+Down only, not Shift+Up/Down). Added team storage paths and task dependency details. Added TeammateIdle/TaskCompleted hook integration notes. 106
2026-02-25 Added: v2.1.53–v2.1.56—VS Code crash fixes on Windows, fixed UI flicker where input briefly disappeared after submission, fixed bulk agent kill (Ctrl+F) to send single aggregate notification, fixed graceful shutdown leaving stale sessions with Remote Control, fixed --worktree sometimes ignored on first launch, fixed BashTool EINVAL on Windows, fixed crashes on Windows ARM64 and in WASM interpreter on Linux/Windows x64. 106
2026-02-23 Guide v2.8: Added v2.1.51 features. claude remote-control subcommand for external builds. HTTP hook security: allowedEnvVars required for env var interpolation in headers; HTTP hooks routed through sandbox proxy. Tool result disk persistence threshold lowered to 50K chars (was 100K). BashTool skips login shell by default. Plugin improvements: custom npm registries, version pinning, configurable git timeout. /model picker shows human-readable labels. SDK caller identity env vars. Agent Teams plan approval for teammates. 105
2026-02-24 Added: v2.1.51—claude remote-control subcommand for external builds, allowedEnvVars for HTTP hook env var interpolation security, HTTP hooks routed through sandbox network proxy, tool results >50K chars persisted to disk (was 100K), BashTool skips login shell by default, plugin marketplace git timeout configurable (CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS), custom npm registries and version pinning for plugins, /model picker human-readable labels, CLAUDE_CODE_ACCOUNT_UUID/CLAUDE_CODE_USER_EMAIL/CLAUDE_CODE_ORGANIZATION_UUID SDK env vars, statusLine/fileSuggestion hooks require workspace trust. Fixes: duplicate control_response API 400 errors, slash command autocomplete crash on YAML array SKILL.md descriptions. 105
2026-02-22 Guide v2.7: Fixed fast mode pricing table — removed incorrect >200K tiered pricing ($60/$225). Official Anthropic pricing confirms flat $30/$150 across full context window with no long context surcharge. Added web fetch (free) to Hidden Tool Fees table. Added code execution free when web_search/web_fetch tools included. Added failed web searches not billed. 1
2026-02-21 Guide v2.6: Added v2.1.49 and v2.1.50 features. New hook events: ConfigChange, WorktreeCreate, WorktreeRemove (17 total). New --worktree/-w flag for isolated git worktrees. Subagent isolation: "worktree" and background: true fields. claude agents CLI command. CLAUDE_CODE_DISABLE_1M_CONTEXT env var. Opus 4.6 fast mode now includes full 1M context. Claude Code Security (research preview).
2026-02-20 Added: v2.1.50—startupTimeout for LSP servers, WorktreeCreate/WorktreeRemove hook events for custom VCS setup/teardown, isolation: worktree in agent definitions, claude agents CLI command, CLAUDE_CODE_DISABLE_1M_CONTEXT env var, Opus 4.6 fast mode now includes full 1M context window, VSCode /extra-usage command support. CLAUDE_CODE_SIMPLE now disables MCP tools, attachments, hooks, and CLAUDE.md loading. Fixes: symlink session invisibility, session data loss on SSH disconnect, memory leak in agent teams (completed tasks not GC’d), /mcp reconnect freezing for non-existent servers, LSP diagnostic data memory leak, prompt suggestion cache regression, Edit tool Unicode curly quote corruption. Linux: fixed native modules on glibc < 2.30 (RHEL 8). Multiple memory optimization improvements for long sessions. 103
2026-02-19 Added: v2.1.49—--worktree (-w) flag to start Claude in an isolated git worktree, subagents support isolation: "worktree" for temporary git worktree work, agent definitions support background: true to always run as background task, ConfigChange hook event for enterprise security auditing, plugins can ship settings.json for default configuration, SDK model info now includes supportsEffort/supportedEffortLevels/supportsAdaptiveThinking fields. CLAUDE_CODE_SIMPLE now includes file edit tool. Sonnet 4.5 with 1M context removed in favor of Sonnet 4.6. Improved MCP OAuth with step-up auth and discovery caching. Fixes: Ctrl+C and ESC ignored with background agents, unbounded WASM memory growth, disableAllHooks managed settings hierarchy, --resume showing raw XML tags. Improved permission prompts to show restriction reasons. 103
2026-02-20 Claude Code Security (research preview): Vulnerability scanning built into Claude Code on the web. Scans codebases and suggests patches for human review. Available to Enterprise, Team, and open-source maintainers. 104
2026-02-18 Added: v2.1.47—Ctrl+F kills all background agents (replaces double-ESC), last_assistant_message field in Stop/SubagentStop hook inputs, chat:newline keybinding action, added_dirs in statusline JSON, /rename updates terminal tab title, resume picker shows 50 sessions (was 10), teammate navigation simplified to Shift+Down only. Performance: ~500ms startup improvement (deferred SessionStart hooks), memory improvements (releasing API stream buffers, O(n²) progress update fix). Fixes: plan mode preserved after compaction, Edit tool Unicode curly quote corruption, CJK wide character alignment, concurrent agent API 400 errors, /resume dropping large sessions (>16KB), session name lost after compaction, background agent results returning raw transcript, many Windows fixes (hooks via Git Bash, CWD tracking cleanup, drive letter casing, BMP paste on WSL2). 102
2026-02-18 Added: v2.1.46—claude.ai MCP connectors support in Claude Code, fixed orphaned CC processes after terminal disconnect on macOS. v2.1.45—spinnerTipsOverride setting, SDKRateLimitInfo/SDKRateLimitEvent SDK types, fixed Agent Teams on Bedrock/Vertex/Foundry, fixed sandbox temp file errors on macOS, startup and memory improvements. 102
2026-02-18 Guide v2.5: Added Ctrl+F and Shift+Down to keyboard shortcuts, spinnerTipsOverride to settings reference, last_assistant_message hook field, chat:newline keybinding, claude.ai MCP connectors section, resume picker 50-session update.
2026-02-17 MAJOR: Claude Sonnet 4.6 released. Model ID: claude-sonnet-4-6. Replaces Sonnet 4.5 as default model on claude.ai and Claude Cowork. Same pricing ($3/$15 per MTok). Improved agentic search performance with fewer tokens. Supports adaptive thinking, extended thinking, and 1M token context window (beta). 64K max output. Knowledge cutoff: reliable Aug 2025, training Jan 2026. Sonnet 4.5 moved to legacy. Also: API code execution now free with web search/web fetch, web search tool and programmatic tool calling now GA (no beta header). 100
2026-02-17 Guide v2.4: Updated all model tables for Sonnet 4.6, added Sonnet 4.6 to extended thinking supported models, updated footnotes and pricing references.
2026-02-14 Added: v2.1.44—fixed ENAMETOOLONG errors for deeply-nested directory paths, fixed auth refresh errors. v2.1.43—fixed AWS auth refresh hanging (3-min timeout), fixed spurious warnings for non-agent markdown files in .claude/agents/, fixed structured-outputs beta header sent unconditionally on Vertex/Bedrock. 101
2026-02-16 Guide v2.3: Removed expired fast mode promo pricing (Feb 16 deadline passed), added >200K long-context fast mode tier ($60/$225), fixed protect-files.sh exit code (1→2 for blocking), fixed 3 stale Tab→Alt+T keybinding references, rewrote Copilot/Cursor migration tables (both now have agentic CLI+MCP), fixed Claude Squad install commands (brew/curl, cs binary, TUI app), added 4 missing ToC entries (Output Styles, Slash Commands, Plugin System), updated 7 footnote URLs (docs.anthropic.com→code.claude.com canonical), added 55 missing URL, fixed 9 redirect note, added managed settings keys table (allowManagedPermissionRulesOnly, allowManagedHooksOnly, etc.), added prompt injection security warning for untrusted repos. Added Quick Start section, dedicated Plan Mode section, expanded non-interactive mode (-p) documentation with exit codes and CI/CD patterns, fixed all --session-id examples (requires UUID; migrated to /rename + --resume), added [RESEARCH PREVIEW] markers to Remote & Slack sections, tagged 1 untagged code block, verified all 35 ToC anchors. Post-evaluation fixes: TL;DR model recommendation made tier-neutral, jq // pattern fixed to select(), --input-file fabricated flag replaced with pipe, Docker sandbox syntax corrected, “sub-agent” hyphenation unified to “subagent”, added /login and /logout to slash commands table.
2026-02-13 Added: v2.1.42—fix for /resume showing interrupt messages as session titles, fixed Opus 4.6 launch announcement showing for Bedrock/Vertex/Foundry users, improved error message for many-image dimension limit errors with /compact suggestion. 97
2026-02-13 Added: v2.1.41—claude auth subcommands (login, status, logout) for authentication management without entering REPL, Windows ARM64 native binary support, /rename auto-generates session name from conversation context when called without arguments. Fixes: AWS auth refresh hanging indefinitely (3-min timeout added), @-mentions with anchor fragments (e.g., @README.md#installation), FileReadTool blocking on FIFOs//dev/stdin/large files, background task notifications in streaming Agent SDK mode, cursor jumping in classifier rule input, markdown link display text dropped for raw URLs, auto-compact failure notifications shown to users, permission wait time included in subagent elapsed time, proactive ticks firing in plan mode, stale permission rules not cleared on settings change, hook blocking errors showing stderr in UI. 97
2026-02-12 Accuracy & completeness pass: Fixed hooks table—Stop, SubagentStop, TeammateIdle, TaskCompleted can all block via exit code 2. Added PostToolUseFailure event. Added prompt-based hooks (type: "prompt") and agent-based hooks (type: "agent") documentation. Updated PreToolUse to preferred hookSpecificOutput format (deprecated top-level decision). Added hook environment variables ($CLAUDE_PROJECT_DIR, $CLAUDE_ENV_FILE). Added CLI --agents flag for session-scoped subagent definitions. Expanded subagent config table: disallowedTools, maxTurns, mcpServers, hooks, delegate permission mode. 96
2026-02-10 Added: v2.1.39—improved terminal rendering performance. Fixes: fatal errors being swallowed instead of displayed, process hanging after session close, character loss at terminal screen boundary, blank lines in verbose transcript view. 95
2026-02-10 Added: v2.1.38—security: blocked writes to .claude/skills in sandbox mode (prevents prompt injection from modifying skill definitions), improved heredoc delimiter parsing to prevent command smuggling. Fixes: VS Code terminal scroll-to-top regression, Tab key queueing slash commands instead of autocompleting, bash permission matching for commands using environment variable wrappers, text between tool uses disappearing in non-streaming mode, duplicate sessions when resuming in VS Code. 95
2026-02-08 Added: v2.1.37—fixed /fast not immediately available after enabling /extra-usage. 93
2026-02-08 Added: v2.1.36—Fast mode now available for Opus 4.6. Same model, faster output at premium pricing (6x standard rates, 50% promo discount through Feb 16). Toggle with /fast. 93
2026-02-07 Added: v2.1.34—security fix: commands excluded from sandboxing via sandbox.excludedCommands or dangerouslyDisableSandbox could bypass the Bash ask permission rule when autoAllowBashIfSandboxed was enabled. Also fixed crash when agent teams setting changed between renders. 94
2026-02-05 Added: v2.1.33—TeammateIdle and TaskCompleted hook events for multi-agent workflows, Task(agent_type) syntax to restrict spawnable subagents in agent tools frontmatter, memory frontmatter field for agents (user/project/local scope), plugin name shown in skill descriptions and /skills menu. Fixes: agent teammate sessions in tmux not sending/receiving messages, agent teams availability warnings on unsupported plans, extended thinking interruption when submitting new messages, API errors on mid-stream abort with whitespace+thinking blocks, API proxy 404 streaming fallback, proxy settings from settings.json env vars not applied to WebFetch, /resume session picker showing raw XML markup. Improved: API connection error messages now show specific cause (ECONNREFUSED, SSL errors). VSCode: remote session support for OAuth users, git branch + message count in session picker with branch search, scroll-to-bottom fix. 92
2026-02-05 MAJOR: Claude Opus 4.6 released. Model ID: claude-opus-4-6. 1M token context window (beta)—first Opus-class model with this capacity. 128K max output tokens. Adaptive thinking (auto reasoning depth). Effort controls (low/medium/high/max). Context compaction beta. Agent teams research preview (multi-agent parallel coordination). Terminal-Bench 2.0 highest industry score. GDPval-AA: +144 Elo over GPT-5.2, +190 over Opus 4.5. 76% accuracy on 8-needle 1M MRCR v2 (competitors ~18.5%). Found 500+ zero-day vulnerabilities in open-source code out-of-the-box. Same pricing as Opus 4.5: $5/$25 per MTok. Long context (>200K input): $10/$37.50. 86
2026-02-05 Added: v2.1.32—Opus 4.6 support, agent teams research preview (requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1), automatic memory recording/recall, “Summarize from here” in message selector for partial conversation summarization, skills from --add-dir directories loaded automatically, skill character budget scales with context window (2% of context). Fixes: @ file completion incorrect relative paths in subdirectories, --resume now re-uses --agent value from previous session, bash “Bad substitution” errors with JavaScript template literals in heredocs, Thai/Lao spacing vowels rendering. VSCode: slash command execution fix, spinner for past conversations list. 87
2026-02-04 GitHub integration: Claude and Codex now available in public preview on GitHub—available as coding agents for Copilot Pro+ and Enterprise customers via Agent HQ. Opus 4.6 generally available for GitHub Copilot.90 90
2026-02-04 Added: v2.1.31—session resume hint on exit showing how to continue, Japanese IME full-width (zenkaku) space input in checkbox selection. Fixes: PDF errors permanently locking sessions, bash “read-only file system” errors in sandbox mode, plan mode crash with missing ~/.claude.json fields, temperatureOverride silently ignored in streaming API, LSP shutdown compatibility. Improved: system prompts guide model toward dedicated tools (Read, Edit, Glob, Grep) over bash equivalents, PDF/request size error messages (100 pages, 20MB limits). 82
2026-02-03 Added: v2.1.30—PDF pages parameter for Read tool (read specific page ranges e.g. pages: "1-5"), large PDFs (>10 pages) return lightweight reference when @-mentioned, pre-configured OAuth client credentials for MCP servers without DCR (e.g., Slack), /debug command for troubleshooting, additional git log/git show flags in read-only mode, token count/tool uses/duration metrics in Task tool results, reducedMotion config option. 68% memory reduction for --resume via stat-based session loading. Fixes: phantom “(no content)” text blocks in API history (reduces token waste), prompt cache invalidation for tool changes, 400 errors after /login with thinking blocks, hang on corrupted transcript resume, rate limit messaging for Max 20x, permission dialogs stealing focus, subagents unable to access SDK-provided MCP tools, Windows bash with .bashrc. 83
2026-01-31 Added: v2.1.29—fixed startup performance regression when resuming sessions with saved_hook_context. 92
2026-02-01 Enterprise adoption: ServiceNow chose Claude as default model for ServiceNow Build Agent, rolling out Claude Code to 29,000+ employees—cutting seller preparation time by 95%. Allianz announced partnership making Claude Code available to all employees. 84
2026-01-30 Breaking: Xcode 26.3 introduces native Claude Agent SDK integration—same harness that powers Claude Code—enabling subagents, background tasks, and plugins directly in Xcode without leaving the IDE. Captures Xcode Previews during SwiftUI development for visual iteration. 85
2026-01-30 Added: v2.1.27—--from-pr flag to resume sessions linked to GitHub PR numbers/URLs, sessions auto-linked to PRs when created via gh pr create, tool call failures/denials in debug logs, VSCode Claude in Chrome integration enabled. Fixes: context management validation for gateway users, /context colored output, status bar duplicating background task indicator, permissions precedence (content-level ask > tool-level allow). Windows: bash execution with .bashrc, console window flashing. VSCode: OAuth token expiration causing 401 errors. 81
2026-01-29 Added: v2.1.25—fixed beta header validation error for Bedrock and Vertex gateway users. Workaround: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1. 80
2026-01-28 Added: v2.1.23—spinnerVerbs setting for customizable spinner text, mTLS/proxy connectivity fix for corporate environments, per-user temp directory isolation, ripgrep timeout error reporting (was silently returning empty results), merged PR purple status indicator in prompt footer, bash timeout duration display. Fixes: prompt caching race condition, pending async hooks not cancelled in headless mode, tab completion not updating input, Bedrock region display in headless mode. 76
2026-01-28 Added: v2.1.22—fixed structured outputs for non-interactive (-p) mode. 75
2026-01-28 Added: v2.1.21—Python venv auto-activation in VSCode (claudeCode.usePythonEnvironment setting), Japanese IME full-width (zenkaku) number input support, Read/search progress indicators (“Reading…” → “Read”), Claude now prefers file operation tools over bash equivalents. Fixes: shell completion cache truncation on exit, API errors when resuming sessions interrupted during tool execution, auto-compact triggering too early on models with large output limits, task ID reuse after deletion, Windows file search in VSCode. 74
2026-01-28 Added: MCP Apps (interactive tool UIs inside Claude for Asana, Figma, Slack, etc.). Code Execution Tool v2 (Bash execution replacing Python-only, programmatic tool calling). Claude Code on the web expanded to Team/Enterprise premium seats. 737879
2026-01-27 Added: v2.1.20—--add-dir flag for loading CLAUDE.md from additional directories (requires CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1), PR review status indicator in prompt footer (colored dot showing approved/changes requested/pending/draft), task deletion via TaskUpdate tool, vim arrow key history navigation, /copy command available to all users, timestamped config backups (rotated, keeping 5 most recent). Fixes: session compaction loading full history on resume, agents ignoring user messages while working, wide character (emoji/CJK) rendering artifacts, JSON parsing with Unicode in MCP responses. 72
2026-01-26 Enhanced: Analytics API section with detailed endpoint documentation, metrics table, curl example, and limitations. Now includes authentication requirements, available metrics (productivity, tool usage, cost), and real-time monitoring alternatives. 53
2026-01-24 Added: v2.1.19—$0, $1 shorthand for custom command arguments (changed from $ARGUMENTS.0 to $ARGUMENTS[0] bracket syntax), CLAUDE_CODE_ENABLE_TASKS env var to disable new task system, skills without additional permissions/hooks no longer require approval. VSCode: session forking and rewind enabled for all users. SDK: queued_command replay as SDKUserMessageReplay events. Fixes: dangling processes on terminal close, /rename//tag in git worktrees, pasted text lost with prompt stash (Ctrl+S), agent model display, backgrounded hook commands not returning early, file write preview omitting empty lines. 71
2026-01-24 Added: v2.1.17—fixed crashes on processors without AVX instruction support. 71
2026-01-24 Breaking: Extended thinking now enabled by default with 31,999 tokens. Natural language triggers (think, think hard, ultrathink) are deprecated and no longer allocate thinking tokens—use MAX_THINKING_TOKENS env var or /config instead. Updated Extended Thinking section with current behavior. 70
2026-01-24 Added: v2.1.18—customizable keyboard shortcuts with context-specific keybindings, chord sequences, and full personalization via /keybindings command. Configuration stored in ~/.claude/keybindings.json. 77
2026-01-24 Added: v2.1.16—task management system with dependency tracking, VSCode native plugin management support, OAuth users can browse/resume remote sessions from Sessions dialog. Fixes: out-of-memory crashes with subagent resumption, /compact warning visibility, session titles language setting, Windows IDE race condition. 69
2026-01-21 Added: v2.1.15—npm installation deprecation notice (native binary preferred), React Compiler UI performance improvements. Fixes: /compact warning not clearing, MCP stdio server timeout not killing child process (could cause UI freezes). 68
2026-01-20 Added: v2.1.14—history-based autocomplete in bash mode (! + Tab), plugin search in installed list, pin plugins to git commit SHAs, VSCode /usage command. Critical fixes: context window blocking limit (~65%→~98%), memory crashes with parallel subagents, memory leak in long sessions, @ symbol file autocomplete in bash mode, /feedback invalid URLs, /context token count display, slash command autocomplete wrong selection. 67
2026-01-20 Added: v2.1.12 (message rendering bug fix). Corrected Setup hook version to v2.1.10 with full release notes: ‘c’ keyboard shortcut for OAuth URL copy, improved startup keystroke capture, file suggestions as removable attachments, VSCode plugin install counts and trust warnings. Added teleport one-way limitation note. 66
2026-01-19 Documentation refresh: Added SubagentStart hook to events table, expanded additionalContext documentation for PreToolUse hooks (v2.1.9), expanded LSP tool capabilities section, enhanced People to Follow with content creators and official resources.
2026-01-19 Added: Setup hook event (v2.1.10)—triggered via --init, --init-only, or --maintenance CLI flags for environment setup tasks. 60
2026-01-18 Added: Multiple Accounts Policy section (what’s allowed, technical limits, what’s prohibited). Added Community Tips section (plan mode auto-clear context, /clear, screenshots, container patterns). Added People to Follow (Boris Cherny, Thariq, Jeffrey Emanuel). Added API token pricing table. 56575859
2026-01-17 Added: v2.1.11 release—fixes excessive MCP connection requests for HTTP/SSE transports (stability improvement for heavy MCP users). 55
2026-01-16 Added: MCP Tool Search section with benchmarks (Opus 4: 49%→74%, Opus 4.5: 79.5%→88.1%, 85% token overhead reduction). Updated MCP ecosystem stats (100M monthly downloads, 3,000+ servers). 54
2026-01-16 Added: Claude Code Analytics API section—programmatic access to usage metrics (sessions, commits, PRs, lines of code) for Team/Enterprise via Admin API endpoint /v1/organizations/usage_report/claude_code. Documented ${CLAUDE_SESSION_ID} skill substitution (v2.1.9). 5153
2026-01-15 Added: v2.1.9 auto:N syntax for MCP tool search threshold, plansDirectory setting, external editor (Ctrl+G) in AskUserQuestion, session URL attribution for web session commits/PRs, PreToolUse hooks additionalContext. Fixed parallel tool calls API errors, MCP reconnection hanging, Ctrl+Z in Kitty. Added Cowork (GUI version for non-technical users). 5152
2026-01-15 Added: v2.1.7 permission feedback feature (provide feedback when accepting permission prompts). GitHub Action v1.0 GA release. Minor documentation refresh. 48
2026-01-14 Added: v2.1.7 MCP tool search auto mode enabled by default (defers tools >10% context), showTurnDuration setting, inline agent response in task notifications, security fix for wildcard permissions matching compound commands. v2.1.6: /config search, /doctor Updates section, /stats date range filtering, nested .claude/skills discovery, context_window.used_percentage/remaining_percentage fields, security fix for shell line continuation permission bypass. v2.1.5: CLAUDE_CODE_TMPDIR env var. 484950
2026-01-13 Added: URL change from console.anthropic.com to platform.claude.com (v2.1.4). Added context: fork skill frontmatter option for isolated contexts. Added permission denial resilience for subagents (v2.1.0+). Added plugin marketplace launch info (36 curated plugins Dec 2025). 47
2026-01-12 Added: v2.1.4 CLAUDE_CODE_DISABLE_BACKGROUND_TASKS environment variable to disable all background task functionality including auto-backgrounding and Ctrl+B shortcut. Fixed OAuth token refresh for “Help improve Claude” setting. 46
2026-01-10 Added: Sandboxing reduces permission prompts by 84% (from Anthropic engineering blog), Opus 4.5 SWE-bench performance (80.9%) and token efficiency improvements. Minor documentation refresh. 45
2026-01-10 Added: v2.1.3 merged slash commands and skills (unified mental model), release channel toggle (stable/latest) in /config, /doctor detects unreachable permission rules, hook execution timeout increased from 60s to 10 minutes. Bug fixes: plan files persisting across /clear, skill duplicate detection on ExFAT, background task count mismatch, subagents using wrong model during compaction. VSCode: clickable destination selector for permissions. 44
2026-01-09 Added: v2.1.1 (109 CLI refinements), Component-Scoped Hooks (hooks in skill/command frontmatter with once option), new MCP servers (Figma Dev Mode, Sequential Thinking, Magic UI, Context7). Updated MCP ecosystem count to 3,000+ servers. 414243
2026-01-08 Added: language and respectGitignore settings to settings.json reference. Added IS_DEMO env var. Updated multiline input to show Shift+Enter works out-of-box in iTerm2/WezTerm/Ghostty/Kitty. Added 1,550 free code execution hours per org/month. 3740
2026-01-08 Added: v2.1.2 clickable file paths in tool output (OSC 8 for iTerm), Windows Package Manager (winget) support, Shift+Tab for “auto-accept edits” in plan mode, FORCE_AUTOUPDATE_PLUGINS env var, agent_type field in SessionStart hook. Security fixes: command injection in bash processing, memory leak from tree-sitter. Updated thinking toggle to Alt+T. Added MCP wildcard permission syntax (mcp__server__*). Added PreToolUse hooks updatedInput with ask permission. 39
2026-01-07 Added: v2.1.0 automatic skill hot-reload (skills in ~/.claude/skills or .claude/skills immediately available without restart). Security: CVE-2025-52882 WebSocket authentication bypass patched in IDE extensions v1.0.24+ 3738
2026-01-06 Added: v2.0.74 clickable image links ([Image #N]), /context grouped display, file @ mentions 3x faster in git repos, .ignore and .rgignore support, Claude Agent SDK v0.1.74 343536
2025-12-28 Added: Named sessions (/rename, /resume <n>), plugin discover search filtering, --fork-session with custom session IDs, Agent Skills section, async subagents, Claude Agent SDK (renamed from Claude Code SDK), Alt+Y yank-pop, Alt+T thinking toggle, Ctrl+T syntax highlighting toggle, holiday promotion (2× limits Dec 25-31) 2930313233
2025-12-24 Added: Claude in Chrome section, Claude Code in Slack section, LSP tool, remote MCP OAuth support, ‘ultrathink’ command, /theme and /plugin commands, terminal support for Kitty/Alacritty/Zed/Warp 232425262728
2025-12-14 Added: Pro users Opus 4.5 access, subscription plans table, rate limits (August 2025), iOS app availability 202122
2025-12-12 Added: Background Agents section, Output Styles section, hidden tool fees, /stats, /fork, /rename, /statusline, /tasks commands, .claude/rules/ memory directory, Batch API tip 16171819
2025-12-12 Added: Slack integration, prompt suggestions, Alt+P model switching, /release-notes command, /rewind command, interactive MCP setup wizard 131415
2025-12-12 Initial 10.0 version: Architecture mental model, decision frameworks, anti-patterns, workflow recipes, migration guide, quick reference card

Run /update-cc-guide to scan for and apply the latest Claude Code updates.


References


  1. Anthropic Pricing. “Claude API Pricing.” December 2025. 

  2. Claude Code Subagents. “Subagents Documentation.” December 2025. 

  3. MCPcat. “MCP Server Downloads Growth Statistics.” December 2025. 

  4. Claude Code Docs. “Claude Code Documentation.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  5. Claude Code Docs. “CLI Reference.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  6. Claude Code Docs. “Settings Documentation.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  7. Claude Code Docs. “Hooks Guide.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  8. Claude Code Docs. “MCP Documentation.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  9. Anthropic. “Claude Code Best Practices.” April 2025. Note: Original URL now redirects to code.claude.com/docs (content merged into main docs). See also Claude Code Docs

  10. Anthropic. “Remote MCP Support.” December 2025. 

  11. Anthropic. “Building Agents with Claude Agent SDK.” December 2025. 

  12. GitHub. “Claude Code GitHub Action.” December 2025. 

  13. Claude Code CHANGELOG. “Prompt suggestions: Claude now suggests what you might want to do next.” December 16, 2025. See also TechCrunch for December 2025 feature coverage. 

  14. Anthropic. “Claude Slack Integration.” December 2025. 

  15. Claude Code Docs. “Interactive MCP Setup.” Redirected from docs.anthropic.com December 2025; canonical URL updated February 2026. 

  16. Northflank. “Claude Code Hidden Tool Fees.” July 2025. 

  17. Anthropic. “Background Agents.” December 2025. 

  18. Claude Code Docs. “Memory Rules Directory.” December 2025. 

  19. GitHub. “Output Styles Release.” December 2025. 

  20. GitHub CHANGELOG. “Pro users now have access to Opus 4.5 as part of their subscription.” December 2025. 

  21. Northflank. “Rate Limit Changes August 2025.” July 2025. 

  22. Claude Blog. “Claude Code on the Web and iOS App.” November 2025. 

  23. Claude Blog. “Claude Code on the Web for Team and Enterprise Users.” November 2025. 

  24. GitHub Releases. “Claude in Chrome (Beta) feature.” December 2025. 

  25. GitHub Releases. “LSP tool and terminal support updates (v2.0.74).” December 2025. 

  26. TechCrunch. “Claude Code in Slack announcement.” December 2025. 

  27. GitHub Releases. “Thinking mode triggers: think, think harder, ultrathink.” December 2025. 

  28. Anthropic. “Remote MCP Support with OAuth.” June 2025. 

  29. GitHub Releases. “Named sessions with /rename and /resume.” December 2025. 

  30. GitHub Releases. “Plugin discover search filtering, custom session IDs with –fork-session (v2.0.73-74).” December 2025. 

  31. Anthropic Engineering. “Agent Skills: reusable task-specific modules.” December 2025. 

  32. Anthropic Engineering. “Claude Agent SDK (renamed from Claude Code SDK).” December 2025. 

  33. Apidog. “Claude Code 2× usage limits for Pro/Max subscribers Dec 25-31, 2025.” December 2025. 

  34. GitHub Releases. “v2.0.73-74: Clickable image links, /context grouped display, ctrl+t syntax highlighting toggle.” January 2026. 

  35. GitHub Releases. “v2.0.72: @ mention file suggestions 3x faster in git repos, .ignore and .rgignore file support.” January 2026. 

  36. GitHub Claude Agent SDK. “Claude Agent SDK v0.1.74 in parity with Claude Code v2.0.74.” January 2026. 

  37. GitHub Releases. “v2.1.0: Automatic skill hot-reload, language setting for response language, respectGitignore in settings.json, IS_DEMO env var, Shift+Enter works out-of-box in iTerm2/WezTerm/Ghostty/Kitty.” January 2026. 

  38. Datadog Security Labs. “CVE-2025-52882: WebSocket authentication bypass in Claude Code IDE extensions patched in v1.0.24+.” January 2026. 

  39. GitHub Releases. “v2.1.2: Clickable file paths (OSC 8), winget support, Shift+Tab auto-accept in plan mode, FORCE_AUTOUPDATE_PLUGINS, agent_type in SessionStart hook, security fixes (command injection, memory leak), thinking toggle changed to Alt+T, MCP wildcard permissions, PreToolUse updatedInput with ask.” January 2026. 

  40. Anthropic Pricing. “Each organization receives 1,550 free hours of usage with the code execution tool per month.” January 2026. 

  41. VentureBeat. “Claude Code 2.1.0 introduces infrastructure-level features. Hooks for agents, skills, and slash commands with scoped PreToolUse, PostToolUse, and Stop logic.” January 2026. Medium. “Claude Code 2.1.1 shipped with 109 CLI refinements.” 

  42. Builder.io. “Figma’s official Dev Mode MCP server exposes the live structure of the layer you have selected—hierarchy, auto‑layout, variants, text styles, and token references.” December 2025. 

  43. Apidog. “Sequential Thinking MCP server enables Claude to methodically work through problems with structured, reflective thinking process.” January 2026. MCP.so. “Over 3,000 MCP servers indexed.” 

  44. GitHub Releases. “v2.1.3: Merged slash commands and skills, release channel toggle in /config, /doctor unreachable permission detection, hook timeout increased to 10 minutes.” January 2026. 

  45. Anthropic. “Sandboxing safely reduces permission prompts by 84%.” January 2026. Anthropic. “Claude Opus 4.5 achieves 80.9% on SWE-bench Verified while cutting token usage in half.” 

  46. GitHub Releases. “v2.1.4: Added CLAUDE_CODE_DISABLE_BACKGROUND_TASKS environment variable, fixed OAuth token refresh for ‘Help improve Claude’ setting.” January 2026. 

  47. VentureBeat. “Claude Code 2.1.0: Forked sub-agent context via context: fork in skill frontmatter, agents continue after permission denial.” January 2026. GitHub ykdojo/claude-code-tips. “Anthropic officially launched the plugin marketplace in December 2025 with 36 curated plugins.” 

  48. GitHub Releases. “v2.1.7: MCP tool search auto mode enabled by default, showTurnDuration setting, inline agent response in task notifications, security fix for wildcard permissions.” January 2026. 

  49. GitHub Releases. “v2.1.6: /config search, /doctor Updates section, /stats date range filtering, nested skills discovery, context_window percentage fields, shell line continuation security fix.” January 2026. 

  50. GitHub Releases. “v2.1.5: CLAUDE_CODE_TMPDIR environment variable to override temp directory.” January 2026. 

  51. GitHub Releases. “v2.1.9: Added auto:N syntax for MCP tool search threshold, plansDirectory setting, external editor (Ctrl+G) in AskUserQuestion, session URL attribution to commits/PRs, PreToolUse hooks additionalContext. Fixed parallel tool calls API errors, MCP reconnection hanging, Ctrl+Z in Kitty.” January 2026. 

  52. Wikipedia. “A version called ‘Cowork’ with a graphical user interface, aimed at non-technical users, [launched] in January 2026.” January 2026. 

  53. Claude Docs. “Programmatically access your organization’s Claude Code usage analytics and productivity metrics with the Claude Code Analytics Admin API.” January 2026. 

  54. VentureBeat. “MCP Tool Search: Opus 4 accuracy improved from 49% to 74%, Opus 4.5 from 79.5% to 88.1%. Boris Cherny: ‘Every Claude Code user just got way more context.’” January 2026. Anthropic. “MCP has reached 100M monthly downloads and become the industry standard.” January 2026. 

  55. GitHub Releases. “Claude Code v2.1.11: Fixed excessive MCP connection requests for HTTP/SSE transports.” January 17, 2026. 

  56. Medium. “Boris Cherny: 259 PRs, 497 commits, 40k lines added, 38k removed in 30 days using Claude Code.” January 2026. 

  57. Anthropic Pricing. “API Token Pricing: Haiku 4.5 ($1/$5), Sonnet 4.6 ($3/$15), Opus 4.6 ($5/$25).” February 2026. 

  58. GitHub ykdojo/claude-code-tips. “Community tips collection: plan mode, /clear often, screenshots, GitHub app for PRs.” January 2026. 

  59. Anthropic Usage Policy. Multiple accounts policy. Anthropic Support. “You can verify up to three accounts with the same phone number. Multiple paid subscriptions from the same network are supported.” January 2026. 

  60. GitHub Releases. “v2.1.10: Added Setup hook event triggered via –init, –init-only, or –maintenance CLI flags; ‘c’ keyboard shortcut to copy OAuth URL during login; improved startup keystroke capture; file suggestions as removable attachments; VSCode plugin install counts and trust warnings.” January 17, 2026. 

  61. @adocomplete. “Day 15 of Advent of Claude: –dangerously-skip-permissions flag (YOLO mode) for fully autonomous operation.” January 2026. 

  62. @adocomplete. “Claude Max subscribers get 3 guest passes to share Claude Code Pro trial with others via /passes command.” January 2026. 

  63. @mattpocockuk. “Docker sandbox mode for safe exploration of untrusted codebases.” January 2026. 

  64. Daisy Hollman. “Overnight hooks strategy: use linting and testing hooks as guardrails to keep Claude iterating until tests pass.” January 2026. 

  65. @moofeez. “Claude Squad: Multi-agent manager for parallel Claude Code instances in isolated worktrees.” January 2026. 

  66. GitHub Releases. “v2.1.12: Fixed message rendering bug.” January 17, 2026. 

  67. GitHub Releases. “v2.1.14: History-based autocomplete in bash mode, plugin search, pin plugins to git SHAs, VSCode /usage command. Fixes: context window blocking limit (~65%→~98%), memory crashes with parallel subagents, memory leak in long sessions, @ symbol file autocomplete, /feedback URLs, /context token count, slash command autocomplete.” January 20, 2026. 

  68. GitHub Releases. “v2.1.15: npm installation deprecation notice, React Compiler UI performance improvements. Fixes: /compact warning persistence, MCP stdio server timeout not killing child process (UI freeze fix).” January 21, 2026. 

  69. GitHub Releases. “v2.1.16: Task management system with dependency tracking, VSCode native plugin management, OAuth users can browse/resume remote sessions. Fixes: OOM crashes with subagent resumption, /compact warning visibility, session titles language, Windows IDE race condition.” January 22, 2026. 

  70. GitHub Issues. “Ultrathink is deprecated. Thinking mode is enabled by default with 31,999 tokens. Keywords like ‘think’, ‘think hard’, ‘ultrathink’ no longer allocate thinking tokens—use MAX_THINKING_TOKENS env var instead.” January 2026. Decode Claude. “UltraThink is Dead. Long Live Extended Thinking.” 

  71. GitHub Releases. “v2.1.19: $0/$1 shorthand for custom command arguments, CLAUDE_CODE_ENABLE_TASKS env var, VSCode session forking/rewind for all users. v2.1.17: Fixed crashes on processors without AVX instruction support.” January 23-24, 2026. 

  72. Claude Code Docs. “v2.1.20: –add-dir flag for loading CLAUDE.md from additional directories, PR review status indicator, task deletion via TaskUpdate, vim arrow key history navigation, /copy command for all users, timestamped config backups. Fixes: session compaction issues, agents ignoring user messages, wide character rendering, JSON parsing with Unicode.” January 27, 2026. 

  73. Anthropic. “Claude Code on the web is now available in research preview for Team and Enterprise users with premium seats, in addition to Pro and Max users.” January 26, 2026. 

  74. GitHub Releases. “v2.1.21: Japanese IME full-width number input, Python venv auto-activation in VSCode (claudeCode.usePythonEnvironment), Read/search progress indicators, Claude prefers file tools over bash. Fixes: shell completion cache, session resume API errors, auto-compact timing, task ID reuse, Windows file search.” January 27, 2026. 

  75. GitHub Releases. “v2.1.22: Fixed structured outputs for non-interactive (-p) mode.” January 27, 2026. 

  76. GitHub Releases. “v2.1.23: spinnerVerbs setting, mTLS/proxy connectivity fix, per-user temp directory isolation, ripgrep timeout reporting, merged PR purple indicator, bash timeout display. Fixes: prompt caching race condition, async hooks in headless, tab completion, Bedrock region strings.” January 28, 2026. 

  77. Claude Code Docs. “v2.1.18: Customizable keyboard shortcuts with context-specific keybindings, chord sequences, and personalization. Run /keybindings to configure.” January 22, 2026. 

  78. Help Net Security. “Anthropic added interactive tool support (MCP Apps) to Claude, enabling users to interact with Asana, Box, Canva, Figma, Hex, monday.com, and Slack directly inside the Claude interface.” January 26, 2026. 

  79. Anthropic Developer Platform. “Code Execution Tool v2 public beta: Bash command execution, file manipulation, and programmatic tool calling from within code execution.” January 2026. 

  80. GitHub Releases. “v2.1.25: Fixed beta header validation error for gateway users on Bedrock and Vertex. Workaround: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1.” January 29, 2026. 

  81. GitHub Releases. “v2.1.27: –from-pr flag for PR-linked sessions, auto-link sessions to PRs via gh pr create, tool call failures in debug logs, VSCode Claude in Chrome integration. Fixes: context management validation, /context colored output, status bar duplication, permissions precedence, Windows bash/.bashrc, Windows console flashing, VSCode OAuth 401 errors.” January 30, 2026. 

  82. GitHub Releases. “v2.1.31: Session resume hint, Japanese IME full-width space input, PDF too large errors permanently locking sessions fix, bash read-only file system errors in sandbox fix, temperatureOverride silently ignored fix, LSP shutdown compatibility, improved system prompts for dedicated tools over bash.” February 2026. 

  83. GitHub Releases. “v2.1.30: PDF pages parameter for Read tool, large PDFs return lightweight reference, pre-configured OAuth for MCP (Slack), /debug command, 68% memory reduction for –resume, phantom ‘(no content)’ text blocks fix, prompt cache invalidation fix, subagents access SDK MCP tools fix.” January 30, 2026. 

  84. Anthropic. “ServiceNow chose Claude as default model for ServiceNow Build Agent, rolling out Claude Code to 29,000+ employees—cutting seller preparation time by 95%.” January 2026. 

  85. IT Brief Asia. “Xcode 26.3 introduces native Claude Agent SDK integration—same harness that powers Claude Code—enabling subagents, background tasks, and plugins directly in Xcode.” January 2026. 

  86. Anthropic. “Introducing Claude Opus 4.6.” February 5, 2026. 1M token context (beta), 128K max output, adaptive thinking, effort controls, agent teams, Terminal-Bench 2.0 highest score, GDPval-AA +144 Elo over GPT-5.2, 500+ zero-day vulnerabilities found. $5/$25 per MTok. See also TechCrunch, CNBC, Anthropic Pricing

  87. GitHub Releases. “v2.1.32: Opus 4.6 support, agent teams research preview, automatic memory recording, Summarize from here, skills from –add-dir auto-loaded, skill character budget scales with context window, bash heredoc JS template literal fix, Thai/Lao rendering fix.” February 2026. 

  88. Dev Genius. “Claude Code async hooks: what they are and when to use them. Hooks can now run in the background without blocking Claude Code’s execution with async: true.” January 25, 2026. 

  89. Anthropic Engineering. “Making Claude Code more secure and autonomous.” Sandbox uses OS-level primitives (macOS seatbelt, Linux bubblewrap). Open-sourced at github.com/anthropic-experimental/sandbox-runtime. January 2026. 

  90. GitHub Blog. “Claude and Codex are now available in public preview on GitHub.” February 4, 2026. Also: GitHub Blog. “Claude Opus 4.6 is now generally available for GitHub Copilot.” February 5, 2026. 

  91. Claude Code Docs. “Orchestrate teams of Claude Code sessions.” February 5, 2026. Boris Cherny: “Out now: Teams, aka. Agent Swarms in Claude Code.” See also Lydia Hallie. “Claude Code now supports agent teams (in research preview)—a lead agent can delegate to multiple teammates that work in parallel to research, debug, and build while coordinating with each other.” 

  92. GitHub Releases. “v2.1.33: TeammateIdle and TaskCompleted hook events, Task(agent_type) sub-agent restriction syntax, memory frontmatter for agents, plugin name in skill descriptions. Fixes: tmux agent teammate sessions, agent teams plan warnings, extended thinking interruption, API proxy 404 fallback, proxy settings for WebFetch, /resume XML markup. VSCode: remote sessions for OAuth, git branch in session picker.” February 2026. 

  93. GitHub Releases. “v2.1.36: Fast mode now available for Opus 4.6.” February 7, 2026. Simon Willison. “Claude: Speed up responses with fast mode.” Fast mode pricing: 6x standard rates ($30/$150 per MTok for Opus 4.6 ≤200K input; $60/$225 for >200K input). Launch promo (50% discount) ran through Feb 16, 2026. v2.1.37: Fixed /fast not immediately available after enabling /extra-usage. Anthropic Pricing

  94. GitHub Releases. “v2.1.34: Fixed crash when agent teams setting changed between renders. Fixed bug where commands excluded from sandboxing could bypass Bash ask permission rule when autoAllowBashIfSandboxed was enabled.” February 6, 2026. 

  95. GitHub Releases. “v2.1.38: Fixed VS Code terminal scroll-to-top regression, Tab key slash command queueing, bash permission matching for env var wrappers, text disappearing between tool uses in non-streaming mode, duplicate sessions on resume in VS Code. Improved heredoc delimiter parsing to prevent command smuggling. Blocked writes to .claude/skills in sandbox mode.” February 10, 2026. v2.1.39: Improved terminal rendering performance, fixed fatal errors being swallowed, process hanging after session close, character loss at terminal boundary. 

  96. Claude Code Docs. “Hooks reference: prompt-based hooks, agent-based hooks, hook environment variables ($CLAUDE_PROJECT_DIR, $CLAUDE_ENV_FILE), hookSpecificOutput format for PreToolUse.” February 2026. Claude Code Docs. “Create custom subagents: –agents CLI flag, disallowedTools, maxTurns, mcpServers, delegate permission mode.” February 2026. 

  97. Claude Code GitHub Releases. v2.1.41 (Feb 13): claude auth subcommands, Windows ARM64 support, /rename auto-generation. v2.1.42 (Feb 13): /resume title fix, Bedrock/Vertex/Foundry announcement fix. 

  98. Anthropic. “Models overview.” All Claude 3.5 and Claude 4.x models support 200K token input context by default. Opus 4.6 extends this to 1M tokens in beta. 

  99. Claude Code Docs. “Getting started with Claude Code.” System requirements: macOS 10.15+, Ubuntu 20.04+/Debian 10+, Windows 10+ (WSL or Git Bash), 4 GB RAM minimum, active internet connection. 

  100. Anthropic. “Claude Sonnet 4.6.” February 17, 2026. Claude Developer Platform Release Notes. “Sonnet 4.6: improved agentic search, fewer tokens, extended thinking, 1M context (beta). Default model on claude.ai. Sonnet 4.5 moved to legacy.” Model ID: claude-sonnet-4-6. Anthropic Models Overview. “64K max output, knowledge cutoff: reliable Aug 2025 / training Jan 2026.” 

  101. Claude Code GitHub Releases. v2.1.43: AWS auth refresh 3-min timeout fix, spurious .claude/agents/ markdown warnings fix, structured-outputs beta header fix for Vertex/Bedrock. v2.1.44: ENAMETOOLONG fix for deeply-nested directories, auth refresh error fix. 

  102. Claude Code GitHub CHANGELOG. v2.1.45 (Feb 17): Sonnet 4.6 support, spinnerTipsOverride setting, SDKRateLimitInfo/SDKRateLimitEvent types, Agent Teams Bedrock/Vertex/Foundry fix, sandbox temp file fix. v2.1.46 (Feb 18): claude.ai MCP connectors in Claude Code, orphaned process fix on macOS. v2.1.47 (Feb 18): Ctrl+F kills background agents, last_assistant_message in Stop/SubagentStop hooks, chat:newline keybinding, added_dirs statusline field, /rename terminal tab title, resume picker 50 sessions, ~500ms startup improvement, memory improvements, CJK alignment fix, plan mode compaction fix, Edit tool Unicode fix, many Windows fixes. 

  103. Claude Code GitHub CHANGELOG. v2.1.49 (Feb 19): --worktree (-w) flag, isolation: "worktree" for subagents, background: true for agent definitions, ConfigChange hook event, MCP OAuth step-up auth, SDK supportsEffort/supportedEffortLevels/supportsAdaptiveThinking fields, CLAUDE_CODE_SIMPLE includes Edit tool, Sonnet 4.5 1M removed for Sonnet 4.6, WASM memory fix, permission restriction reasons. v2.1.50 (Feb 20): WorktreeCreate/WorktreeRemove hooks, startupTimeout for LSP servers, claude agents CLI command, CLAUDE_CODE_DISABLE_1M_CONTEXT env var, Opus 4.6 fast mode full 1M context, CLAUDE_CODE_SIMPLE disables MCP/hooks/CLAUDE.md, VSCode /extra-usage, agent teams memory leak fix, LSP diagnostic leak fix, Linux glibc < 2.30 fix, multiple memory optimizations. 

  104. Cyber Unit. “Claude Code Security: What Businesses Should Know About Anthropic’s AI-Powered Vulnerability Scanner.” February 20, 2026. Available as limited research preview for Enterprise, Team, and open-source maintainers. Anthropic. “Claude Code Security scans codebases for security vulnerabilities and suggests targeted patches for human review.” 

  105. GitHub Releases. “v2.1.51 (Feb 24): claude remote-control subcommand, allowedEnvVars for HTTP hook security, HTTP hooks through sandbox proxy, tool result disk persistence >50K chars, BashTool login shell skip, plugin npm registry/version pinning, /model human-readable labels, SDK caller identity env vars, statusLine/fileSuggestion workspace trust.” February 24, 2026. Claude Code Docs. “Agent Teams: plan approval for teammates, TeammateIdle/TaskCompleted quality hooks.” 

  106. GitHub Releases. “v2.1.52–v2.1.56 (Feb 24–25): VS Code Windows crash fixes, UI flicker fix, bulk agent kill aggregate notification, Remote Control stale session cleanup, –worktree first launch fix, BashTool EINVAL on Windows, Windows ARM64/WASM interpreter crash fixes.” February 25, 2026. Claude Code Docs. “Team config: ~/.claude/teams/{team-name}/config.json. Task list: ~/.claude/tasks/{team-name}/. Task dependencies auto-unblock. Shift+Down cycles teammates (wraps to lead).” 

NORMAL claude-code.md EOF