← All sources
Claude Docs

Claude Docs

137 articles · updated June 05, 2026

Claude Code on Claude Platform on AWS - Claude Code Docs

Claude Code can be configured to use Claude Platform on AWS through AWS authentication and environment variable setup. Users must authenticate using either AWS credentials with SigV4 or a workspace API key, set required environment variables like CLAUDE_CODE_USE_ANTHROPIC_AWS and ANTHROPIC_AWS_WORKSPACE_ID, and optionally pin specific model versions to ensure consistent deployments. The setup also supports routing through corporate proxies and includes troubleshooting guidance for common authentication and configuration issues.

Read more →

Launch sessions from links - Claude Code Docs

Claude Code supports deep links using the claude-cli:// URL scheme to open sessions with pre-filled prompts and working directories. These links can be embedded in runbooks, dashboards, and wikis to provide one-click starting points for tasks, with the prompt remaining inert until the user presses Enter to send it. The links use URL-encoded query parameters and the handler is automatically registered when Claude Code runs on macOS, Linux, and Windows.

Read more →

Explore the context window - Claude Code Docs

Claude Code's context window contains all session information with different elements surviving compaction in different ways—system prompts and unscoped rules persist unchanged, while path-scoped rules reload only when their matching files are read. Users can manage context usage by running focused compactions before large tasks, clearing between unrelated work, or delegating large file reads to subagents with separate context windows.

Read more →

Week 20 · May 11–15, 2026 - Claude Code Docs

Claude Code agents now displays a unified dashboard for managing multiple parallel sessions, showing their status as running, blocked, or completed. A new /goal feature enables Claude to automatically continue working across turns until specified completion conditions are met without manual prompting. Fast mode has been upgraded to run on Opus 4.7 by default, delivering approximately 2.5x faster performance while maintaining unchanged pricing.

Read more →

Connect to MCP servers - Claude Code Docs

The Model Context Protocol (MCP) extends Claude Code's capabilities by connecting external tools through servers that can run locally or as hosted services, such as issue trackers, databases, and browsers. Servers are connected using the `claude mcp add` command, with configurations saved to .claude.json or .mcp.json depending on the chosen scope (local, project, or user). Different server types including HTTP-based hosted services, local stdio processes, and OAuth-authenticated applications can be added, verified, and configured either through CLI commands or by manually editing configuration files.

Read more →

Week 21 · May 18–22, 2026 - Claude Code Docs

Claude Code released auto mode for its Pro plan, implementing background safety checks for Opus and Sonnet 4.6 models to reduce interruptions during routine operations. New features include a /code-review command for identifying correctness bugs and per-category usage tracking, alongside improvements to plugin marketplace visibility with context cost projections. Windows environments now have PowerShell tools enabled by default, and background session management has been enhanced with better pinning and resumption capabilities.

Read more →

Week 22 · May 25–29, 2026 - Claude Code Docs

Opus 4.8 became the default model across Anthropic's platforms during this week, with fast mode pricing of $10/$50 per MTok offering approximately 2.5x speed improvement. New capabilities include workflows for orchestrating complex tasks across subagents, a security-guidance plugin for detecting vulnerabilities in code, and automatic plugin loading from designated directories. Additional updates encompassed background job execution in shell commands, fallback model support, and various improvements to Claude Code's interface and plugin management.

Read more →

Orchestrate subagents at scale with dynamic workflows - Claude Code Docs

A dynamic workflow is a JavaScript script that orchestrates subagents at scale, executing in the background while a session remains responsive. Workflows are used when tasks require coordination of many agents, such as large-scale code migrations, multi-source research with cross-checking, and comprehensive code audits, and can be triggered by including 'workflow' in a prompt or enabled through ultracode mode. Completed workflow runs can be saved as reusable commands and monitored through an interface displaying agent counts, token usage, and phase information.

Read more →

Run agents in parallel - Claude Code Docs

The documentation outlines four main approaches for parallelizing work with Claude agents: subagents for delegated workers within one session, agent view for independent background tasks monitored from one screen, agent teams for coordinated sessions with inter-agent messaging, and dynamic workflows for scripts running many subagents with result verification. The selection of approach depends on who coordinates work, whether workers need communication, and whether tasks edit the same files, with supplementary tools like worktrees and /batch providing file isolation. Different commands (/agents, /tasks, /workflows) are used to check on running work based on the chosen approach.

Read more →

Set up Claude Code in a monorepo or large codebase - Claude Code Docs

The documentation provides guidance for configuring Claude Code in large codebases and monorepos by using scoped settings such as per-directory CLAUDE.md files, exclusion rules, and path-scoped configurations to load only relevant instructions and conventions. These layered settings allow Claude to focus on the specific parts of a codebase a task touches, reducing context window usage and improving performance. The guide covers multiple approaches including directory-based instruction files, permission rules, code intelligence plugins, and sparse checkout options that can be combined based on repository needs.

Read more →

Catch security issues as Claude writes code - Claude Code Docs

The security guidance plugin for Claude Code automatically detects and fixes vulnerabilities such as injection, unsafe deserialization, and unsafe DOM APIs in code changes while Claude writes, preventing security issues from reaching pull requests. The plugin operates through three review mechanisms: fast pattern matching on each file edit, background model review at turn completion, and deeper agentic review during commits or pushes. Installation requires Claude Code CLI 2.1.144 or later and Python 3.8, with optional custom security rules configurable through project settings.

Read more →

Choose a sandbox environment - Claude Code Docs

Claude Code offers multiple sandboxing approaches ranging from a lightweight per-command Bash sandbox to fully isolated virtual machines, with varying levels of isolation, setup complexity, and Docker requirements. The built-in sandboxed Bash tool restricts only Bash commands with minimal setup, while other approaches like sandbox runtime, dev containers, and virtual machines isolate the entire Claude Code process and its tools. Users should select an approach based on their specific threat model and goals, whether reducing permission prompts during development or enforcing standardized isolation across an organization.

Read more →

Control MCP server access for your organization - Claude Code Docs

