SpyBara
Go Premium

Documentation 2025-12-18 21:01 UTC to 2025-12-19 21:01 UTC

8 files changed +199 −531. View all changes and history on the product overview
2025
Sat 27 06:02 Tue 23 18:02 Sat 20 00:04 Fri 19 21:01 Thu 18 21:01 Wed 17 15:02 Tue 16 21:01 Mon 15 21:01 Sat 13 06:02 Fri 12 21:01 Thu 11 21:02 Wed 10 09:03 Tue 9 18:01 Mon 8 21:01 Sat 6 18:02 Fri 5 00:04 Thu 4 21:02 Wed 3 00:04 Tue 2 21:01 Mon 1 03:31

chrome.md +8 −6

Details

3> Connect Claude Code to your browser to test web apps, debug with console logs, and automate browser tasks.3> Connect Claude Code to your browser to test web apps, debug with console logs, and automate browser tasks.

4 4 

5<Note>5<Note>

6 Chrome integration is in beta and currently works with Google Chrome only. Arc and Dia browsers are not yet supported. WSL (Windows Subsystem for Linux) is also not supported.6 Chrome integration is in beta and currently works with Google Chrome only. It is not yet supported on Brave, Arc, or other Chromium-based browsers. WSL (Windows Subsystem for Linux) is also not supported.

7</Note>7</Note>

8 8 

9Claude Code integrates with the Claude in Chrome browser extension to give you browser automation capabilities directly from your terminal. Build in your terminal, then test and debug in your browser without switching contexts.9Claude Code integrates with the Claude in Chrome browser extension to give you browser automation capabilities directly from your terminal. Build in your terminal, then test and debug in your browser without switching contexts.


27Before using Claude Code with Chrome, you need:27Before using Claude Code with Chrome, you need:

28 28 

29* [Google Chrome](https://www.google.com/chrome/) browser29* [Google Chrome](https://www.google.com/chrome/) browser

30* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) installed30* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or higher

