Skip to content

Claude How ToClaude How To

Advanced Features ​

Comprehensive guide to Claude Code's advanced capabilities including planning mode, extended thinking, auto mode, background tasks, permission modes, print mode (non-interactive), session management, interactive features, channels, voice dictation, remote control, web sessions, desktop app, task list, prompt suggestions, git worktrees, sandboxing, managed settings, and configuration.

Table of Contents ​

  1. Overview
  2. Planning Mode
  3. Extended Thinking
  4. Auto Mode
  5. Background Tasks
  6. Scheduled Tasks
  7. Permission Modes
  8. Headless Mode
  9. Session Management
  10. Interactive Features
  11. Voice Dictation
  12. Channels
  13. Chrome Integration
  14. Remote Control
  15. Web Sessions
  16. Desktop App
  17. Task List
  18. Prompt Suggestions
  19. Git Worktrees
  20. Sandboxing
  21. Managed Settings (Enterprise)
  22. Configuration and Settings
  23. Best Practices
  24. Additional Resources

Overview ​

Advanced features in Claude Code extend the core capabilities with planning, reasoning, automation, and control mechanisms. These features enable sophisticated workflows for complex development tasks, code review, automation, and multi-session management.

Key advanced features include:

  • Planning Mode: Create detailed implementation plans before coding
  • Extended Thinking: Deep reasoning for complex problems
  • Auto Mode: Background safety classifier reviews each action before execution
  • Background Tasks: Run long operations without blocking the conversation
  • Permission Modes: Control what Claude can do (default, acceptEdits, plan, auto, dontAsk, bypassPermissions)
  • Print Mode: Run Claude Code non-interactively for automation and CI/CD (claude -p)
  • Session Management: Manage multiple work sessions
  • Interactive Features: Keyboard shortcuts, multi-line input, and command history
  • Voice Dictation: Push-to-talk voice input with 20-language STT support
  • Channels: MCP servers push messages into running sessions (Research Preview)
  • Remote Control: Control Claude Code from Claude.ai or the Claude app
  • Web Sessions: Run Claude Code in the browser at claude.ai/code
  • Desktop App: Standalone app for visual diff review and multiple sessions
  • Task List: Persistent task tracking across context compactions
  • Prompt Suggestions: Smart command suggestions based on context
  • Git Worktrees: Isolated worktree branches for parallel work
  • Sandboxing: OS-level filesystem and network isolation
  • Managed Settings: Enterprise deployment via plist, Registry, or managed files
  • Configuration: Customize behavior with JSON configuration files

Planning Mode ​

Planning mode allows Claude to think through complex tasks before implementing them, creating a detailed plan that you can review and approve.

What is Planning Mode? ​

Planning mode is a two-phase approach:

  1. Planning Phase: Claude analyzes the task and creates a detailed implementation plan
  2. Implementation Phase: After approval, Claude executes the plan

When to Use Planning Mode ​

✅ Use planning mode for:

  • Complex multi-file refactoring
  • New feature implementations
  • Architectural changes
  • Database migrations
  • Major API redesigns

❌ Don't use planning mode for:

  • Simple bug fixes
  • Formatting changes
  • Single-file edits
  • Quick queries

Activating Planning Mode ​

Slash command:

bash
/plan Implement user authentication system

CLI flag:

bash
claude --permission-mode plan

Set as default:

json
{
  "permissions": {
    "defaultMode": "plan"
  }
}

Keyboard shortcut:

  • Shift + Tab - Toggle permission modes (including plan)
  • Alt + M - Toggle permission modes (Windows/Linux)

Benefits of Planning Mode ​

  • Structured implementation approach: Detailed breakdown of implementation steps
  • Review and approval: Approve or adjust the plan before execution
  • Risk identification: Identify potential issues before implementation
  • Clear phases: Organized implementation phases and milestones

Example: Feature Implementation ​

User: /plan Add a real-time notification system

Claude: I'll create a plan for implementing real-time notifications.

## Implementation Plan

### Phase 1: Infrastructure Setup
1. Install WebSocket libraries (socket.io)
2. Set up WebSocket server
3. Configure connection management

### Phase 2: Backend Implementation
4. Create notification service
5. Implement notification queue
6. Add database schema for notifications
7. Create API endpoints

### Phase 3: Frontend Integration
8. Set up WebSocket client
9. Create notification UI components
10. Implement notification state management
11. Add notification permissions

### Phase 4: Testing & Deployment
12. Write unit tests
13. Write integration tests
14. Update documentation
15. Deploy to staging

Estimated time: 3-4 hours
Files to modify: 12
New files to create: 8

Ready to proceed? (yes/no/modify plan)

User: yes

Claude: [Begins implementation following the plan]

Plan Modifications ​

User: Modify the plan - skip the queue for now, we'll add it later

Claude: Updated plan:
[Shows modified plan with queue removed]

User: Looks good, proceed

Claude: [Implements modified plan]

Planning Mode Configuration ​

Planning mode is activated via the CLI flag or slash command:

bash
# Activate plan mode via CLI
claude --permission-mode plan

# Or use the /plan slash command inside the REPL
/plan Implement user authentication system

Model alias for planning: Use opusplan as a model alias to use Opus for planning and Sonnet for execution:

bash
claude --model opusplan "design and implement the new API"

Edit plan externally: Press Ctrl+G to open the current plan in your external editor for detailed modifications.


Extended Thinking ​

Extended thinking allows Claude to spend more time reasoning about complex problems before providing a solution.

What is Extended Thinking? ​

Extended thinking is a deliberate, step-by-step reasoning process where Claude:

  • Breaks down complex problems
  • Considers multiple approaches
  • Evaluates trade-offs
  • Reasons through edge cases

Activating Extended Thinking ​

Keyboard shortcut:

  • Option + T (macOS) / Alt + T (Windows/Linux) - Toggle extended thinking