Claude Code administrators can restrict MCP server access in their organization using several control patterns, ranging from completely disabling MCP to maintaining approved lists of servers. The primary mechanisms include deploying a managed-mcp.json file for fixed server deployments and using allowlists and denylists to filter which configured servers are permitted to load. The documentation provides specific file paths for different operating systems and explains how servers are evaluated against policies to determine whether they load.

Read more →

Recommend your plugin from your CLI - Claude Code Docs

CLI and SDK maintainers can recommend plugins from the official Anthropic marketplace by writing a hint marker to stderr when the CLAUDECODE environment variable is detected. Claude Code reads the hint, removes it from output before sending to the model, and displays a one-time installation prompt to the user. The hint tag requires three attributes (version, type, and plugin identifier) and should be emitted at key moments such as help output or authentication success.

Read more →

How Claude Code uses prompt caching - Claude Code Docs

Documentation Index Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt Use this file to discover all available pages before exploring further. Prompt caching makes Claude Code faster and more cost-efficient. Without caching, the

Read more →

Give Claude custom tools - Claude Code Docs

Custom tools extend the Agent SDK by enabling developers to define functions that Claude can call during conversations, providing access to databases, external APIs, domain-specific logic, or other capabilities. Tools are created by specifying a name, description, input schema, and handler function, then wrapped in an MCP server and passed to the query function with access controls via allowed or disallowed tool lists. The documentation covers tool definition, registration, error handling, annotations for controlling parallel execution, and returning non-text content such as images and machine-readable JSON.

Read more →

Streaming Input - Claude Code Docs

The Claude Agent SDK provides two input modes: Streaming Input Mode and Single Message Input. Streaming Input Mode is the recommended default approach, offering persistent interactive sessions with full agent capabilities that allow the agent to function as a long-lived process handling user input, interruptions, permission requests, and session management. Single Message Input is a simpler alternative suited for one-shot responses in stateless environments such as lambda functions.

Read more →

Slash Commands in the SDK - Claude Code Docs

Slash commands provide a way to control Claude Code sessions by sending special commands that start with / through the SDK to perform actions such as context compaction and context usage listing. Built-in slash commands available in a session are identified in the system initialization message, with /compact being a common command that reduces conversation history size by summarizing older messages. Custom slash commands can be created as markdown files in designated directories with optional YAML frontmatter configuration, supporting dynamic arguments, bash execution, and file references for flexible automation.

Read more →

Set up Claude Code for your organization - Claude Code Docs

Claude Code organization deployment requires administrators to make five sequential decisions: choosing an API provider, determining how managed settings reach developer devices, defining enforcement policies for tools and commands, establishing usage visibility mechanisms, and reviewing data handling practices. Managed settings delivered through server-managed, plist/registry, or file-based mechanisms take precedence over local developer configuration and control access to tools, servers, and network destinations. Implementation is verified through the /status command output, which confirms enterprise managed settings and their delivery source.

Read more →

Speed up responses with fast mode - Claude Code Docs

Fast mode is a high-speed configuration for Claude Opus that delivers 2.5x faster responses at a cost of $30/150 MTok, toggled with the /fast command. Intended for interactive work where latency matters more than cost—such as rapid iteration and live debugging—fast mode requires extra usage to be enabled and is available to Claude Code users on subscription plans. The feature shares rate limits across Opus 4.6 and 4.7, automatically falling back to standard speed when rate limits are reached.

Read more →

Keep Claude working toward a goal - Claude Code Docs

The `/goal` command enables Claude to autonomously work toward a completion condition across multiple turns, with an evaluator checking after each turn whether the specified condition is met and directing Claude to continue working if not. Effective goals feature a measurable end state such as passing tests or cleaning up code, along with a stated verification method and relevant constraints, and can optionally include turn or time limits. The feature requires workspace trust settings and functions as a session-scoped shortcut that automatically clears when the condition is satisfied.

Read more →

Scale to many tools with tool search - Claude Code Docs

Tool search enables agents to work with hundreds or thousands of tools by dynamically discovering and loading only the tools needed on demand, rather than loading all tool definitions into the context window upfront. This approach addresses context efficiency and tool selection accuracy challenges that arise when scaling tool libraries beyond 30-50 tools. Tool search is enabled by default, uses a search mechanism that matches queries against tool names and descriptions to return the 3-5 most relevant tools, and includes configuration options through the ENABLE_TOOL_SEARCH environment variable.

Read more →

Push events into a running session with channels - Claude Code Docs

Channels are MCP server plugins that deliver events into running Claude Code sessions, enabling Claude to react to messages while away from the terminal, with supported options including Telegram, Discord, and iMessage. Each channel requires user authentication and maintains a sender allowlist for security, allowing only approved contacts to push messages into the session. Organizations can control channel availability through admin settings, while individual users opt channels into sessions using the --channels flag.

Read more →

Channels reference - Claude Code Docs

Channels are MCP servers that push events into Claude Code sessions to enable external systems like CI pipelines, monitoring tools, and chat platforms to trigger Claude actions. Built with the @modelcontextprotocol/sdk package, they communicate over stdio as subprocesses and can provide one-way notifications or two-way communication with reply tools and permission relay features. The documentation covers implementation patterns, server configuration, notification formatting with metadata, and mechanisms for Claude to send messages back and remotely approve tool usage.

Read more →

Output styles - Claude Code Docs

Output styles modify how Claude responds by changing role, tone, and output format through system prompt adjustments, with built-in options including Proactive, Explanatory, and Learning modes alongside the default style. Custom output styles can be created as Markdown files with frontmatter and saved at user, project, or managed policy levels. Output style changes take effect at the start of a new session and can be configured through the /config command or by editing the .claude/settings.local.json file directly.

Read more →

Manage multiple agents with agent view - Claude Code Docs

Agent view in Claude Code provides a unified dashboard to monitor and manage multiple independent background sessions, displaying their state, current activity, and required actions in a single interface. Sessions run in the background under a supervisor process and persist on disk, enabling work to continue even after the terminal closes. Users can peek at session summaries, reply directly from the dashboard, attach for full conversations, and organize sessions by state or directory.

Read more →

Run parallel sessions with worktrees - Claude Code Docs