31* [Claude Code CLI](/en/quickstart#step-1:-install-claude-code) installed31* [Claude Code CLI](/en/quickstart#step-1:-install-claude-code) version 2.0.73 or higher

32* A paid Claude plan (Pro, Team, or Enterprise)32* A paid Claude plan (Pro, Team, or Enterprise)

33 33 

34## How the integration works34## How the integration works


180 180 

181If Claude Code shows "Chrome extension not detected":181If Claude Code shows "Chrome extension not detected":

182 182 

1831. Verify the extension is installed in Chrome1831. Verify the Chrome extension (version 1.0.36 or higher) is installed

1842. Check that Chrome is running1842. Verify Claude Code is version 2.0.73 or higher by running `claude --version`

1853. Run `/chrome` and select "Reconnect extension" to re-establish the connection1853. Check that Chrome is running

1864. Run `/chrome` and select "Reconnect extension" to re-establish the connection

1875. If the issue persists, restart both Claude Code and Chrome

186 188 

187### Browser not responding189### Browser not responding

188 190 

desktop.md +23 −1

Details

67 The bundled Claude Code version in Desktop may differ from the latest CLI version. Desktop prioritizes stability while the CLI may have newer features.67 The bundled Claude Code version in Desktop may differ from the latest CLI version. Desktop prioritizes stability while the CLI may have newer features.

68</Note>68</Note>

69 69 

70### Enterprise configuration70## Environment configuration

71 

72For local environments, Claude Code on desktop automatically extracts your `$PATH` environment variable from your shell configuration. This allows local sessions to access development tools like `yarn`, `npm`, `node`, and other commands available in your terminal without additional setup.

73 

74### Custom environment variables

75 

76Select "Local" environment, then to the right, select the settings button. This will open a dialog where you can update local environment variables. This is useful for setting project-specific variables or API keys that your development workflows require. Environment variable values are masked in the UI for security reasons.

77 

78<Note>

79 Environment variables must be specified as key-value pairs, in [`.env` format](https://www.dotenv.org/). For example:

80 

81 ```

82 API_KEY=your_api_key

83 DEBUG=true

84 

85 # Multiline values - wrap in quotes

86 CERT="-----BEGIN CERT-----

87 MIIE...

88 -----END CERT-----"

89 ```

90</Note>

91 

92## Enterprise configuration

71 93 

72Organizations can disable local Claude Code use in the desktop application with the `isClaudeCodeForDesktopEnabled` [enterprise policy option](https://support.claude.com/en/articles/12622667-enterprise-configuration#h_003283c7cb). Additionally, Claude Code on the web can be disabled in your [admin settings](https://claude.ai/admin-settings/claude-code).94Organizations can disable local Claude Code use in the desktop application with the `isClaudeCodeForDesktopEnabled` [enterprise policy option](https://support.claude.com/en/articles/12622667-enterprise-configuration#h_003283c7cb). Additionally, Claude Code on the web can be disabled in your [admin settings](https://claude.ai/admin-settings/claude-code).

73 95 

headless.md +63 −151

Details

1# Headless mode1# Run Claude Code programmatically

2 2 

3> Run Claude Code programmatically without interactive UI3> Use the Agent SDK to run Claude Code programmatically from the CLI, Python, or TypeScript.

4 4 

5## Overview5The [Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview) 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](https://platform.claude.com/docs/en/agent-sdk/python) and [TypeScript](https://platform.claude.com/docs/en/agent-sdk/typescript) packages for full programmatic control.

6 6 

7The headless mode allows you to run Claude Code programmatically from command line scripts and automation tools without any interactive UI.7<Note>

8 The CLI was previously called "headless mode." The `-p` flag and all CLI options work the same way.

9</Note>

8 10 

9## Basic usage11To run Claude Code programmatically from the CLI, pass `-p` with your prompt and any [CLI options](/en/cli-reference):

10 

11The primary command-line interface to Claude Code is the `claude` command. Use the `--print` (or `-p`) flag to run in non-interactive mode and print the final result:

12 12 

13```bash theme={null}13```bash theme={null}

14claude -p "Stage my changes and write a set of commits for them" \14claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash"

15 --allowedTools "Bash,Read" \

16 --permission-mode acceptEdits

17```15```

18 16 

19## Configuration Options17This page covers using the Agent SDK via the CLI (`claude -p`). For the Python and TypeScript SDK packages with structured outputs, tool approval callbacks, and native message objects, see the [full Agent SDK documentation](https://platform.claude.com/docs/en/agent-sdk/overview).

20 18 

21Headless mode leverages all the CLI options available in Claude Code. Here are the key ones for automation and scripting:19## Basic usage

22 

23| Flag | Description | Example |

24| :------------------------- | :---------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |

25| `--print`, `-p` | Run in non-interactive mode | `claude -p "query"` |

26| `--output-format` | Specify output format (`text`, `json`, `stream-json`) | `claude -p --output-format json` |

27| `--resume`, `-r` | Resume a conversation by session ID | `claude --resume abc123` |

28| `--continue`, `-c` | Continue the most recent conversation | `claude --continue` |

29| `--verbose` | Enable verbose logging | `claude --verbose` |

30| `--append-system-prompt` | Append to system prompt (only with `--print`) | `claude --append-system-prompt "Custom instruction"` |

31| `--allowedTools` | Tools that execute without prompting for permission (use `--tools` to restrict available tools) | `claude --allowedTools mcp__slack mcp__filesystem`<br /><br />`claude --allowedTools "Bash(npm install),mcp__filesystem"` |

32| `--disallowedTools` | Tools removed from the model's context (cannot be used) | `claude --disallowedTools mcp__splunk mcp__github`<br /><br />`claude --disallowedTools "Bash(git commit),mcp__github"` |

33| `--mcp-config` | Load MCP servers from a JSON file | `claude --mcp-config servers.json` |

34| `--permission-prompt-tool` | MCP tool for handling permission prompts (only with `--print`) | `claude --permission-prompt-tool mcp__auth__prompt` |

35 20 

36For a complete list of CLI options and features, see the [CLI reference](/en/cli-reference) documentation.21Add the `-p` (or `--print`) flag to any `claude` command to run it non-interactively. All [CLI options](/en/cli-reference) work with `-p`, including:

37 22 

38## Multi-turn conversations23* `--continue` for [continuing conversations](#continue-conversations)

24* `--allowedTools` for [auto-approving tools](#auto-approve-tools)

25* `--output-format` for [structured output](#get-structured-output)

39 26 

40For multi-turn conversations, you can resume conversations or continue from the most recent session:27This example asks Claude a question about your codebase and prints the response:

41 28 

42```bash theme={null}29```bash theme={null}

43# Continue the most recent conversation30claude -p "What does the auth module do?"

44claude --continue "Now refactor this for better performance"

45 

46# Resume a specific conversation by session ID

47claude --resume 550e8400-e29b-41d4-a716-446655440000 "Update the tests"

48 

49# Resume in non-interactive mode

50claude --resume 550e8400-e29b-41d4-a716-446655440000 "Fix all linting issues" --no-interactive

51```31```

52 32 

53## Output Formats33## Examples

54 34 

55### Text Output (Default)35These examples highlight common CLI patterns.

56 36 

57```bash theme={null}37### Get structured output

58claude -p "Explain file src/components/Header.tsx"

59# Output: This is a React component showing...

60```

61 38 

62### JSON Output39Use `--output-format` to control how responses are returned:

63 40 

64Returns structured data including metadata:41* `text` (default): plain text output

42* `json`: structured JSON with result, session ID, and metadata

43* `stream-json`: newline-delimited JSON for real-time streaming

65 44 

66```bash theme={null}45```bash theme={null}

67claude -p "How does the data layer work?" --output-format json46claude -p "Summarize this project" --output-format json

68```

69 

70Response format:

71 

72```json theme={null}

73{

74 "type": "result",

75 "subtype": "success",

76 "total_cost_usd": 0.003,

77 "is_error": false,

78 "duration_ms": 1234,

79 "duration_api_ms": 800,

80 "num_turns": 6,

81 "result": "The response text here...",

82 "session_id": "abc123"

83}

84```47```

85 48 

86### Streaming JSON Output49### Auto-approve tools

87 50 

88Streams each message as it is received:51Use `--allowedTools` to let Claude use certain tools without prompting. This example runs a test suite and fixes failures, allowing Claude to execute Bash commands and read/edit files without asking for permission:

89 52 

90```bash theme={null}53```bash theme={null}

91claude -p "Build an application" --output-format stream-json54claude -p "Run the test suite and fix any failures" \

55 --allowedTools "Bash,Read,Edit"

92```56```

93 57 

94Each conversation begins with an initial `init` system message, followed by a list of user and assistant messages, followed by a final `result` system message with stats. Each message is emitted as a separate JSON object.58### Run slash commands

95 

96## Input Formats

97 59 

98### Text Input (Default)60Run [slash commands](/en/slash-commands) non-interactively. This example generates a commit for staged changes using the `/commit` slash command:

99 61 

100```bash theme={null}62```bash theme={null}

101# Direct argument63claude -p "/commit"

102claude -p "Explain this code"

103 

104# From stdin

105echo "Explain this code" | claude -p

106```64```

107 65 

108### Streaming JSON Input66### Customize the system prompt

109 67 

110A stream of messages provided via `stdin` where each message represents a user turn. This allows multiple turns of a conversation without re-launching the `claude` binary and allows providing guidance to the model while it is processing a request.68Use `--append-system-prompt` to add instructions while keeping Claude Code's default behavior. This example pipes a PR diff to Claude and instructs it to review for security vulnerabilities:

111 

112Each message is a JSON 'User message' object, following the same format as the output message schema. Messages are formatted using the [`jsonl`](https://jsonlines.org/) format where each line of input is a complete JSON object. Streaming JSON input requires `-p` and `--output-format stream-json`.

113 69 

114```bash theme={null}70```bash theme={null}

115echo '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"Explain this code"}]}}' | claude -p --output-format=stream-json --input-format=stream-json --verbose71gh pr diff "$1" | claude -p \

72 --append-system-prompt "You are a security engineer. Review for vulnerabilities." \

73 --output-format json

116```74```

117 75 

118## Agent Integration Examples76See [system prompt flags](/en/cli-reference#system-prompt-flags) for more options including `--system-prompt` to fully replace the default prompt.

119 

120### SRE Incident Response Bot

121 77 

122```bash theme={null}78### Continue conversations

123#!/bin/bash

124 

125# Automated incident response agent

126investigate_incident() {

127 local incident_description="$1"

128 local severity="${2:-medium}"

129 

130 claude -p "Incident: $incident_description (Severity: $severity)" \

131 --append-system-prompt "You are an SRE expert. Diagnose the issue, assess impact, and provide immediate action items." \

132 --output-format json \

133 --allowedTools "Bash,Read,WebSearch,mcp__datadog" \

134 --mcp-config monitoring-tools.json

135}

136 

137# Usage

138investigate_incident "Payment API returning 500 errors" "high"

139```

140 79 

141### Automated Security Review80Use `--continue` to continue the most recent conversation, or `--resume` with a session ID to continue a specific conversation. This example runs a review, then sends follow-up prompts:

142 81 

143```bash theme={null}82```bash theme={null}

144# Security audit agent for pull requests83# First request

145audit_pr() {84claude -p "Review this codebase for performance issues"

146 local pr_number="$1"85 

147 86# Continue the most recent conversation

148 gh pr diff "$pr_number" | claude -p \87claude -p "Now focus on the database queries" --continue

149 --append-system-prompt "You are a security engineer. Review this PR for vulnerabilities, insecure patterns, and compliance issues." \88claude -p "Generate a summary of all issues found" --continue

150 --output-format json \

151 --allowedTools "Read,Grep,WebSearch"

152}

153 

154# Usage and save to file

155audit_pr 123 > security-report.json

156```89```

157 90 

158### Multi-turn Legal Assistant91If you're running multiple conversations, capture the session ID to resume a specific one:

159 92 

160```bash theme={null}93```bash theme={null}

161# Legal document review with session persistence94session_id=$(claude -p "Start a review" --output-format json | jq -r '.session_id')

162session_id=$(claude -p "Start legal review session" --output-format json | jq -r '.session_id')95claude -p "Continue that review" --resume "$session_id"

163 

164# Review contract in multiple steps

165claude -p --resume "$session_id" "Review contract.pdf for liability clauses"

166claude -p --resume "$session_id" "Check compliance with GDPR requirements"

167claude -p --resume "$session_id" "Generate executive summary of risks"

168```96```

169 97 

170## Best Practices98## Next steps

171 

172* **Use JSON output format** for programmatic parsing of responses:

173 

174 ```bash theme={null}

175 # Parse JSON response with jq

176 result=$(claude -p "Generate code" --output-format json)

177 code=$(echo "$result" | jq -r '.result')

178 cost=$(echo "$result" | jq -r '.cost_usd')

179 ```

180 

181* **Handle errors gracefully** - check exit codes and stderr:

182 

183 ```bash theme={null}

184 if ! claude -p "$prompt" 2>error.log; then

185 echo "Error occurred:" >&2

186 cat error.log >&2

187 exit 1

188 fi

189 ```

190 

191* **Use session management** for maintaining context in multi-turn conversations

192 

193* **Consider timeouts** for long-running operations:

194 99 

195 ```bash theme={null}100<CardGroup cols={2}>

196 timeout 300 claude -p "$complex_prompt" || echo "Timed out after 5 minutes"101 <Card title="Agent SDK quickstart" icon="play" href="https://platform.claude.com/docs/en/agent-sdk/quickstart">

197 ```102 Build your first agent with Python or TypeScript

103 </Card>

198 104 

199* **Respect rate limits** when making multiple requests by adding delays between calls105 <Card title="CLI reference" icon="terminal" href="/en/cli-reference">

106 Explore all CLI flags and options

107 </Card>

200 108 

201## Related Resources109 <Card title="GitHub Actions" icon="github" href="/en/github-actions">

110 Use the Agent SDK in GitHub workflows

111 </Card>

202 112 

203* [CLI usage and controls](/en/cli-reference) - Complete CLI documentation113 <Card title="GitLab CI/CD" icon="gitlab" href="/en/gitlab-ci-cd">

204* [Common workflows](/en/common-workflows) - Step-by-step guides for common use cases114 Use the Agent SDK in GitLab pipelines

115 </Card>

116</CardGroup>

205 117 

206 118 

207---119---

mcp.md +70 −16

Details

833 833 

834## Enterprise MCP configuration834## Enterprise MCP configuration

835 835 

836For organizations that need centralized control over MCP servers, Claude Code supports enterprise-managed MCP configurations. This allows IT administrators to:836For organizations that need centralized control over MCP servers, Claude Code supports two enterprise configuration options:

837 

8381. **Exclusive control with `managed-mcp.json`**: Deploy a fixed set of MCP servers that users cannot modify or extend

8392. **Policy-based control with allowlists/denylists**: Allow users to add their own servers, but restrict which ones are permitted

840 

841These options allow IT administrators to:

837 842 

838* **Control which MCP servers employees can access**: Deploy a standardized set of approved MCP servers across the organization843* **Control which MCP servers employees can access**: Deploy a standardized set of approved MCP servers across the organization

839* **Prevent unauthorized MCP servers**: Optionally restrict users from adding their own MCP servers844* **Prevent unauthorized MCP servers**: Restrict users from adding unapproved MCP servers

840* **Disable MCP entirely**: Remove MCP functionality completely if needed845* **Disable MCP entirely**: Remove MCP functionality completely if needed

841 846 

842### Setting up enterprise MCP configuration847### Option 1: Exclusive control with managed-mcp.json

843 848 

844System administrators deploy an enterprise MCP configuration file to a system-wide directory:849When you deploy a `managed-mcp.json` file, it takes **exclusive control** over all MCP servers. Users cannot add, modify, or use any MCP servers other than those defined in this file. This is the simplest approach for organizations that want complete control.

850 

851System administrators deploy the configuration file to a system-wide directory:

845 852 

846* macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`853* macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`

847* Linux and WSL: `/etc/claude-code/managed-mcp.json`854* Linux and WSL: `/etc/claude-code/managed-mcp.json`


876}883}

877```884```

878 885 

879### Restricting MCP servers with allowlists and denylists886### Option 2: Policy-based control with allowlists and denylists

880 887 

881In addition to providing enterprise-managed servers, administrators can control which MCP servers users are allowed to configure using `allowedMcpServers` and `deniedMcpServers` in the [managed settings file](/en/settings#settings-files):888Instead of taking exclusive control, administrators can allow users to configure their own MCP servers while enforcing restrictions on which servers are permitted. This approach uses `allowedMcpServers` and `deniedMcpServers` in the [managed settings file](/en/settings#settings-files).

889 

890<Note>

891 **Choosing between options**: Use Option 1 (`managed-mcp.json`) when you want to deploy a fixed set of servers with no user customization. Use Option 2 (allowlists/denylists) when you want to allow users to add their own servers within policy constraints.

892</Note>

882 893 

883#### Restriction options894#### Restriction options

884 895 

885Each entry in the allowlist or denylist can restrict servers in two ways:896Each entry in the allowlist or denylist can restrict servers in three ways:

886 897 

8871. **By server name** (`serverName`): Matches the configured name of the server8981. **By server name** (`serverName`): Matches the configured name of the server

8882. **By command** (`serverCommand`): Matches the exact command and arguments used to start stdio servers8992. **By command** (`serverCommand`): Matches the exact command and arguments used to start stdio servers

9003. **By URL pattern** (`serverUrl`): Matches remote server URLs with wildcard support

889 901 

890**Important**: Each entry must have **either** `serverName` **or** `serverCommand`, not both.902**Important**: Each entry must have exactly one of `serverName`, `serverCommand`, or `serverUrl`.

891 903 

892#### Example configuration904#### Example configuration

893 905 


900 912 

901 // Allow by exact command (for stdio servers)913 // Allow by exact command (for stdio servers)

902 { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] },914 { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] },

903 { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] }915 { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] },

916 

917 // Allow by URL pattern (for remote servers)

918 { "serverUrl": "https://mcp.company.com/*" },

919 { "serverUrl": "https://*.internal.corp/*" }

904 ],920 ],