Automatic activation:

  • Enabled by default for all models (Opus 4.6, Sonnet 4.6, Haiku 4.5)
  • Opus 4.6: Adaptive reasoning with effort levels: low (○), medium (◐), high (●), max (Opus 4.6 only)
  • Other models: Fixed budget up to 31,999 tokens

Configuration methods:

  • Toggle: Alt+T / Option+T, or via /config
  • View reasoning: Ctrl+O (verbose mode)
  • Set effort: /effort command or --effort flag

Custom budget:

bash
export MAX_THINKING_TOKENS=1024

Effort level (Opus 4.6 only):

bash
export CLAUDE_CODE_EFFORT_LEVEL=high   # low (○), medium (◐), high (●), or max (Opus 4.6 only)

CLI flag:

bash
claude --effort high "complex architectural review"

Slash command:

/effort high

Note: The keyword "ultrathink" in prompts activates deep reasoning mode. Effort levels low, medium, high, and max (Opus 4.6 only) control how much reasoning Claude performs.

Benefits of Extended Thinking ​

  • Deep reasoning: Spend more time thinking about complex problems
  • Better architectural decisions: Make informed choices with comprehensive evaluation
  • Consideration of edge cases: Think through potential issues and scenarios
  • Thorough analysis: Structured approach to complex problem-solving

Example: Architectural Decision ​

User: ultrathink Should we use microservices or a monolith for our e-commerce platform?

Claude: Let me think through this architectural decision carefully...

<extended_thinking>
## Context Analysis
- Team size: 5 developers
- Expected traffic: 10k daily users initially
- Need to scale to 100k+ users
- Limited DevOps resources
- 6-month timeline to MVP

## Approach 1: Microservices
Pros:
+ Independent scaling
+ Technology flexibility
+ Team independence
+ Fault isolation

Cons:
- Operational complexity
- Network overhead
- Distributed tracing needed
- Requires DevOps expertise
- Slower initial development

## Approach 2: Monolith
Pros:
+ Simpler deployment
+ Faster initial development
+ Easier debugging
+ Lower operational overhead
+ Single codebase

Cons:
- Scaling challenges later
- All-or-nothing deployments
- Technology lock-in
- Potential for tight coupling

## Decision Factors
1. Team size (5 devs) → Favors monolith
2. DevOps resources (limited) → Favors monolith
3. Timeline (6 months) → Favors monolith
4. Future scale (100k users) → Achievable with monolith + caching
5. Complexity budget → Limited

## Recommendation
Start with a **modular monolith**:
- Single deployment unit
- Clear module boundaries
- Clean interfaces between modules
- Prepare for future extraction to microservices if needed

This gives you:
✓ Fast initial development
✓ Low operational complexity
✓ Option to extract services later
✓ Clear architecture

Migration path: When you reach 50k+ users or specific modules need independent scaling, extract those modules into microservices.
</extended_thinking>

**Recommendation**: Implement a modular monolith with clean module boundaries.

This approach balances your current constraints (team size, timeline, DevOps resources) with future scalability needs. You can migrate specific modules to microservices later when there's a clear business need.

Extended Thinking Configuration ​

Extended thinking is controlled via environment variables, keyboard shortcuts, and CLI flags:

bash
# Set thinking token budget
export MAX_THINKING_TOKENS=16000

# Set effort level (Opus 4.6 only): low (○), medium (◐), high (●), or max (Opus 4.6 only)
export CLAUDE_CODE_EFFORT_LEVEL=high

Toggle during a session with Alt+T / Option+T, set effort with /effort, or configure via /config.


Auto Mode ​

Auto Mode is a permission mode that uses a background safety classifier to review each action before execution. It allows Claude to work autonomously while blocking dangerous operations. It's available on all plans, but requires an eligible model and provider.

Requirements ​

  • Plan: Team plan (Enterprise and API rolling out)
  • Model: Claude Sonnet 4.6 or Opus 4.6
  • Classifier: Tốn thêm chi phí token, ngoại trừ trên gói Enterprise và tài khoản Claude API, nơi v2.1.278+ chạy kiểm tra phía máy chủ mà không tính phí

Enabling Auto Mode ​

bash
# Interactive sessions start in auto mode when no permission mode is configured (v2.1.284+)
# To pick it explicitly, for example when your settings default to another mode:
claude --permission-mode auto

# Or cycle to it with Shift+Tab in the REPL

Or set it as the default permission mode:

bash
claude --permission-mode auto

Setting via config:

json
{
  "permissions": {
    "defaultMode": "auto"
  }
}

How the Classifier Works ​

The background classifier evaluates each action using the following decision order:

  1. Allow/deny rules -- Explicit permission rules are checked first
  2. Read-only/edits auto-approved -- File reads and edits pass automatically
  3. Classifier -- The background classifier reviews the action
  4. Fallback -- Falls back to prompting after 3 consecutive or 20 total blocks

Default Blocked Actions ​

Auto mode blocks the following by default:

Blocked ActionExample
Pipe-to-shell installscurl | bash
Sending sensitive data externallyAPI keys, credentials over network
Production deploysDeploy commands targeting production
Mass deletionrm -rf on large directories
IAM changesPermission and role modifications
Force push to maingit push --force origin main

Default Allowed Actions ​

Allowed ActionExample
Local file operationsRead, write, edit project files
Declared dependency installsnpm install, pip install from manifest
Read-only HTTPcurl for fetching documentation
Pushing to current branchgit push origin feature-branch

Configuring Auto Mode ​

Print default rules as JSON:

bash
claude auto-mode defaults

Configure trusted infrastructure via the autoMode.environment managed setting for enterprise deployments. This allows administrators to define trusted CI/CD environments, deployment targets, and infrastructure patterns.

Fallback Behavior ​