Git worktrees allow Claude Code to run multiple isolated sessions in parallel, each operating in its own working directory and branch while sharing repository history. Sessions are created using the `--worktree` flag and automatically branch from the repository's default branch, with worktrees cleaned up after sessions end based on whether changes were made. This isolation prevents edits in one session from affecting files in another, enabling Claude to simultaneously develop features and fix bugs.

Read more →

Connect to external tools with MCP - Claude Code Docs

The Model Context Protocol (MCP) is an open standard that allows AI agents to connect to external tools, APIs, and data sources, with servers capable of running as local processes, over HTTP, or within SDK applications. MCP tools require explicit permission through the allowedTools configuration and follow a naming convention of mcp__<server-name>__<tool-name>. The SDK supports multiple transport types including stdio for local processes, HTTP/SSE for cloud-hosted servers, and custom SDK tools, with authentication typically managed through environment variables and headers.

Read more →

Week 16 · April 13–17, 2026 - Claude Code Docs

Anthropic released Opus 4.7 as the default model on Max and Team Premium, introducing a new xhigh effort level that sits between high and max for optimal coding and agentic task performance. The update includes templated cloud agents triggered by schedules, GitHub events, or API calls, and enhanced /usage visibility displaying resource allocation and optimization recommendations. Additional improvements encompass native per-platform binaries for the CLI, remote push notifications for long-running tasks, and new features such as /ultrareview for comprehensive code review and session recaps.

Read more →

Week 18 · April 27 – May 1, 2026 - Claude Code Docs

Claude Code released several improvements in week 18, including enhanced OAuth login that accepts codes pasted directly in the terminal for WSL2, SSH sessions, and containers, along with a new "claude project purge" command to delete project state. The update enables pull request linking to sessions through the session picker and removes the requirement for Git for Windows by supporting PowerShell as a primary shell. Additional fixes addressed memory leaks, MCP server retry logic, and various quality-of-life improvements across the platform.

Read more →

Week 19 · May 4–8, 2026 - Claude Code Docs

Claude Code v2.1.128 through v2.1.136 introduce the --plugin-url flag, allowing plugins to be loaded directly from URLs for testing before marketplace distribution. Ctrl+R reverse-search now defaults to all prompts across projects rather than limiting to the current session, restoring the ability to find commands run in other repositories. The update includes new configuration options for worktree handling, enhanced credential reliability for OAuth and MCP servers, performance optimizations for sub-agent caching, and multiple infrastructure improvements.

Read more →

Agent Skills in the SDK - Claude Code Docs

Agent Skills extend Claude with specialized capabilities that the model autonomously invokes when relevant, packaged as SKILL.md files containing instructions and descriptions. These Skills are loaded from filesystem directories (.claude/skills/) and controlled through the SDK's skills option, which determines which Skills are available in a session and must be created as filesystem artifacts rather than defined programmatically.

Read more →

Use Claude Code features in the SDK - Claude Code Docs

The Agent SDK inherits filesystem-based features from Claude Code, including project instructions via CLAUDE.md and rules files, skills, and hooks, which are controlled through the settingSources option to determine which configuration locations the SDK loads. Project instructions provide persistent context about coding conventions and architecture decisions that agents follow without repetition, while skills are on-demand markdown files offering specialized knowledge and invocable workflows. Hooks can be implemented as either filesystem-based shell commands or programmatic callbacks to enforce deterministic logic and access control on tool execution.

Read more →

Stream responses in real-time - Claude Code Docs

The Agent SDK enables real-time streaming of Claude's responses by setting include_partial_messages to true, which yields StreamEvent messages containing raw API events as text and tool calls are generated. Developers can extract incremental text chunks from content_block_delta events with text_delta type and track tool execution through specific event types to build responsive chat interfaces. The feature has known limitations when extended thinking or structured outputs are explicitly enabled, as these features only return complete messages after generation finishes.

Read more →

Migrate to Claude Agent SDK - Claude Code Docs

The Claude Code SDK has been renamed to the Claude Agent SDK to reflect its expanded capabilities for building AI agents across multiple domains beyond coding tasks. Package names and imports have changed for both TypeScript/JavaScript and Python projects, requiring developers to uninstall old packages and install new ones while updating imports and, for Python, renaming ClaudeCodeOptions to ClaudeAgentOptions. The SDK no longer uses a default system prompt, providing developers with better control over custom agent behavior.

Read more →

Todo Lists - Claude Code Docs

The Claude Agent SDK includes built-in todo functionality that provides a structured way to manage tasks and display progress in complex workflows. Todos follow a predictable lifecycle from pending to in_progress to completed and removed states, and are automatically created by the SDK for multi-step tasks requiring three or more actions, user-provided task lists, non-trivial operations, and explicit user requests.

Read more →

Claude Code GitHub Actions - Claude Code Docs

Claude Code GitHub Actions enables AI-powered automation in GitHub workflows by responding to @claude mentions in pull requests and issues to analyze code, create pull requests, implement features, and fix bugs while adhering to project standards. The system operates on GitHub-hosted runners and requires installation of a Claude GitHub app along with an API key for secure execution. The GA version simplifies configuration by unifying prompts and CLI arguments compared to the previous beta release.

Read more →

Claude Code GitLab CI/CD - Claude Code Docs

Claude Code integrates with GitLab CI/CD to automatically generate merge requests and implement code changes triggered by comments or issues in a repository. The system executes AI tasks in isolated container jobs with branch protection and approvals, supporting multiple cloud providers including Claude API, Amazon Bedrock, and Google Vertex AI for enterprise deployments. Setup requires adding a single job to .gitlab-ci.yml and configuring an API key as a masked CI/CD variable.

Read more →

Glossary - Claude Code Docs

A glossary documents terminology specific to Claude Code, an AI coding agent platform that enables autonomous file manipulation, command execution, and code editing. Entries define concepts such as agent teams, agentic coding workflows, auto memory, hooks, MCP servers, and various features like checkpointing and compaction. Each definition links to detailed documentation pages covering the concepts in depth.

Read more →

Checkpointing - Claude Code Docs