905 "deniedMcpServers": [921 "deniedMcpServers": [

906 // Block by server name922 // Block by server name

907 { "serverName": "dangerous-server" },923 { "serverName": "dangerous-server" },

908 924 

909 // Block by exact command (for stdio servers)925 // Block by exact command (for stdio servers)

910 { "serverCommand": ["npx", "-y", "unapproved-package"] }926 { "serverCommand": ["npx", "-y", "unapproved-package"] },

927 

928 // Block by URL pattern (for remote servers)

929 { "serverUrl": "https://*.untrusted.com/*" }

911 ]930 ]

912}931}

913```932```


927 946 

928**Non-stdio server behavior**:947**Non-stdio server behavior**:

929 948 

930* Remote servers (HTTP, SSE, WebSocket) always match by name only949* Remote servers (HTTP, SSE, WebSocket) use URL-based matching when `serverUrl` entries exist in the allowlist

950* If no URL entries exist, remote servers fall back to name-based matching

931* Command restrictions do not apply to remote servers951* Command restrictions do not apply to remote servers

932 952 

953#### How URL-based restrictions work

954 

955URL patterns support wildcards using `*` to match any sequence of characters. This is useful for allowing entire domains or subdomains.

956 

957**Wildcard examples**:

958 

959* `https://mcp.company.com/*` - Allow all paths on a specific domain