When the classifier is uncertain, auto mode falls back to prompting the user:

  • After 3 consecutive classifier blocks
  • After 20 total classifier blocks in a session

This ensures the user always retains control when the classifier cannot confidently approve an action.

Seeding Auto-Mode-Equivalent Permissions (No Team Plan Required) ​

If you don't have a Team plan or want a simpler approach without the background classifier, you can seed your ~/.claude/settings.json with a conservative baseline of safe permission rules. The script starts with read-only and local-inspection rules, then lets you opt into edits, tests, local git writes, package installs, and GitHub write actions only when you want them.

File: 09-advanced-features/setup-auto-mode-permissions.py

bash
# Preview what would be added (no changes written)
python3 09-advanced-features/setup-auto-mode-permissions.py --dry-run

# Apply the conservative baseline
python3 09-advanced-features/setup-auto-mode-permissions.py

# Add more capability only when you need it
python3 09-advanced-features/setup-auto-mode-permissions.py --include-edits --include-tests
python3 09-advanced-features/setup-auto-mode-permissions.py --include-git-write --include-packages

The script adds rules across these categories:

CategoryExamples
Core read-only toolsRead(*), Grep(*), Agent(*), WebSearch(*), WebFetch(*)
Local inspectionBash(git status:*), Bash(git log:*), Bash(git diff:*), Bash(cat:*)
Optional editsEdit(*)
Optional test/buildBash(pytest:*), Bash(python3 -m pytest:*), Bash(cargo test:*)
Optional git writesBash(git add:*), Bash(git commit:*), Bash(git checkout:*), Bash(git switch:*), Bash(git stash:*), Bash(git tag:*)
Package managersBash(npm ci:*), Bash(npm install:*), Bash(pip install:*), Bash(pip3 install:*)
Build & testBash(make:*), Bash(pytest:*), Bash(go test:*)
Common shellBash(ls:*), Bash(cat:*), Bash(find:*)
GitHub CLIBash(gh pr view:*), Bash(gh pr create:*), Bash(gh issue list:*)

Dangerous operations (rm -rf, sudo, force push, DROP TABLE, terraform destroy, etc.) are intentionally excluded. The script is idempotent — running it twice won't duplicate rules.


Background Tasks ​

Background tasks allow long-running operations to execute without blocking your conversation.

What Are Background Tasks? ​

Background tasks run asynchronously while you continue working:

  • Long test suites
  • Build processes
  • Database migrations
  • Deployment scripts
  • Analysis tools

Basic Usage:

bash
User: Run tests in background

Claude: Started task bg-1234

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

Starting Background Tasks ​

User: Run the full test suite in the background

Claude: Starting tests in background (task-id: bg-1234)
You can continue working while tests run.

[You can continue the conversation]

User: Meanwhile, let's refactor the auth module

Claude: [Works on auth module while tests run in background]

[Later, when tests complete]

Claude: 📢 Background task bg-1234 completed:
✅ 245 tests passed
❌ 3 tests failed
View results: /task show bg-1234

Managing Background Tasks ​

List active tasks:

User: /task list

Active background tasks:
1. [bg-1234] Running tests (50% complete, 2min remaining)
2. [bg-1235] Building Docker image (25% complete, 8min remaining)
3. [bg-1236] Deploying to staging (90% complete, 30sec remaining)

Check task status:

User: /task status bg-1234

Task bg-1234: Running tests
Status: In progress
Progress: 120/245 tests (49%)
Started: 2025-11-08 10:30:15
Estimated completion: 2025-11-08 10:34:22

View task output:

User: /task show bg-1234

[Shows live output from the test run]

Cancel task:

User: /task cancel bg-1234

Cancelled background task bg-1234

Example: Parallel Development ​

User: Run the build in the background

Claude: Starting build... (task-id: bg-5001)

User: Also run the linter in background

Claude: Starting linter... (task-id: bg-5002)

User: While those run, let's implement the new API endpoint

Claude: [Implements API endpoint while build and linter run]

[10 minutes later]

Claude: 📢 Build completed successfully (bg-5001)
📢 Linter found 12 issues (bg-5002)

User: Show me the linter issues

Claude: [Shows linter output from bg-5002]

Configuration ​

There is no settings.json block for background tasks. The feature is controlled by an environment variable:

bash
# Turn background tasks off entirely
export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=true

Concurrency is not a background-task setting either — how many agents run at once is governed by CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (default 20).


Scheduled Tasks ​

Scheduled Tasks let you run prompts automatically on a recurring schedule or as one-time reminders. Tasks are session-scoped — they run while Claude Code is active and are cleared when the session ends. Available since v2.1.72+.

The /loop command ​

bash
# Explicit interval
/loop 5m check if the deployment finished

# Natural language
/loop check build status every 30 minutes

Standard 5-field cron expressions are also supported for precise scheduling.

One-time reminders ​

Set reminders that fire once at a specific time:

remind me at 3pm to push the release branch
in 45 minutes, run the integration tests

Managing scheduled tasks ​

ToolDescription
CronCreateCreate a new scheduled task
CronListList all active scheduled tasks
CronDeleteRemove a scheduled task

Limits and behavior:

  • Up to 50 scheduled tasks per session
  • Session-scoped — cleared when the session ends
  • Recurring tasks auto-expire after 3 days
  • Tasks only fire while Claude Code is running — no catch-up for missed fires

Behavior details ​

AspectDetail
Recurring jitterUp to 10% of the interval (max 15 minutes)
One-shot jitterUp to 90 seconds on :00/:30 boundaries
Missed firesNo catch-up — skipped if Claude Code was not running
PersistenceNot persisted across restarts

Cloud Scheduled Tasks ​

Use /schedule to create Cloud scheduled tasks that run on Anthropic infrastructure:

/schedule daily at 9am run the test suite and report failures