Claude Code automatically creates checkpoints that capture file states before each edit, enabling users to rewind and restore code, conversation, or both to previous points in a session. The feature offers options to restore all changes, restore only conversation while keeping current code, restore only code changes, or summarize conversation from a selected point forward to free context window space. Checkpointing has limitations: it does not track changes made by bash commands, external file modifications, or concurrent session edits, and is designed as a session-level recovery tool that complements rather than replaces version control systems.

Read more →

Track team usage with analytics - Claude Code Docs

Claude Code provides analytics dashboards for Teams, Enterprise, and API customers to track developer usage patterns, contribution metrics, and engineering velocity impact. The dashboards display metrics including lines of code accepted, suggestion acceptance rates, daily active users, and pull request data, with Teams and Enterprise plans also offering GitHub integration for contribution tracking and a leaderboard of top contributors. Organizations can use the analytics to demonstrate ROI, monitor adoption trends, identify power users, and access attribution data that determines which code was written with Claude Code assistance.

Read more →

LLM gateway configuration - Claude Code Docs

LLM gateways provide a centralized proxy layer between Claude Code and model providers, offering centralized authentication, usage tracking, cost controls, audit logging, and model routing capabilities. To work with Claude Code, gateways must support at least one API format (Anthropic Messages, Bedrock InvokeModel, or Vertex rawPredict) and must properly forward or preserve specified request headers and body fields. Claude Code supports multiple gateway configurations, including LiteLLM integration with options for static API keys, dynamic key rotation, and various endpoint configurations across different cloud providers.

Read more →

Authentication - Claude Code Docs

Claude Code supports multiple authentication methods including Claude.ai accounts for individual users and Claude for Teams, Enterprise, Claude Console, or cloud providers like Amazon Bedrock and Google Vertex AI for organizations. Authentication occurs through browser login on first launch, with credentials securely stored and managed according to the user's setup and platform. When multiple credentials exist, Claude Code follows a precedence order prioritizing cloud provider credentials and environment variables, with long-lived tokens available for non-interactive environments such as CI pipelines.

Read more →

Securely deploying AI agents - Claude Code Docs

Claude Code documentation presents strategies for securely deploying AI agents, which can execute code and access files but may take unintended actions due to prompt injection or model errors. The guide outlines built-in security features such as permissions systems, command parsing, and sandbox mode, along with advanced isolation technologies including containers, gVisor, and virtual machines. Security principles of isolation, least privilege, and defense in depth enable organizations to select controls appropriate to their specific threat models and operational requirements.

Read more →

Troubleshoot installation and login - Claude Code Docs

The documentation presents troubleshooting guidance for Claude Code installation and login failures through an error-matching reference table paired with diagnostic procedures. It addresses network connectivity, PATH configuration, conflicting installations, directory permissions, and binary validation across macOS, Linux, and Windows platforms with platform-specific commands and solutions.

Read more →

Plugins in the SDK - Claude Code Docs

Plugins extend Claude Code with custom functionality including skills, agents, hooks, and MCP servers that can be loaded from local file system paths through the Agent SDK. Plugin directories must contain a .claude-plugin/plugin.json manifest file, and plugin skills are automatically namespaced with the plugin name when invoked as slash commands. Common implementation issues include path resolution problems, invalid JSON in the manifest file, and missing SKILL.md files in skill subdirectories.

Read more →

Security - Claude Code Docs

Claude Code implements security at its core through a permission-based architecture requiring explicit user approval for file edits, command execution, and other sensitive operations. Built-in protections include sandboxed bash commands with filesystem and network isolation, write access restrictions limited to project directories, and defenses against prompt injection attacks. Privacy safeguards encompass limited data retention, restricted user data access, and for cloud execution, isolated virtual machines with network controls and comprehensive audit logging.

Read more →

Legal and compliance - Claude Code Docs

Claude Code usage is governed by existing commercial agreements for API, AWS Bedrock, or Google Vertex customers, and Healthcare Business Associate Agreements automatically extend to Claude Code if Zero Data Retention is activated. Authentication is handled through OAuth tokens for individual subscription plan users and API keys for developers, with Anthropic prohibiting third-party developers from offering Claude.ai login on behalf of users. Usage must comply with Anthropic's Usage Policy, and security vulnerabilities can be reported through HackerOne.

Read more →

Use Claude Code with Chrome (beta) - Claude Code Docs

Claude Code integrates with the Claude in Chrome browser extension to enable browser automation capabilities that allow coding tasks to be chained with browser actions in a single workflow. The integration enables live debugging, design verification, web app testing, data extraction, and task automation, while also allowing interaction with authenticated web applications without API connectors. Browser actions run in real time in a visible Chrome window, with the extension pausing when login pages or CAPTCHAs are encountered to request manual handling.

Read more →

Orchestrate teams of Claude Code sessions - Claude Code Docs

Agent teams coordinate multiple Claude Code instances where one session acts as a team lead assigning tasks while teammates work independently in their own context windows and communicate directly with each other. These teams are most effective for parallel tasks like research, feature development, and debugging with competing hypotheses, though they require more tokens and coordination overhead than single sessions. Teammates can be controlled through natural language instructions, directed to planning phases before implementation, and can claim tasks from a shared task list or receive explicit assignments from the lead.

Read more →

Schedule recurring tasks in Claude Code Desktop - Claude Code Docs

Claude Code Desktop supports scheduling recurring tasks that automatically start sessions at configured times and frequencies to handle recurring work such as code reviews, dependency updates, or daily briefings. Tasks can run locally on the user's machine with access to local files and tools, or remotely on Anthropic-managed infrastructure that continues running when the computer is off. Local tasks run whenever the desktop app is active; if a task's scheduled time is missed while the computer is asleep, a catch-up run automatically triggers for the most recently missed time.

Read more →

Handle approvals and user input - Claude Code Docs

Applications handling Claude integrations must surface user input requests through a canUseTool callback, which pauses execution when Claude needs permission to use tools like deleting files or when it requires clarifying answers to multiple-choice questions. The callback receives the tool name, input parameters, and context, and returns either an Allow or Deny response, with options to modify inputs, reject requests with explanations, suggest alternatives, or redirect entirely. For clarifying questions generated by the AskUserQuestion tool, the application displays Claude's generated questions and options to users and returns their selections.

Read more →

Configure auto mode - Claude Code Docs