960* `https://*.example.com/*` - Allow any subdomain of example.com

961* `http://localhost:*/*` - Allow any port on localhost

962 

963**Remote server behavior**:

964 

965* When the allowlist contains **any** `serverUrl` entries, remote servers **must** match one of those URL patterns

966* Remote servers cannot pass by name alone when URL restrictions are present

967* This ensures administrators can enforce which remote endpoints are allowed

968 

969<Accordion title="Example: URL-only allowlist">

970 ```json theme={null}

971 {

972 "allowedMcpServers": [

973 { "serverUrl": "https://mcp.company.com/*" },

974 { "serverUrl": "https://*.internal.corp/*" }

975 ]

976 }

977 ```

978 

979 **Result**:

980 

981 * HTTP server at `https://mcp.company.com/api`: ✅ Allowed (matches URL pattern)

982 * HTTP server at `https://api.internal.corp/mcp`: ✅ Allowed (matches wildcard subdomain)

983 * HTTP server at `https://external.com/mcp`: ❌ Blocked (doesn't match any URL pattern)

984 * Stdio server with any command: ❌ Blocked (no name or command entries to match)

985</Accordion>

986 

933<Accordion title="Example: Command-only allowlist">987<Accordion title="Example: Command-only allowlist">

934 ```json theme={null}988 ```json theme={null}

935 {989 {


987 1041 

988* `undefined` (default): No restrictions - users can configure any MCP server1042* `undefined` (default): No restrictions - users can configure any MCP server

989* Empty array `[]`: Complete lockdown - users cannot configure any MCP servers1043* Empty array `[]`: Complete lockdown - users cannot configure any MCP servers

990* List of entries: Users can only configure servers that match by name or command1044* List of entries: Users can only configure servers that match by name, command, or URL pattern

991 1045 

992#### Denylist behavior (`deniedMcpServers`)1046#### Denylist behavior (`deniedMcpServers`)

993 1047 


997 1051 

998#### Important notes1052#### Important notes

999 1053 

1000* These restrictions apply to all scopes: user, project, local, and even enterprise servers from `managed-mcp.json`1054* **Option 1 and Option 2 can be combined**: If `managed-mcp.json` exists, it has exclusive control and users cannot add servers. Allowlists/denylists still apply to the enterprise servers themselves.

1001* **Denylist takes absolute precedence**: If a server matches a denylist entry (by name or command), it will be blocked even if it's on the allowlist1055* **Denylist takes absolute precedence**: If a server matches a denylist entry (by name, command, or URL), it will be blocked even if it's on the allowlist

1002* Name-based and command-based restrictions work together: a server passes if it matches **either** a name entry **or** a command entry (unless blocked by denylist)1056* Name-based, command-based, and URL-based restrictions work together: a server passes if it matches **either** a name entry, a command entry, or a URL pattern (unless blocked by denylist)

1003 1057 

1004<Note>1058<Note>

1005 **Enterprise configuration precedence**: The enterprise MCP configuration has the highest precedence and cannot be overridden by user, local, or project configurations.1059 **When using `managed-mcp.json`**: Users cannot add MCP servers through `claude mcp add` or configuration files. The `allowedMcpServers` and `deniedMcpServers` settings still apply to filter which enterprise servers are actually loaded.

1006</Note>1060</Note>

1007 1061 

1008 1062 

overview.md +4 −0

Details

98## Additional resources98## Additional resources

99 99 

100<CardGroup>100<CardGroup>

101 <Card title="About Claude Code" icon="sparkles" href="https://claude.com/product/claude-code">

102 Learn more about Claude Code on claude.com

103 </Card>

104 

101 <Card title="Build with the Agent SDK" icon="code-branch" href="https://docs.claude.com/en/docs/agent-sdk/overview">105 <Card title="Build with the Agent SDK" icon="code-branch" href="https://docs.claude.com/en/docs/agent-sdk/overview">

102 Create custom AI agents with the Claude Agent SDK106 Create custom AI agents with the Claude Agent SDK

103 </Card>107 </Card>

quickstart.md +4 −0

Details

319 <Card title="Claude Code on the web" icon="cloud" href="/en/claude-code-on-the-web">319 <Card title="Claude Code on the web" icon="cloud" href="/en/claude-code-on-the-web">

320 Run tasks asynchronously in the cloud320 Run tasks asynchronously in the cloud

321 </Card>321 </Card>

322 

323 <Card title="About Claude Code" icon="sparkles" href="https://claude.com/product/claude-code">

324 Learn more on claude.com

325 </Card>

322</CardGroup>326</CardGroup>

323 327 

324## Getting help328## Getting help

sdk/migration-guide.md +0 −329 deleted

File Deleted View Diff

1# Migrate to Claude Agent SDK

2 

3Guide for migrating the Claude Code TypeScript and Python SDKs to the Claude Agent SDK

4 

5 

6## Overview

7 

8The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK's broader capabilities for building AI agents beyond just coding tasks.

9 

10## What's Changed

11 

12| Aspect | Old | New |

13| :----------------------- | :-------------------------- | :------------------------------- |

14| **Package Name (TS/JS)** | `@anthropic-ai/claude-code` | `@anthropic-ai/claude-agent-sdk` |

15| **Python Package** | `claude-code-sdk` | `claude-agent-sdk` |

16| **Documentation Location** | Claude Code docs | API Guide → Agent SDK section |

17 

18<Note>

19**Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](/docs/en/agent-sdk/overview) section. The Claude Code docs now focus on the CLI tool and automation features.

20</Note>

21 

22## Migration Steps

23 

24### For TypeScript/JavaScript Projects

25 

26**1. Uninstall the old package:**

27 

28```bash

29npm uninstall @anthropic-ai/claude-code

30```

31 

32**2. Install the new package:**

33 

34```bash

35npm install @anthropic-ai/claude-agent-sdk

36```

37 

38**3. Update your imports:**

39 

40Change all imports from `@anthropic-ai/claude-code` to `@anthropic-ai/claude-agent-sdk`:

41 

42```typescript

43// Before

44import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-code";

45 

46// After

47import {

48 query,

49 tool,

50 createSdkMcpServer,

51} from "@anthropic-ai/claude-agent-sdk";

52```

53 

54**4. Update package.json dependencies:**

55 

56If you have the package listed in your `package.json`, update it:

57 

58```json

59// Before

60{

61 "dependencies": {

62 "@anthropic-ai/claude-code": "^1.0.0"

63 }

64}

65 

66// After

67{

68 "dependencies": {

69 "@anthropic-ai/claude-agent-sdk": "^0.1.0"

70 }

71}

72```

73 

74That's it! No other code changes are required.

75 

76### For Python Projects

77 

78**1. Uninstall the old package:**

79 

80```bash

81pip uninstall claude-code-sdk

82```

83 

84**2. Install the new package:**

85 

86```bash

87pip install claude-agent-sdk

88```

89 

90**3. Update your imports:**

91 

92Change all imports from `claude_code_sdk` to `claude_agent_sdk`:

93 

94```python

95# Before

96from claude_code_sdk import query, ClaudeCodeOptions

97 

98# After

99from claude_agent_sdk import query, ClaudeAgentOptions

100```

101 

102**4. Update type names:**

103 

104Change `ClaudeCodeOptions` to `ClaudeAgentOptions`:

105 

106```python

107# Before

108from claude_agent_sdk import query, ClaudeCodeOptions

109 

110options = ClaudeCodeOptions(

111 model="claude-sonnet-4-5"

112)

113 

114# After

115from claude_agent_sdk import query, ClaudeAgentOptions

116 

117options = ClaudeAgentOptions(

118 model="claude-sonnet-4-5"

119)

120```

121 

122**5. Review [breaking changes](#breaking-changes)**

123 

124Make any code changes needed to complete the migration.

125 

126## Breaking changes

127 

128<Warning>

129To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK. Review this section carefully before migrating.

130</Warning>

131 

132### Python: ClaudeCodeOptions renamed to ClaudeAgentOptions

133 

134**What changed:** The Python SDK type `ClaudeCodeOptions` has been renamed to `ClaudeAgentOptions`.

135 

136**Migration:**

137 

138```python

139# BEFORE (v0.0.x)

140from claude_agent_sdk import query, ClaudeCodeOptions

141 

142options = ClaudeCodeOptions(

143 model="claude-sonnet-4-5",

144 permission_mode="acceptEdits"

145)

146 

147# AFTER (v0.1.0)

148from claude_agent_sdk import query, ClaudeAgentOptions

149 

150options = ClaudeAgentOptions(

151 model="claude-sonnet-4-5",

152 permission_mode="acceptEdits"

153)

154```

155 

156**Why this changed:** The type name now matches the "Claude Agent SDK" branding and provides consistency across the SDK's naming conventions.

157 

158### System prompt no longer default

159 

160**What changed:** The SDK no longer uses Claude Code's system prompt by default.

161 

162**Migration:**

163 

164<CodeGroup>

165 

166```typescript TypeScript

167// BEFORE (v0.0.x) - Used Claude Code's system prompt by default

168const result = query({ prompt: "Hello" });

169 

170// AFTER (v0.1.0) - Uses empty system prompt by default

171// To get the old behavior, explicitly request Claude Code's preset:

172const result = query({

173 prompt: "Hello",

174 options: {

175 systemPrompt: { type: "preset", preset: "claude_code" }

176 }

177});

178 

179// Or use a custom system prompt:

180const result = query({

181 prompt: "Hello",

182 options: {

183 systemPrompt: "You are a helpful coding assistant"

184 }

185});

186```

187 

188```python Python

189# BEFORE (v0.0.x) - Used Claude Code's system prompt by default

190async for message in query(prompt="Hello"):

191 print(message)

192 

193# AFTER (v0.1.0) - Uses empty system prompt by default

194# To get the old behavior, explicitly request Claude Code's preset:

195from claude_agent_sdk import query, ClaudeAgentOptions

196 

197async for message in query(

198 prompt="Hello",

199 options=ClaudeAgentOptions(

200 system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset

201 )

202):

203 print(message)

204 

205# Or use a custom system prompt:

206async for message in query(

207 prompt="Hello",

208 options=ClaudeAgentOptions(

209 system_prompt="You are a helpful coding assistant"

210 )

211):

212 print(message)

213```

214 

215</CodeGroup>

216 

217**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code's CLI-focused instructions.

218 

219### Settings Sources No Longer Loaded by Default

220 

221**What changed:** The SDK no longer reads from filesystem settings (CLAUDE.md, settings.json, slash commands, etc.) by default.

222 

223**Migration:**

224 

225<CodeGroup>

226 

227```typescript TypeScript

228// BEFORE (v0.0.x) - Loaded all settings automatically

229const result = query({ prompt: "Hello" });

230// Would read from:

231// - ~/.claude/settings.json (user)

232// - .claude/settings.json (project)

233// - .claude/settings.local.json (local)

234// - CLAUDE.md files

235// - Custom slash commands

236 

237// AFTER (v0.1.0) - No settings loaded by default

238// To get the old behavior:

239const result = query({

240 prompt: "Hello",

241 options: {

242 settingSources: ["user", "project", "local"]

243 }

244});

245 

246// Or load only specific sources:

247const result = query({

248 prompt: "Hello",

249 options: {

250 settingSources: ["project"] // Only project settings

251 }

252});

253```

254 

255```python Python

256# BEFORE (v0.0.x) - Loaded all settings automatically

257async for message in query(prompt="Hello"):

258 print(message)

259# Would read from:

260# - ~/.claude/settings.json (user)

261# - .claude/settings.json (project)

262# - .claude/settings.local.json (local)

263# - CLAUDE.md files

264# - Custom slash commands

265 

266# AFTER (v0.1.0) - No settings loaded by default

267# To get the old behavior:

268from claude_agent_sdk import query, ClaudeAgentOptions

269 

270async for message in query(

271 prompt="Hello",

272 options=ClaudeAgentOptions(

273 setting_sources=["user", "project", "local"]

274 )

275):

276 print(message)

277 

278# Or load only specific sources:

279async for message in query(

280 prompt="Hello",

281 options=ClaudeAgentOptions(

282 setting_sources=["project"] # Only project settings

283 )

284):

285 print(message)

286```

287 

288</CodeGroup>

289 

290**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:

291- **CI/CD environments** - Consistent behavior without local customizations

292- **Deployed applications** - No dependency on filesystem settings

293- **Testing** - Isolated test environments

294- **Multi-tenant systems** - Prevent settings leakage between users

295 

296<Note>

297**Backward compatibility:** If your application relied on filesystem settings (custom slash commands, CLAUDE.md instructions, etc.), add `settingSources: ['user', 'project', 'local']` to your options.

298</Note>

299 

300## Why the Rename?

301 

302The Claude Code SDK was originally designed for coding tasks, but it has evolved into a powerful framework for building all types of AI agents. The new name "Claude Agent SDK" better reflects its capabilities:

303 

304- Building business agents (legal assistants, finance advisors, customer support)

305- Creating specialized coding agents (SRE bots, security reviewers, code review agents)

306- Developing custom agents for any domain with tool use, MCP integration, and more

307 

308## Getting Help

309 

310If you encounter any issues during migration:

311 

312**For TypeScript/JavaScript:**

313 

3141. Check that all imports are updated to use `@anthropic-ai/claude-agent-sdk`

3152. Verify your package.json has the new package name

3163. Run `npm install` to ensure dependencies are updated

317 

318**For Python:**

319 

3201. Check that all imports are updated to use `claude_agent_sdk`

3212. Verify your requirements.txt or pyproject.toml has the new package name

3223. Run `pip install claude-agent-sdk` to ensure the package is installed

323 

324## Next Steps

325 

326- Explore the [Agent SDK Overview](/docs/en/agent-sdk/overview) to learn about available features

327- Check out the [TypeScript SDK Reference](/docs/en/agent-sdk/typescript) for detailed API documentation

328- Review the [Python SDK Reference](/docs/en/agent-sdk/python) for Python-specific documentation

329- Learn about [Custom Tools](/docs/en/agent-sdk/custom-tools) and [MCP Integration](/docs/en/agent-sdk/mcp)

vs-code.md +27 −28

Details

34 <Step title="Open the Claude Code panel">34 <Step title="Open the Claude Code panel">

35 Throughout VS Code, the Spark icon indicates Claude Code: <img src="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=a734d84e785140016672f08e0abb236c" alt="Spark icon" style={{display: "inline", height: "0.85em", verticalAlign: "middle"}} data-og-width="16" width="16" data-og-height="16" height="16" data-path="images/vs-code-spark-icon.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=280&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=9a45aad9a84b9fa1701ac99a1f9aa4e9 280w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=560&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=3f4cb9254c4d4e93989c4b6bf9292f4b 560w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=840&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=e75ccc9faa3e572db8f291ceb65bb264 840w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=1100&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=f147bd81a381a62539a4ce361fac41c7 1100w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=1650&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=78fe68efaee5d6e844bbacab1b442ed5 1650w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=2500&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=efb8dbe1dfa722d094edc6ad2ad4bedb 2500w" />35 Throughout VS Code, the Spark icon indicates Claude Code: <img src="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=a734d84e785140016672f08e0abb236c" alt="Spark icon" style={{display: "inline", height: "0.85em", verticalAlign: "middle"}} data-og-width="16" width="16" data-og-height="16" height="16" data-path="images/vs-code-spark-icon.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=280&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=9a45aad9a84b9fa1701ac99a1f9aa4e9 280w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=560&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=3f4cb9254c4d4e93989c4b6bf9292f4b 560w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=840&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=e75ccc9faa3e572db8f291ceb65bb264 840w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=1100&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=f147bd81a381a62539a4ce361fac41c7 1100w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=1650&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=78fe68efaee5d6e844bbacab1b442ed5 1650w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-spark-icon.svg?w=2500&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=efb8dbe1dfa722d094edc6ad2ad4bedb 2500w" />

36 36 

37 The quickest way to open Claude is to click this icon in the **Editor Toolbar** (top-right corner of the editor). Note: This icon only appears when you have a file open—opening just a folder isn't enough.37 The quickest way to open Claude is to click the Spark icon in the **Editor Toolbar** (top-right corner of the editor). The icon only appears when you have a file open.

38 38 

39 <img src="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=eb4540325d94664c51776dbbfec4cf02" alt="VS Code editor showing the Spark icon in the Editor Toolbar" data-og-width="2796" width="2796" data-og-height="734" height="734" data-path="images/vs-code-editor-icon.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=280&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=56f218d5464359d6480cfe23f70a923e 280w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=560&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=344a8db024b196c795a80dc85cacb8d1 560w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=840&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=f30bf834ee0625b2a4a635d552d87163 840w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=1100&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=81fdf984840e43a9f08ae42729d1484d 1100w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=1650&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=8b60fb32de54717093d512afaa99785c 1650w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=2500&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=893e6bda8f2e9d42c8a294d394f0b736 2500w" />39 <img src="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=eb4540325d94664c51776dbbfec4cf02" alt="VS Code editor showing the Spark icon in the Editor Toolbar" data-og-width="2796" width="2796" data-og-height="734" height="734" data-path="images/vs-code-editor-icon.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=280&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=56f218d5464359d6480cfe23f70a923e 280w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=560&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=344a8db024b196c795a80dc85cacb8d1 560w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=840&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=f30bf834ee0625b2a4a635d552d87163 840w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=1100&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=81fdf984840e43a9f08ae42729d1484d 1100w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=1650&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=8b60fb32de54717093d512afaa99785c 1650w, https://mintcdn.com/claude-code/mfM-EyoZGnQv8JTc/images/vs-code-editor-icon.png?w=2500&fit=max&auto=format&n=mfM-EyoZGnQv8JTc&q=85&s=893e6bda8f2e9d42c8a294d394f0b736 2500w" />

40 40 

41 Other ways to open Claude Code:41 Other ways to open Claude Code:

42 42 

43 * **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"43 * **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"

44 * **Activity Bar**: Run "Claude Code: Open in Side Bar" from the Command Palette once, and a Spark icon will appear in the left sidebar. This is useful if you want quick access without having a file open.44 * **Status Bar**: Click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open.

45 45 

46 You can drag the Claude panel to reposition it anywhere in VS Code, including to the Activity Bar if the Spark icon isn't showing there. See [Customize your workflow](#customize-your-workflow) for details.46 You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.

47 </Step>47 </Step>

48 48 

49 <Step title="Send a prompt">49 <Step title="Send a prompt">

50 Prompt Claude Code in the same way you would in the terminal.50 Ask Claude to help with your code or files, whether that's explaining how something works, debugging an issue, or making changes.

51 

52 <Tip>Select text in the editor and press `Alt+K` to insert an @-mention with the file path and line numbers directly into your prompt.</Tip>

53 

54 Here's an example of asking about a particular line in a file:

55 

56 <img src="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=ede3ed8d8d5f940e01c5de636d009cfd" alt="VS Code editor with lines 2-3 selected in a Python file, and the Claude Code panel showing a question about those lines with an @-mention reference" data-og-width="3288" width="3288" data-og-height="1876" height="1876" data-path="images/vs-code-send-prompt.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=280&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=f40bde7b2c245fe8f0f5b784e8106492 280w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=560&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=fad66a27a9a6faa23b05370aa4f398b2 560w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=840&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=4539c8a3823ca80a5c8771f6c088ce9e 840w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=1100&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=fae8ebf300c7853409a562ffa46d9c71 1100w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=1650&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=22e4462bb8cf0c0ca20f8102bc4c971a 1650w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-send-prompt.png?w=2500&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=739bfd045f70fe7be1a109a53494590e 2500w" />

51 </Step>57 </Step>

52 58 

53 <Step title="Review changes">59 <Step title="Review changes">

54 Watch as Claude analyzes your code and suggests changes. Review and accept edits directly in the interface.60 When Claude wants to edit a file, it shows you a diff and asks for permission. You can accept, reject, or tell Claude what to do instead.

61 

62 <img src="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=e005f9b41c541c5c7c59c082f7c4841c" alt="VS Code showing a diff of Claude's proposed changes with a permission prompt asking whether to make the edit" data-og-width="3292" width="3292" data-og-height="1876" height="1876" data-path="images/vs-code-edits.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=280&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=cb5d41b81087f79b842a56b5a3304660 280w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=560&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=90bb691960decdc06393c3c21cd62c75 560w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=840&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=9a11bf878ba619e850380904ff4f38e8 840w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1100&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=6dddbf596b4f69ec6245bdc5eb6dd487 1100w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1650&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=ef2713b8cbfd2cee97af817d813d64c7 1650w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=2500&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=1f7e1c52919cdfddf295f32a2ec7ae59 2500w" />

55 </Step>63 </Step>

56</Steps>64</Steps>

57 65 

66For more ideas on what you can do with Claude Code, see [Common workflows](/en/common-workflows).

67 

58## Customize your workflow68## Customize your workflow

59 69 

60Once you're up and running, you can reposition the Claude panel or switch to terminal mode.70Once you're up and running, you can reposition the Claude panel or switch to terminal mode.


63 73 

64You can drag the Claude panel to reposition it anywhere in VS Code. Grab the panel's tab or title bar and drag it to:74You can drag the Claude panel to reposition it anywhere in VS Code. Grab the panel's tab or title bar and drag it to:

65 75 

66* **Activity Bar**: The left sidebar with icons for Explorer, Search, etc.76* **Secondary sidebar** (default): The right side of the window

67* **Secondary sidebar**: The right side of the window77* **Primary sidebar**: The left sidebar with icons for Explorer, Search, etc.

68* **Editor area**: Opens Claude as a tab alongside your files78* **Editor area**: Opens Claude as a tab alongside your files

69 79 

70This lets you position Claude wherever works best for your workflow.80<Note>

81 The Spark icon only appears in the Activity Bar (left sidebar icons) when the Claude panel is docked to the left. Since Claude defaults to the right side, use the Editor Toolbar icon to open Claude.

82</Note>

71 83 

72### Switch to terminal mode84### Switch to terminal mode

73 85 


75 87 

76You can also open VS Code settings (`Cmd+,` on Mac or `Ctrl+,` on Windows/Linux), go to Extensions → Claude Code, and check **Use Terminal**.88You can also open VS Code settings (`Cmd+,` on Mac or `Ctrl+,` on Windows/Linux), go to Extensions → Claude Code, and check **Use Terminal**.

77 89 

78<Note>

79 In terminal mode, the Activity Bar icon (left vertical menu) won't persist between sessions. If you want the Spark icon to always appear in the Activity Bar, keep this setting disabled and use the Editor Toolbar icon (top-right of editor) to access terminal mode instead.

80</Note>

81 

82## VS Code commands and shortcuts90## VS Code commands and shortcuts

83 91 

84Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension:92Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension:


188 196 

189### Spark icon not visible197### Spark icon not visible

190 198 

191There are two places the Spark icon can appear:199The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:

192 

193* **Editor Toolbar** (top-right of editor): Only visible when a file is open

194* **Activity Bar** (left sidebar): Only visible after running "Claude Code: Open in Side Bar" from the Command Palette

195 

196If you don't see the icon:

197 

1981. **Open a file**: The Editor Toolbar icon requires a file to be open—having just a folder open isn't enough

1992. **Enable the Activity Bar icon**: Run "Claude Code: Open in Side Bar" from the Command Palette once, and the icon will appear in the Activity Bar permanently

2003. **Check VS Code version**: Requires 1.98.0 or higher (Help → About)

2014. **Restart VS Code**: Run "Developer: Reload Window" from the command palette

2025. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)

2036. **Check workspace trust**: The extension doesn't work in Restricted Mode

2047. **Use the Command Palette**: Open with `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), then type "Claude Code: Open in Side Bar"

205 200 

206### Spark icon doesn't stay in the Activity Bar2011. **Open a file**: The icon requires a file to be open—having just a folder open isn't enough

2022. **Check VS Code version**: Requires 1.98.0 or higher (Help → About)

2033. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette

2044. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)

2055. **Check workspace trust**: The extension doesn't work in Restricted Mode

207 206 

208If the Spark icon appears in the Activity Bar when you open the sidebar but doesn't persist after you close VS Code, check that the [Use Terminal setting](vscode://settings/claudeCode.useTerminal) is disabled. When terminal mode is enabled, the Activity Bar icon won't persist between sessions.207Alternatively, click "✱ Claude Code" in the **Status Bar** (bottom-right corner)—this works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".

209 208 

210### Claude Code never responds209### Claude Code never responds

211 210