Cloud scheduled tasks persist across restarts and do not require Claude Code to be running locally.

Disabling scheduled tasks ​

bash
export CLAUDE_CODE_DISABLE_CRON=1

Example: monitoring a deployment ​

/loop 5m check the deployment status of the staging environment.
        If the deploy succeeded, notify me and stop looping.
        If it failed, show the error logs.

Tip: Scheduled tasks are session-scoped. For persistent automation that survives restarts, use CI/CD pipelines, GitHub Actions, or Desktop App scheduled tasks instead.


Permission Modes ​

Permission modes control what actions Claude can take without explicit approval.

Available Permission Modes ​

ModeBehavior
defaultRead files only; prompts for all other actions
acceptEditsRead and edit files; prompts for commands
planRead files only (research mode, no edits)
autoAll actions with background safety classifier checks
bypassPermissionsAll actions, no permission checks (dangerous)
dontAskOnly pre-approved tools execute; all others denied

Cycle through modes with Shift+Tab in the CLI. Set a default with the --permission-mode flag or the permissions.defaultMode setting. When no permission mode is configured, interactive terminal and VS Code sessions start in auto mode on every plan and provider since v2.1.284 (v2.1.283 did this only on third-party providers such as Bedrock, Google Cloud's Agent Platform, and Foundry, or with telemetry off); permissions.defaultMode still overrides it, and a session where auto mode isn't available starts in Manual instead. claude -p and the Agent SDK start in default when nothing is configured, except that since v2.1.285 claude -p and Python Agent SDK sessions on third-party providers or with telemetry off also start in auto mode; --permission-mode still overrides it.

Activation Methods ​

Keyboard shortcut:

bash
Shift + Tab  # Cycle through all 6 modes

Slash command:

bash
/plan                  # Enter plan mode

CLI flag:

bash
claude --permission-mode plan
claude --permission-mode auto

Setting:

json
{
  "permissions": {
    "defaultMode": "auto"
  }
}

Permission Mode Examples ​

Default Mode ​

Claude asks for confirmation on significant actions:

User: Fix the bug in auth.ts

Claude: I need to modify src/auth.ts to fix the bug.
The change will update the password validation logic.

Approve this change? (yes/no/show)

Plan Mode ​

Review implementation plan before execution:

User: /plan Implement user authentication system

Claude: I'll create a plan for implementing authentication.

## Implementation Plan
[Detailed plan with phases and steps]

Ready to proceed? (yes/no/modify)

Accept Edits Mode ​

Automatically accept file modifications:

User: acceptEdits
User: Fix the bug in auth.ts

Claude: [Makes changes without asking]

Use Cases ​

Code Review:

User: claude --permission-mode plan
User: Review this PR and suggest improvements

Claude: [Reads code, provides feedback, but cannot modify]

Pair Programming:

User: claude --permission-mode default
User: Let's implement the feature together

Claude: [Asks for approval before each change]

Automated Tasks:

User: claude --permission-mode acceptEdits
User: Fix all linting issues in the codebase

Claude: [Auto-accepts file edits without asking]

Headless Mode ​

Print mode (claude -p) allows Claude Code to run without interactive input, perfect for automation and CI/CD. This is the non-interactive mode, replacing the older --headless flag.

What is Print Mode? ​

Print mode enables:

  • Automated script execution
  • CI/CD integration
  • Batch processing
  • Scheduled tasks

Running in Print Mode (Non-Interactive) ​

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

# Process piped content
cat error.log | claude -p "Analyze these errors"

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

Additional Print Mode Usage Examples ​

bash
# Run a specific task with output capture
claude -p "Run all tests and generate coverage report"

# With structured output
claude -p --output-format json "Analyze code quality"

# With input from stdin
echo "Analyze code quality" | claude -p "explain this"

Example: CI/CD Integration ​

GitHub Actions:

yaml
# .github/workflows/code-review.yml
name: AI Code Review

on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Claude Code
        run: npm install -g @anthropic-ai/claude-code

      - name: Run Claude Code Review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          claude -p --output-format json \
            --max-turns 3 \
            "Review this PR for:
            - Code quality issues
            - Security vulnerabilities
            - Performance concerns
            - Test coverage
            Output results as JSON" > review.json

      - name: Post Review Comment
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = JSON.parse(fs.readFileSync('review.json', 'utf8'));
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: JSON.stringify(review, null, 2)
            });

Print mode (claude -p) supports several flags for automation:

bash
# Limit autonomous turns
claude -p --max-turns 5 "refactor this module"

# Structured JSON output
claude -p --output-format json "analyze this codebase"

# With schema validation
claude -p --json-schema '{"type":"object","properties":{"issues":{"type":"array"}}}' \
  "find bugs in this code"

# Disable session persistence
claude -p --no-session-persistence "one-off analysis"

Session Management ​

Manage multiple Claude Code sessions effectively.

Session Management Commands ​

CommandDescription
/resumeResume a conversation by ID or name
/renameName the current session
/forkFork current session into a new branch
claude -cContinue most recent conversation
claude -r "session"Resume session by name or ID

Resuming Sessions ​

Continue last conversation:

bash
claude -c

Resume a named session:

bash
claude -r "auth-refactor" "finish this PR"

Rename the current session (inside the REPL):

/rename auth-refactor

Forking Sessions ​

Fork a session to try an alternative approach without losing the original:

/fork

Or from the CLI:

bash
claude --resume auth-refactor --fork-session "try OAuth instead"

Session Persistence ​

Sessions are automatically saved and can be resumed:

bash
# Continue last conversation
claude -c

# Resume specific session by name or ID
claude -r "auth-refactor"

# Resume and fork for experimentation
claude --resume auth-refactor --fork-session "alternative approach"

Interactive Features ​

Keyboard Shortcuts ​