Auto mode allows Claude Code to run without permission prompts by routing tool calls through a classifier that blocks irreversible or destructive actions outside the trusted environment. Organizations configure this classifier through the autoMode settings block, specifying trusted repositories, cloud buckets, and domains so routine internal operations are not blocked. The configuration can be defined across multiple scopes and includes fields for defining trusted infrastructure (environment), blocking rules (soft_deny), and exceptions to those rules (allow).

Read more →

Constrain plugin dependency versions - Claude Code Docs

Plugin authors declare versioned dependencies in plugin.json using semver ranges to prevent automatic updates from breaking their plugins. Claude Code resolves dependencies during installation and intersects multiple constraints to find the highest version satisfying all requirements, with cross-marketplace dependencies requiring explicit allowlisting. Plugin releases must be tagged as {plugin-name}--v{version} for Claude Code to identify available versions during resolution.

Read more →

Debug your configuration - Claude Code Docs

Configuration issues in Claude Code typically arise from files not loading, loading from unexpected locations, or being overridden by other files, and can be debugged using commands like /context, /memory, /skills, /mcp, and /doctor to reveal what configuration actually loaded and identify schema errors. Settings merge across managed, user, project, and local scopes with specific priority rules, and common problems stem from matcher syntax errors in hooks, incorrect file locations for MCP servers and skills, and settings being overridden by environment variables or higher-priority scopes.

Read more →

Data usage - Claude Code Docs

Anthropic's Claude Code applies different data policies to consumer users (Free, Pro, Max), who can opt into model training with a 5-year retention period, and commercial users (Team, Enterprise, API), who default to 30-day retention unless they explicitly opt in through programs like the Developer Partner Program. Cloud execution runs code in isolated virtual machines subject to these retention policies, while all data transmissions use TLS encryption and telemetry services log operational metrics without including code or file paths. Users can manage their data preferences through privacy settings and opt out of specific services using environment variables.

Read more →

Subagents in the SDK - Claude Code Docs

Subagents are separate agent instances that main agents can spawn to handle specialized subtasks with isolated context, parallel execution, and tool restrictions. Defined programmatically through an agents parameter or as markdown files, subagents are automatically invoked by Claude based on their descriptions or explicitly called by name. Subagents can be resumed to continue previous work, with their transcripts persisting independently from the main conversation while retaining their conversation history across sessions.

Read more →

Work with sessions - Claude Code Docs

Sessions store conversation history including prompts, tool calls, results, and responses, and the SDK automatically saves them to disk for later retrieval. Different session-handling approaches serve different needs: continue resumes the most recent session, resume targets a specific session by ID, and fork creates a divergent copy of an existing session without changing the original. The ClaudeSDKClient in Python and continue: true in TypeScript offer automatic session management for multi-turn conversations within a single process.

Read more →

Explore the .claude directory - Claude Code Docs

Claude Code reads project configuration from .claude directories and global configuration from ~/.claude in the home directory. Most users primarily configure the system through CLAUDE.md and settings.json, though optional files support skills, rules, subagents, and MCP connections as needed. The documentation includes a comprehensive file reference, troubleshooting guide, and diagnostic commands to verify configuration has loaded correctly.

Read more →

Best Practices for Claude Code - Claude Code Docs

Claude Code operates as an agentic coding environment capable of autonomously exploring, planning, and implementing solutions, though its performance declines as the context window fills with conversation history, file contents, and command outputs. Best practices for maximizing effectiveness include giving Claude verification criteria for testing its work, separating exploration and planning from coding, providing specific context and referencing existing code patterns in prompts, and using a CLAUDE.md file to maintain persistent guidelines and architectural decisions.

Read more →

Zero data retention - Claude Code Docs

Zero Data Retention (ZDR) is a feature available for Claude Code on Claude for Enterprise that prevents prompts and model responses from being stored by Anthropic after the response is returned, except where required by law or to address policy violations. Enterprise customers with ZDR enabled gain access to administrative capabilities including cost controls, analytics dashboards, and audit logs, though the feature excludes chat conversations, Cowork sessions, and third-party integrations. Organizations can request ZDR for Claude Code by contacting their Anthropic account team for review and enablement.

Read more →

Find bugs with ultrareview - Claude Code Docs

Ultrareview is a deep code review feature in Claude Code that deploys multiple reviewer agents in a remote sandbox to identify bugs in code branches or pull requests. The feature offers higher signal by independently verifying findings, broader coverage through parallel agent exploration, and eliminates local resource consumption during the review process. Ultrareview requires Claude.ai authentication, costs approximately $5-$20 per review after three complimentary runs for Pro and Max users, and typically completes in 5-10 minutes.

Read more →

Sandboxing - Claude Code Docs

Claude Code features native sandboxing using OS-level primitives to enforce filesystem and network isolation, reducing the need for constant permission prompts while maintaining security boundaries. The sandbox restricts write access to the current working directory by default while allowing reads across most of the system, and controls network access through a proxy server that only permits approved domains. Users can enable sandboxing through the /sandbox command and customize behavior through settings to grant subprocess write access to specific paths outside the project directory.

Read more →

TypeScript SDK V2 interface (preview) - Claude Code Docs

The V2 Claude Agent TypeScript SDK simplifies multi-turn conversations by eliminating async generators and replacing them with separate send()/stream() cycles for each interaction. The API reduces to three core concepts: createSession()/resumeSession() to start or continue conversations, session.send() to dispatch messages, and session.stream() to retrieve responses. Sessions persist context across multiple exchanges, support resumption by ID for long-running workflows, and can be closed either manually or automatically using TypeScript 5.2+ resource cleanup features.

Read more →

Hosting the Agent SDK - Claude Code Docs

The Claude Agent SDK operates as a long-running process that maintains conversational state and executes commands in a persistent environment, distinguishing it from traditional stateless LLM APIs. Deployment requires container-based sandboxing with specified system requirements including Python 3.10+ or Node.js 18+, 1GiB RAM, 5GiB disk space, and 1 CPU. Four production deployment patterns are available—ephemeral sessions, long-running sessions, hybrid sessions, and single containers—with multiple sandbox providers including Modal, Cloudflare, Daytona, E2B, Fly, and Vercel offering hosting options.

Read more →

Error reference - Claude Code Docs

Claude Code's error reference documentation lists runtime errors and recovery procedures applicable across the CLI, Desktop app, and web interface. The guide categorizes errors into server errors, usage limits, authentication issues, network problems, and request errors, with specific troubleshooting steps for each. Claude Code automatically retries transient failures up to 10 times with exponential backoff before displaying an error to the user, with configurable retry behavior through environment variables.

Read more →

Use Claude Code in VS Code - Claude Code Docs

The VS Code extension provides a native graphical interface for Claude Code integrated directly into the IDE, allowing developers to review and edit Claude's plans before accepting them, auto-accept edits, @-mention files with specific line ranges, and access conversation history. The extension supports multiple conversations in separate tabs or windows, permission modes that control how Claude makes changes, command menus for additional functionality, and the ability to reference files and folders for context. Additional features include resuming past conversations, customizing the panel layout, managing plugins, automating browser tasks with Chrome integration, and accessing various VS Code commands through the Command Palette.

Read more →

Continue local sessions from any device with Remote Control - Claude Code Docs

Remote Control connects claude.ai/code or the Claude app to a local Claude Code session, allowing work to continue across devices while processing remains entirely on the local machine. Sessions synchronize across all connected devices and automatically reconnect after interruptions, maintaining access to the full local environment including filesystem, MCP servers, and project configuration. The feature can be started from the CLI or VS Code extension and accessed via direct URL, QR code, or session list.

Read more →

Week 13 · March 23–27, 2026 - Claude Code Docs

Claude Code introduced an auto permission mode that classifies prompts and allows safe edits to run without interruption while blocking suspicious actions, alongside new desktop control capabilities that enable Claude to open native applications, interact with GUIs, and verify changes on screen. Additional updates include auto-fix functionality for pull requests to handle CI failures automatically, transcript search functionality, native PowerShell support for Windows, and improved hook scoping through conditional if fields.

Read more →

Track cost and usage - Claude Code Docs

The Claude Agent SDK provides detailed token usage information and cost tracking for each interaction with Claude, with TypeScript and Python SDKs exposing the same data through different field naming conventions. The guide explains how to track total costs per query call, break down usage by individual steps and models, and leverage the SDK's automatic prompt caching to reduce expenses. Cost data is available on both successful and failed result messages, and developers should accumulate costs across multiple query calls since the SDK reports costs per individual call rather than at the session level.

Read more →

Modifying system prompts - Claude Code Docs

The Claude Agent SDK provides multiple methods for customizing system prompts that define Claude's behavior, capabilities, and response style. CLAUDE.md files offer persistent project-level instructions that serve as version-controlled team memory, while output styles provide reusable saved configurations and developers can append custom instructions to preserve built-in functionality or use entirely custom system prompts for complete control. Each approach involves different tradeoffs regarding persistence, reusability, and customization level.

Read more →

JetBrains IDEs - Claude Code Docs

Claude Code integrates with JetBrains IDEs through a plugin that supports multiple IDE types including IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, and GoLand. The plugin provides features such as quick launching via keyboard shortcuts, direct diff viewing in the IDE, automatic selection context sharing, file reference shortcuts, and diagnostic error sharing. Installation occurs through the JetBrains marketplace, with configuration options available for diff tool display and command path specification, while security considerations exist regarding auto-edit mode permissions.

Read more →

Code Review - Claude Code Docs

Code Review examines GitHub pull requests using specialized agents to identify logic errors, security vulnerabilities, edge case failures, and regressions, posting inline comments tagged by severity level that do not block merges. The service triggers automatically or on demand via @claude review commands and supports customization through CLAUDE.md and REVIEW.md configuration files.

Read more →

Automate work with routines - Claude Code Docs

Routines are saved Claude Code configurations combining a prompt, repositories, and connectors that execute automatically on Anthropic's cloud infrastructure when triggered by scheduled cadences, API endpoints, or GitHub repository events. These autonomous code sessions enable teams to automate unattended, repeatable work such as backlog maintenance, alert triage, code review, deploy verification, and documentation updates, with all actions attributed to the account owner.

Read more →

Get started with the desktop app - Claude Code Docs

The Claude Code desktop app provides a graphical interface with three tabs—Chat for general conversation, Cowork for autonomous background work, and Code for interactive coding with local file access. The Code tab features a sidebar for managing parallel sessions, drag-and-drop layout with integrated terminal and file editor, visual diff review, live app preview, GitHub PR monitoring with auto-merge capabilities, and scheduled task automation. Installation requires no separate setup beyond downloading the desktop app itself, and the tool supports permission mode controls, real-time code review, and integration with external services like GitHub, Slack, and Linear.

Read more →

Create plugins - Claude Code Docs

Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers. Looking to install existing plugins? See Discover and install

Read more →

Optimize your terminal setup - Claude Code Docs

Themes and appearance Claude cannot control the theme of your terminal. That’s handled by your terminal application. You can match Claude Code’s theme to your terminal any time via the /config command. For additional customization of the Claude Code interface

Read more →

What's new - Claude Code Docs

A weekly digest of notable Claude Code features, with code snippets, demos, and context on why they matter. The weekly dev digest highlights the features most likely to change how you work. Each entry includes runnable code, a short demo, and a link to the

Read more →

Week 15 · April 6–10, 2026 - Claude Code Docs

Kick off plan mode in the cloud from your terminal, then review the result in your browser. Claude drafts the plan in a Claude Code on the web session while your terminal stays free; when it’s ready you comment on individual sections, ask for revisions, and

Read more →

Common workflows - Claude Code Docs

This page covers practical workflows for everyday development: exploring unfamiliar code, debugging, refactoring, writing tests, creating PRs, and managing sessions. Each section includes example prompts you can adapt to your own projects. For higher-level

Read more →

Enterprise network configuration - Claude Code Docs

Claude Code supports various enterprise network and security configurations through environment variables. This includes routing traffic through corporate proxy servers, trusting custom Certificate Authorities (CA), and authenticating with mutual Transport

Read more →

Claude Code on Microsoft Foundry - Claude Code Docs

Prerequisites Before configuring Claude Code with Microsoft Foundry, ensure you have: An Azure subscription with access to Microsoft Foundry RBAC permissions to create Microsoft Foundry resources and deployments Azure CLI installed and configured (optional -

Read more →

Run prompts on a schedule - Claude Code Docs

Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of

Read more →

Configure server-managed settings - Claude Code Docs

Server-managed settings allow administrators to centrally configure Claude Code through a web-based interface on Claude.ai. Claude Code clients automatically receive these settings when users authenticate with their organization credentials. This approach is

Read more →

Quickstart - Claude Code Docs

This quickstart guide will have you using AI-powered coding assistance in a few minutes. By the end, you’ll understand how to use Claude Code for common development tasks. Before you begin Make sure you have: A terminal or command prompt open If you’ve never

Read more →

Advanced setup - Claude Code Docs

This page covers system requirements, platform-specific installation details, updates, and uninstallation. For a guided walkthrough of your first session, see the quickstart. If you’ve never used a terminal before, see the terminal guide. System requirements

Read more →

Agent SDK reference - TypeScript - Claude Code Docs

Installation npm install @anthropic-ai/claude-agent-sdk Functions query() The primary function for interacting with Claude Code. Creates an async generator that streams messages as they arrive. function query({ prompt, options }: { prompt: string |

Read more →

Agent SDK reference - Python - Claude Code Docs

Installation pip install claude-agent-sdk Choosing between query() and ClaudeSDKClient The Python SDK provides two ways to interact with Claude Code: Quick comparison Featurequery()ClaudeSDKClient SessionCreates new session each timeReuses same session

Read more →

Agent SDK overview - Claude Code Docs

Build AI agents that autonomously read files, run commands, search the web, edit code, and more. The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript. The Agent SDK includes

Read more →

Hooks reference - Claude Code Docs

Hooks are user-defined shell commands, HTTP endpoints, or LLM prompts that execute automatically at specific points in Claude Code’s lifecycle. Use this reference to look up event schemas, configuration options, JSON input/output formats, and advanced

Read more →

Customize keyboard shortcuts - Claude Code Docs

Claude Code supports customizable keyboard shortcuts. Run /keybindings to create or open your configuration file at ~/.claude/keybindings.json. Configuration file The keybindings configuration file is an object with a bindings array. Each block specifies a

Read more →

Plugins reference - Claude Code Docs

This reference provides complete technical specifications for the Claude Code plugin system, including component schemas, CLI commands, and development tools. A plugin is a self-contained directory of components that extends Claude Code with custom

Read more →

Automate workflows with hooks - Claude Code Docs

Hooks are user-defined shell commands that execute at specific points in Claude Code’s lifecycle. They provide deterministic control over Claude Code’s behavior, ensuring certain actions always happen rather than relying on the LLM to choose to run them. Use

Read more →

Tools reference - Claude Code Docs

Claude Code has access to a set of built-in tools that help it understand and modify your codebase. The tool names are the exact strings you use in permission rules, subagent tool lists, and hook matchers. To disable a tool entirely, add its name to the deny

Read more →

CLI reference - Claude Code Docs

--add-dirAdd additional working directories for Claude to read and edit files. Grants file access; most .claude/ configuration is not discovered from these directories. Validates each path exists as a directoryclaude --add-dir ../apps ../lib --agentSpecify an

Read more →

Model configuration - Claude Code Docs

Available models For the model setting in Claude Code, you can configure either: A model alias A model name Anthropic API: A full model name Bedrock: an inference profile ARN Foundry: a deployment name Vertex: a version name Model aliases Model aliases

Read more →

Claude Code on Google Vertex AI - Claude Code Docs

Prerequisites Before configuring Claude Code with Vertex AI, ensure you have: A Google Cloud Platform (GCP) account with billing enabled A GCP project with Vertex AI API enabled Access to desired Claude models (for example, Claude Sonnet 4.6) Google Cloud SDK

Read more →

Claude Code on Amazon Bedrock - Claude Code Docs

Prerequisites Before configuring Claude Code with Bedrock, ensure you have: An AWS account with Bedrock access enabled Access to desired Claude models (for example, Claude Sonnet 4.6) in Bedrock AWS CLI installed and configured (optional - only needed if you

Read more →

Enterprise deployment overview - Claude Code Docs

Organizations can deploy Claude Code through Anthropic directly or through a cloud provider. This page helps you choose the right configuration. Compare deployment options For most organizations, Claude for Teams or Claude for Enterprise provides the best

Read more →

Manage costs effectively - Claude Code Docs

Claude Code consumes tokens for each interaction. Costs vary based on codebase size, query complexity, and conversation length. The average cost is $6 per developer per day, with daily costs remaining below $12 for 90% of users. For team usage, Claude Code

Read more →

Voice dictation - Claude Code Docs

Hold a key and speak to dictate your prompts. Your speech is transcribed live into the prompt input, so you can mix voice and typing in the same message. Enable dictation with /voice. The default push-to-talk key is Space; rebind to a modifier combination to

Read more →

Extend Claude Code - Claude Code Docs

Claude Code combines a model that reasons about your code with built-in tools for file operations, search, execution, and web access. The built-in tools cover most coding tasks. This guide covers the extension layer: features you add to customize what Claude

Read more →

How Claude remembers your project - Claude Code Docs

Each Claude Code session begins with a fresh context window. Two mechanisms carry knowledge across sessions: CLAUDE.md files: instructions you write to give Claude persistent context Auto memory: notes Claude writes itself based on your corrections and

Read more →

Claude Code overview - Claude Code Docs

Claude Code is an AI-powered coding assistant that helps you build features, fix bugs, and automate development tasks. It understands your entire codebase and can work across multiple files and tools to get things done. Get started Choose your environment to

Read more →

Claude Code settings - Claude Code Docs

Claude Code offers a variety of settings to configure its behavior to meet your needs. You can configure Claude Code by running the /config command when using the interactive REPL, which opens a tabbed Settings interface where you can view status information

Read more →

Customize your status line - Claude Code Docs

The status line is a customizable bar at the bottom of Claude Code that runs any shell script you configure. It receives JSON session data on stdin and displays whatever your script prints, giving you a persistent, at-a-glance view of context usage, costs,

Read more →

Configure permissions - Claude Code Docs

Claude Code supports fine-grained permissions so that you can specify exactly what the agent is allowed to do and what it cannot. Permission settings can be checked into version control and distributed to all developers in your organization, as well as

Read more →

Choose a permission mode - Claude Code Docs

When Claude wants to edit a file, run a shell command, or make a network request, it pauses and asks you to approve the action. Permission modes control how often that pause happens. The mode you pick shapes the flow of a session: default mode has you review

Read more →

Create custom subagents - Claude Code Docs

Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent’s

Read more →

Monitoring - Claude Code Docs

Track Claude Code usage, costs, and tool activity across your organization by exporting telemetry data through OpenTelemetry (OTel). Claude Code exports metrics as time series data via the standard metrics protocol, events via the logs/events protocol, and

Read more →

Connect Claude Code to tools via MCP - Claude Code Docs

Claude Code can connect to hundreds of external tools and data sources through the Model Context Protocol (MCP), an open source standard for AI-tool integrations. MCP servers give Claude Code access to your tools, databases, and APIs. What you can do with MCP

Read more →

Configure permissions - Claude Code Docs

The Claude Agent SDK provides permission controls to manage how Claude uses tools. Use permission modes and rules to define what’s allowed automatically, and the canUseTool callback to handle everything else at runtime. How permissions are evaluated When

Read more →

Fullscreen rendering - Claude Code Docs

Fullscreen rendering is an alternative rendering path for the Claude Code CLI that eliminates flicker, keeps memory usage flat in long conversations, and adds mouse support. It draws the interface on the terminal’s alternate screen buffer, like vim or htop,

Read more →

Run Claude Code programmatically - Claude Code Docs

The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code. It’s available as a CLI for scripts and CI/CD, or as Python and TypeScript packages for full programmatic control. To run Claude Code programmatically from the

Read more →

Quickstart - Claude Code Docs

Use the Agent SDK to build an AI agent that reads your code, finds bugs, and fixes them, all without manual intervention. What you’ll do: Set up a project with the Agent SDK Create a file with some buggy code Run an agent that finds and fixes the bugs

Read more →

Use Claude Code Desktop - Claude Code Docs

The Code tab within the Claude Desktop app lets you use Claude Code through a graphical interface instead of the terminal. Desktop adds these capabilities on top of the standard Claude Code experience: Visual diff review with inline comments Live app preview

Read more →

Environment variables - Claude Code Docs

ANTHROPIC_API_KEYAPI key sent as X-Api-Key header. When set, this key is used instead of your Claude Pro, Max, Team, or Enterprise subscription even if you are logged in. In non-interactive mode (-p), the key is always used when present. In interactive mode,

Read more →

How Claude Code works - Claude Code Docs

Claude Code is an agentic assistant that runs in your terminal. While it excels at coding, it can help with anything you can do from the command line: writing docs, running builds, searching files, researching topics, and more. This guide covers the core

Read more →

Interactive mode - Claude Code Docs

Keyboard shortcuts General controls ShortcutDescriptionContext Ctrl+CCancel current input or generationStandard interrupt Ctrl+X Ctrl+KKill all background agents. Press twice within 3 seconds to confirmBackground agent control Ctrl+DExit Claude Code

Read more →

How the agent loop works - Claude Code Docs

The Agent SDK lets you embed Claude Code’s autonomous agent loop in your own applications. The SDK is a standalone package that gives you programmatic control over tools, permissions, cost limits, and output. You don’t need the Claude Code CLI installed to

Read more →

Troubleshooting - Claude Code Docs

Troubleshoot installation issues Find the error message or symptom you’re seeing: What you seeSolution command not found: claude or 'claude' is not recognizedFix your PATH syntax error near unexpected token '<'Install script returns HTML curl: (56) Failure

Read more →

Extend Claude with skills - Claude Code Docs

Skills extend what Claude can do. Create a SKILL.md file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with /skill-name. Claude Code skills follow the Agent Skills open standard, which

Read more →

Built-in commands - Claude Code Docs

/add-dir <path>Add a working directory for file access during the current session. Most .claude/ configuration is not discovered from the added directory /agentsManage agent configurations /autofix-pr [prompt]Spawn a Claude Code on the web session that

Read more →

Use Claude Code on the web - Claude Code Docs

Claude Code on the web runs tasks on Anthropic-managed cloud infrastructure at claude.ai/code. Sessions persist even if you close your browser, and you can monitor them from the Claude mobile app. This page covers: GitHub authentication options: two ways to

Read more →

Changelog - Claude Code Docs

Release notes for Claude Code, including new features, improvements, and bug fixes by version. This page is generated from the CHANGELOG.md on GitHub. Run claude --version to check your installed version. Added focus view toggle (Ctrl+O) in NO_FLICKER mode

Read more →

Observability with OpenTelemetry - Claude Code Docs

When you run agents in production, you need visibility into what they did: which tools they called how long each model request took how many tokens were spent where failures occurred The Agent SDK can export this data as OpenTelemetry traces, metrics, and log

Read more →

Platforms and integrations - Claude Code Docs

Claude Code runs the same underlying engine everywhere, but each surface is tuned for a different way of working. This page helps you pick the right platform for your workflow and connect the tools you already use. Where to run Claude Code Choose a platform

Read more →

Development containers - Claude Code Docs

The reference devcontainer setup and associated Dockerfile offer a preconfigured development container that you can use as is, or customize for your needs. This devcontainer works with the Visual Studio Code Dev Containers extension and similar tools. The

Read more →

Schedule tasks on the web - Claude Code Docs

A scheduled task runs a prompt on a recurring cadence using Anthropic-managed infrastructure. Tasks keep working even when your computer is off. A few examples of recurring work you can automate: Reviewing open pull requests each morning Analyzing CI failures

Read more →

Plan in the cloud with ultraplan - Claude Code Docs

Ultraplan hands a planning task from your local CLI to a Claude Code on the web session running in plan mode. Claude drafts the plan in the cloud while you keep working in your terminal. When the plan is ready, you open it in your browser to comment on

Read more →