Claude Code supports keyboard shortcuts for efficiency. Here's the complete reference from official docs:

ShortcutDescription
Ctrl+CCancel current input/generation
Ctrl+DExit Claude Code
Ctrl+GEdit plan in external editor
Ctrl+LVẽ lại màn hình (chỉ repaint — phím tắt nhấn đúp để /clear đã bị gỡ ở v2.1.238)
Ctrl+OToggle verbose output (view reasoning)
Ctrl+RReverse search history
Ctrl+TToggle task list view
Ctrl+BBackground running tasks
Esc+EscRewind code/conversation
Shift+Tab / Alt+MToggle permission modes
Option+P / Alt+PSwitch model
Option+T / Alt+TToggle extended thinking

Line Editing (standard readline shortcuts):

ShortcutAction
Ctrl + AMove to line start
Ctrl + EMove to line end
Ctrl + KCut to end of line
Ctrl + UCut to start of line
Ctrl + WDelete word backward
Ctrl + YPaste (yank)
TabAutocomplete
↑ / ↓Command history

Customizing keybindings ​

Create custom keyboard shortcuts by running /keybindings, which opens ~/.claude/keybindings.json for editing (v2.1.18+).

Configuration format:

json
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+e": "chat:externalEditor",
        "ctrl+u": null,
        "ctrl+k ctrl+s": "chat:stash"
      }
    },
    {
      "context": "Confirmation",
      "bindings": {
        "ctrl+a": "confirmation:yes"
      }
    }
  ]
}

Set a binding to null to unbind a default shortcut.

Available contexts ​

Keybindings are scoped to specific UI contexts:

ContextKey Actions
Chatsubmit, cancel, cycleMode, modelPicker, thinkingToggle, undo, externalEditor, stash, imagePaste
Confirmationyes, no, previous, next, nextField, cycleMode, toggleExplanation
Globalinterrupt, exit, toggleTodos, toggleTranscript
Autocompleteaccept, dismiss, next, previous
HistorySearchsearch, previous, next
SettingsContext-specific settings navigation
TabsTab switching and management
HelpHelp panel navigation

There are 18 contexts total including Transcript, Task, ThemePicker, Attachments, Footer, MessageSelector, DiffDialog, ModelPicker, and Select.

Chord support ​

Keybindings support chord sequences (multi-key combinations):

"ctrl+k ctrl+s"   → Two-key sequence: press ctrl+k, then ctrl+s
"ctrl+shift+p"    → Simultaneous modifier keys

Keystroke syntax:

  • Modifiers: ctrl (or control), alt (or opt, option, meta), shift, and cmd (or command, super, win) — cmd is a separate modifier, not an alias of meta, and is only detected in terminals that report the Super key
  • Uppercase implies Shift: K is equivalent to shift+k
  • Special keys: escape, enter, return, tab, space, backspace, delete, arrow keys

Reserved and conflicting keys ​

KeyStatusNotes
Ctrl+CReservedCannot be rebound (interrupt)
Ctrl+DReservedCannot be rebound (exit)
Ctrl+BTerminal conflicttmux prefix key
Ctrl+ATerminal conflictGNU Screen prefix key
Ctrl+ZTerminal conflictProcess suspend

Tip: If a shortcut does not work, check for conflicts with your terminal emulator or multiplexer.

Tab Completion ​

Claude Code provides intelligent tab completion:

User: /rew<TAB>
→ /rewind

User: /plu<TAB>
→ /plugin

User: /plugin <TAB>
→ /plugin install
→ /plugin enable
→ /plugin disable

Command History ​

Access previous commands:

User: <↑>  # Previous command
User: <↓>  # Next command
User: Ctrl+R  # Search history

(reverse-i-search)`test': run all tests

Multi-line Input ​

For complex queries, use multi-line mode:

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

Example:

User: \
> Implement a user authentication system
> with the following requirements:
> - JWT tokens
> - Email verification
> - Password reset
> - 2FA support
> \end

Claude: [Processes the multi-line request]

Inline Editing ​

Edit commands before sending:

User: Deploy to prodcution<Backspace><Backspace>uction

[Edit in-place before sending]

Vim Mode ​

Enable Vi/Vim keybindings for text editing:

Activation:

  • Use /vim command or /config to enable
  • Mode switching with Esc for NORMAL, i/a/o for INSERT

Navigation keys:

  • h / l - Move left/right
  • j / k - Move down/up
  • w / b / e - Move by word
  • 0 / $ - Move to line start/end
  • gg / G - Jump to start/end of text

Text objects:

  • iw / aw - Inner/around word
  • i" / a" - Inner/around quoted string
  • i( / a( - Inner/around parentheses

Bash Mode ​

Execute shell commands directly with ! prefix:

bash
! npm test
! git status
! cat src/index.js

Use this for quick command execution without switching contexts.


Voice Dictation ​

Voice Dictation provides push-to-talk voice input for Claude Code, allowing you to speak your prompts instead of typing them.

Activating Voice Dictation ​

/voice

Features ​

FeatureDescription
Push-to-talkHold a key to record, release to send
20 languagesSpeech-to-text supports 20 languages
Custom keybindingConfigure the push-to-talk key via /keybindings
Account requirementRequires a Claude.ai account for STT processing

Configuration ​

Customize the push-to-talk keybinding in your keybindings file (/keybindings). Voice dictation uses your Claude.ai account for speech-to-text processing.


Channels ​

Channels (Research Preview) allow MCP servers to push messages into running Claude Code sessions, enabling real-time integrations with external services.

Subscribing to Channels ​

bash
# Subscribe to channel plugins at startup
claude --channels discord,telegram

Supported Integrations ​

IntegrationDescription
DiscordReceive and respond to Discord messages in your session
TelegramReceive and respond to Telegram messages in your session

Configuration ​

Managed setting for enterprise deployments:

json
{
  "allowedChannelPlugins": ["discord", "telegram"]
}

The allowedChannelPlugins managed setting controls which channel plugins are permitted across the organization.

How It Works ​

  1. MCP servers act as channel plugins that connect to external services
  2. Incoming messages are pushed into the active Claude Code session
  3. Claude can read and respond to messages within the session context
  4. Channel plugins must be approved via the allowedChannelPlugins managed setting

Chrome Integration ​

Chrome Integration connects Claude Code to your Chrome or Microsoft Edge browser for live web automation and debugging. This is a beta feature available since v2.0.73+ (Edge support added in v1.0.36+).

Enabling Chrome Integration ​

At startup:

bash
claude --chrome      # Enable Chrome connection
claude --no-chrome   # Disable Chrome connection

Within a session:

/chrome

Select "Enabled by default" to activate Chrome Integration for all future sessions. Claude Code shares your browser's login state, so it can interact with authenticated web apps.

Capabilities ​

CapabilityDescription
Live debuggingRead console logs, inspect DOM elements, debug JavaScript in real time
Design verificationCompare rendered pages against design mockups
Form validationTest form submissions, input validation, and error handling
Web app testingInteract with authenticated apps (Gmail, Google Docs, Notion, etc.)
Data extractionScrape and process content from web pages
Session recordingRecord browser interactions as GIF files

Site-level permissions ​

The Chrome extension manages per-site access. Grant or revoke access for specific sites at any time through the extension popup. Claude Code only interacts with sites you have explicitly allowed.

How it works ​

Claude Code controls the browser in a visible window — you can watch actions happen in real time. When the browser encounters a login page or CAPTCHA, Claude pauses and waits for you to handle it manually before continuing.

Known limitations ​

  • Browser support: Chrome and Edge only — Brave, Arc, and other Chromium browsers are not supported
  • WSL: Not available in Windows Subsystem for Linux
  • Third-party providers: Not supported with Bedrock, Vertex, or Foundry API providers
  • Service worker idle: The Chrome extension service worker may go idle during extended sessions

Tip: Chrome Integration is a beta feature. Browser support may expand in future releases.


Remote Control ​

Remote Control lets you continue a locally running Claude Code session from your phone, tablet, or any browser. Your local session keeps running on your machine — nothing moves to the cloud. Available on Pro, Max, Team, and Enterprise plans (v2.1.51+).

Starting Remote Control ​

From the CLI:

bash
# Start with default session name
claude remote-control

# Start with a custom name
claude remote-control --name "Auth Refactor"

From within a session:

/remote-control
/remote-control "Auth Refactor"

Available flags:

FlagDescription
--name "title"Custom session title for easy identification
--verboseShow detailed connection logs
--sandboxEnable filesystem and network isolation
--no-sandboxDisable sandboxing (default)

Connecting to a session ​

Three ways to connect from another device:

  1. Session URL — Printed to the terminal when the session starts; open in any browser
  2. QR code — Press spacebar after starting to display a scannable QR code
  3. Find by name — Browse your sessions at claude.ai/code or in the Claude mobile app (iOS/Android)

Security ​

  • No inbound ports opened on your machine
  • Outbound HTTPS only over TLS
  • Scoped credentials — multiple short-lived, narrowly scoped tokens
  • Session isolation — each remote session is independent

Remote Control vs Claude Code on the web ​

AspectRemote ControlClaude Code on Web
ExecutionRuns on your machineRuns on Anthropic cloud
Local toolsFull access to local MCP servers, files, and CLINo local dependencies
Use caseContinue local work from another deviceStart fresh from any browser

Limitations ​

  • One remote session per Claude Code instance
  • Terminal must stay open on the host machine
  • Session times out after ~10 minutes if the network is unreachable

Use cases ​

  • Control Claude Code from a mobile device or tablet while away from your desk
  • Use the richer claude.ai UI while maintaining local tool execution
  • Quick code reviews on the go with your full local development environment

Web Sessions ​

Web Sessions allow you to run Claude Code directly in the browser at claude.ai/code, or create web sessions from the CLI.

Creating a Web Session ​

bash
# Create a new web session from the CLI
claude --remote "implement the new API endpoints"

This starts a Claude Code session on claude.ai that you can access from any browser.

Resuming Web Sessions Locally ​

If you started a session on the web and want to continue it locally:

bash
# Resume a web session in the local terminal
claude --teleport

Or from within an interactive REPL:

/teleport

Use Cases ​

  • Start work on one machine and continue on another
  • Share a session URL with team members
  • Use the web UI for visual diff review, then switch to terminal for execution

Desktop App ​

The Claude Code Desktop App provides a standalone application with visual diff review, parallel sessions, and integrated connectors. Available for macOS and Windows (Pro, Max, Team, and Enterprise plans).

Installation ​

Download from claude.ai for your platform:

  • macOS: Universal build (Apple Silicon and Intel)
  • Windows: x64 and ARM64 installers available

See the Desktop Quickstart for setup instructions.

Handing off from CLI ​

Transfer your current CLI session to the Desktop App:

/desktop

Core features ​

FeatureDescription
Diff viewFile-by-file visual review with inline comments; Claude reads comments and revises
App previewAuto-starts dev servers with an embedded browser for live verification
PR monitoringGitHub CLI integration with auto-fix CI failures and auto-merge when checks pass
Parallel sessionsMultiple sessions in the sidebar with automatic Git worktree isolation
Scheduled tasksRecurring tasks (hourly, daily, weekdays, weekly) that run while the app is open
Rich renderingCode, markdown, and diagram rendering with syntax highlighting

App preview configuration ​

Configure dev server behavior in .claude/launch.json:

json
{
  "command": "npm run dev",
  "port": 3000,
  "readyPattern": "ready on",
  "persistCookies": true
}

Connectors ​

Connect external services for richer context:

ConnectorCapability
GitHubPR monitoring, issue tracking, code review
SlackNotifications, channel context
LinearIssue tracking, sprint management
NotionDocumentation, knowledge base access
AsanaTask management, project tracking
CalendarSchedule awareness, meeting context

Note: Connectors are not available for remote (cloud) sessions.

Remote and SSH sessions ​

  • Remote sessions: Run on Anthropic cloud infrastructure; continue even when the app is closed. Accessible from claude.ai/code or the Claude mobile app
  • SSH sessions: Connect to remote machines over SSH with full access to the remote filesystem and tools. Claude Code must be installed on the remote machine

Permission modes in Desktop ​

The Desktop App supports the same permission modes as the CLI:

ModeBehavior
Ask permissions (default)Review and approve every edit and command
Auto accept editsFile edits auto-approved; commands require manual approval
Plan modeReview approach before any changes are made
Bypass permissionsAutomatic execution (sandbox-only, admin-controlled)

Enterprise features ​

  • Admin console: Control Code tab access and permission settings for the organization
  • MDM deployment: Deploy via MDM on macOS or MSIX on Windows
  • SSO integration: Require single sign-on for organization members
  • Managed settings: Centrally manage team configuration and model availability

Task List ​

The Task List feature provides persistent task tracking that survives context compactions (when the conversation history is trimmed to fit the context window).

Toggling the Task List ​

Press Ctrl+T to toggle the task list view on or off during a session.

Persistent Tasks ​

Tasks persist across context compactions, ensuring that long-running work items are not lost when the conversation context is trimmed. This is particularly useful for complex, multi-step implementations.

Named Task Directories ​

Use the CLAUDE_CODE_TASK_LIST_ID environment variable to create named task directories shared across sessions:

bash
export CLAUDE_CODE_TASK_LIST_ID=my-project-sprint-3

This allows multiple sessions to share the same task list, making it useful for team workflows or multi-session projects.


Prompt Suggestions ​

Prompt Suggestions display grayed-out example commands based on your git history and current conversation context.

How It Works ​

  • Suggestions appear as grayed-out text below your input prompt
  • Press Tab to accept the suggestion
  • Press Enter to accept and immediately submit
  • Suggestions are context-aware, drawing from git history and conversation state

Disabling Prompt Suggestions ​

bash
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false

Git Worktrees ​

Git Worktrees allow you to start Claude Code in an isolated worktree, enabling parallel work on different branches without stashing or switching.

Starting in a Worktree ​

bash
# Start Claude Code in an isolated worktree
claude --worktree
# or
claude -w

Worktree Location ​

Worktrees are created at:

<repo>/.claude/worktrees/<name>

Sparse Checkout for Monorepos ​

Use the worktree.sparsePaths setting to perform sparse-checkout in monorepos, reducing disk usage and clone time:

json
{
  "worktree": {
    "sparsePaths": ["packages/my-package", "shared/"]
  }
}

Worktree Tools and Hooks ​

ItemDescription
ExitWorktreeTool to exit and clean up the current worktree
WorktreeCreateHook event fired when a worktree is created
WorktreeRemoveHook event fired when a worktree is removed

Auto-Cleanup ​

If no changes are made in the worktree, it is automatically cleaned up when the session ends.

Use Cases ​

  • Work on a feature branch while keeping main branch untouched
  • Run tests in isolation without affecting the working directory
  • Try experimental changes in a disposable environment
  • Sparse-checkout specific packages in monorepos for faster startup

Sandboxing ​

Sandboxing provides OS-level filesystem and network isolation for Bash commands executed by Claude Code. This is complementary to permission rules and provides an additional security layer.

Enabling Sandboxing ​

Slash command:

/sandbox

CLI flags:

bash
claude --sandbox       # Enable sandboxing
claude --no-sandbox    # Disable sandboxing

Configuration Settings ​

SettingDescription
sandbox.enabledEnable or disable sandboxing
sandbox.failIfUnavailableFail if sandboxing cannot be activated
sandbox.filesystem.allowWritePaths allowed for write access
sandbox.filesystem.allowReadPaths allowed for read access
sandbox.filesystem.denyReadPaths denied for read access
sandbox.enableWeakerNetworkIsolationEnable weaker network isolation on macOS

Example Configuration ​

json
{
  "sandbox": {
    "enabled": true,
    "failIfUnavailable": true,
    "filesystem": {
      "allowWrite": ["/Users/me/project"],
      "allowRead": ["/Users/me/project", "/usr/local/lib"],
      "denyRead": ["/Users/me/.ssh", "/Users/me/.aws"]
    },
    "enableWeakerNetworkIsolation": true
  }
}

How It Works ​

  • Bash commands run in a sandboxed environment with restricted filesystem access
  • Network access can be isolated to prevent unintended external connections
  • Works alongside permission rules for defense in depth
  • On macOS, use sandbox.enableWeakerNetworkIsolation for network restrictions (full network isolation is not available on macOS)

Use Cases ​

  • Running untrusted or generated code safely
  • Preventing accidental modifications to files outside the project
  • Restricting network access during automated tasks

Managed Settings (Enterprise) ​

Managed Settings enable enterprise administrators to deploy Claude Code configuration across an organization using platform-native management tools.

Deployment Methods ​

PlatformMethodSince
macOSManaged plist files (MDM)v2.1.51+
WindowsWindows Registryv2.1.51+
Cross-platformManaged configuration filesv2.1.51+
Cross-platformManaged drop-ins (managed-settings.d/ directory)v2.1.83+

Managed Drop-ins ​

Since v2.1.83, administrators can deploy multiple managed settings files into a managed-settings.d/ directory. Files are merged in alphabetical order, allowing modular configuration across teams:

~/.claude/managed-settings.d/
  00-org-defaults.json
  10-team-policies.json
  20-project-overrides.json

Available Managed Settings ​

SettingDescription
disableBypassPermissionsModePrevent users from enabling bypass permissions
availableModelsRestrict which models users can select
allowedChannelPluginsControl which channel plugins are permitted
autoMode.environmentConfigure trusted infrastructure for auto mode
Custom policiesOrganization-specific permission and tool policies

Example: macOS Plist ​

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>disableBypassPermissionsMode</key>
  <true/>
  <key>availableModels</key>
  <array>
    <string>claude-sonnet-4-6</string>
    <string>claude-haiku-4-5</string>
  </array>
</dict>
</plist>

Configuration and Settings ​

Configuration File Locations ​

  1. Global config: ~/.claude/config.json
  2. Project config: ./.claude/config.json
  3. User config: ~/.config/claude-code/settings.json

Complete Configuration Example ​

Core advanced features configuration:

json
{
  "permissions": {
    "defaultMode": "manual"
  },
  "hooks": {
    "PreToolUse:Edit": "eslint --fix ${file_path}",
    "PostToolUse:Write": "~/.claude/hooks/security-scan.sh"
  },
  "mcp": {
    "enabled": true,
    "servers": {
      "github": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-github"]
      }
    }
  }
}

Extended configuration example:

json
{
  "permissions": {
    "defaultMode": "manual",
    "allowedTools": ["Bash(git log:*)", "Read"],
    "disallowedTools": ["Bash(rm -rf:*)"]
  },

  "hooks": {
    "PreToolUse": [{ "matcher": "Edit", "hooks": ["eslint --fix ${file_path}"] }],
    "PostToolUse": [{ "matcher": "Write", "hooks": ["~/.claude/hooks/security-scan.sh"] }],
    "Stop": [{ "hooks": ["~/.claude/hooks/notify.sh"] }]
  },

  "mcp": {
    "enabled": true,
    "servers": {
      "github": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-github"],
        "env": {
          "GITHUB_TOKEN": "${GITHUB_TOKEN}"
        }
      }
    }
  }
}

Environment Variables ​

Override config with environment variables:

bash
# Model selection
export ANTHROPIC_MODEL=claude-opus-4-6
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-6
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5

# API configuration
export ANTHROPIC_API_KEY=sk-ant-...

# Thinking configuration
export MAX_THINKING_TOKENS=16000
export CLAUDE_CODE_EFFORT_LEVEL=high

# Feature toggles
export CLAUDE_CODE_DISABLE_AUTO_MEMORY=true
export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=true
export CLAUDE_CODE_DISABLE_CRON=1
export CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=true
export CLAUDE_CODE_DISABLE_TERMINAL_TITLE=true
export CLAUDE_CODE_DISABLE_1M_CONTEXT=true
export CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=true
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
export CLAUDE_CODE_ENABLE_TASKS=true
export CLAUDE_CODE_SIMPLE=true              # Set by --bare flag

# MCP configuration
export MAX_MCP_OUTPUT_TOKENS=50000
export ENABLE_TOOL_SEARCH=true

# Task management
export CLAUDE_CODE_TASK_LIST_ID=my-project-tasks

# Agent teams (experimental)
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

# Subagent and plugin configuration
export CLAUDE_CODE_SUBAGENT_MODEL=sonnet
export CLAUDE_CODE_PLUGIN_SEED_DIR=./my-plugins
export CLAUDE_CODE_NEW_INIT=1

# Subprocess and streaming
export CLAUDE_CODE_SUBPROCESS_ENV_SCRUB="SECRET_KEY,DB_PASSWORD"
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=80
export CLAUDE_STREAM_IDLE_TIMEOUT_MS=30000
export ANTHROPIC_CUSTOM_MODEL_OPTION=my-custom-model
export SLASH_COMMAND_TOOL_CHAR_BUDGET=50000

Configuration Management Commands ​

User: /config
[Opens interactive configuration menu]

The /config command provides an interactive menu to toggle settings such as:

  • Extended thinking on/off
  • Verbose output
  • Permission mode
  • Model selection

Per-Project Configuration ​

Create .claude/config.json in your project:

json
{
  "hooks": {
    "PreToolUse": [{ "matcher": "Bash", "hooks": ["npm test && npm run lint"] }]
  },
  "permissions": {
    "defaultMode": "manual"
  },
  "mcp": {
    "servers": {
      "project-db": {
        "command": "mcp-postgres",
        "env": {
          "DATABASE_URL": "${PROJECT_DB_URL}"
        }
      }
    }
  }
}

Best Practices ​

Planning Mode ​

  • ✅ Use for complex multi-step tasks
  • ✅ Review plans before approving
  • ✅ Modify plans when needed
  • ❌ Don't use for simple tasks

Extended Thinking ​

  • ✅ Use for architectural decisions
  • ✅ Use for complex problem-solving
  • ✅ Review the thinking process
  • ❌ Don't use for simple queries

Background Tasks ​

  • ✅ Use for long-running operations
  • ✅ Monitor task progress
  • ✅ Handle task failures gracefully
  • ❌ Don't start too many concurrent tasks

Permissions ​

  • ✅ Use plan for code review (read-only)
  • ✅ Use default for interactive development
  • ✅ Use acceptEdits for automation workflows
  • ✅ Use auto for autonomous work with safety guardrails
  • ❌ Don't use bypassPermissions unless absolutely necessary

Sessions ​

  • ✅ Use separate sessions for different tasks
  • ✅ Save important session states
  • ✅ Clean up old sessions
  • ❌ Don't mix unrelated work in one session

Additional Resources ​

For more information about Claude Code and related features:


Cập Nhật Lần Cuối: Ngày 30 tháng 9 năm 2026 Phiên Bản Claude Code: 2.1.285 Nguồn: