Install and configure the Claude Code extension for VS Code. Get AI coding assistance with inline diffs, @-mentions, plan review, and keyboard shortcuts. 通过安装并配置 VS Code 的 Claude Code 扩展。使用内联差异、@引用、计划审查和键盘快捷键获取 AI 编码辅助。
The VS Code extension provides a native graphical interface for Claude Code, integrated directly into your IDE. This is the recommended way to use Claude Code in VS Code. VS Code 扩展为 Claude Code 提供了原生的图形界面,直接集成到您的 IDE 中。这是在 VS Code 中使用 Claude Code 的推荐方式。
With the extension, you can review and edit Claude’s plans before accepting them, auto-accept edits as they’re made, @-mention files with specific line ranges from your selection, access conversation history, and open multiple conversations in separate tabs or windows. 使用该扩展,你可以在接受更改之前审查和编辑 Claude 的修改计划,自动接受claude code所做的编辑,通过 @ 引用一定范围内的行,访问对话历史记录,并在单独的选项卡或窗口中打开多个对话。
一,Prerequisites 前提条件 VS Code 1.98.0 or higher VS Code 1.98.0 或更高版本
An Anthropic account (you’ll sign in when you first open the extension). If you’re using a third-party provider like Amazon Bedrock or Google Vertex AI, see Use third-party providers instead. 一个 Anthropic 账户(你将在首次打开扩展时登录)。如果你使用的是 Amazon Bedrock 或 Google Vertex AI 等第三方提供者,请参考下面第10节 Use third-party providers
The extension includes the CLI (command-line interface), which you can access from VS Code’s integrated terminal for advanced features. 该扩展包含 CLI(命令行界面),你可以通过 VS Code 的集成终端使用更多高级功能。
二,Install the extension 安装扩展 Click the link for your IDE to install directly: 点击以下链接直接为您的 IDE 安装:
Install for VS Code 为 VS Code 安装 vscode:extension/anthropic.claude-code
Install for Cursor
为 Cursor 安装
cursor:extension/anthropic.claude-code
Or in VS Code, press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux) to open the Extensions view, search for “Claude Code”, and click Install. 或者,在 VS Code 中按 Cmd+Shift+X (Mac)或 Ctrl+Shift+X (Windows/Linux)打开扩展视图,搜索“Claude Code”,然后点击安装。
If the extension doesn’t appear after installation, restart VS Code or run “Developer: Reload Window” from the Command Palette. 如果安装后扩展没有出现,请重启 VS Code 或从命令面板运行“Developer: Reload Window”。
三,Get started 开始使用 Once installed, you can start using Claude Code through the VS Code interface: 安装后,您可以通过 VS Code 界面使用 Claude Code:
3.1 Open the Claude Code panel 打开 Claude Code 面板
Throughout VS Code, the Spark icon indicates Claude Code: 在 VS Code 中,Spark 图标表示 Claude Code:
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. 打开 Claude 最快的方法是点击编辑器工具栏(编辑器右上角)中的 Spark 图标。只有当你打开文件时,图标才会出现。
Other ways to open Claude Code: 打开 Claude Code 的其他方法:
Command Palette: Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux), type “Claude Code”, and select an option like “Open in New Tab” 命令面板: Cmd+Shift+P (Mac)或 Ctrl+Shift+P (Windows/Linux),输入“Claude Code”,然后选择一个选项,例如“在新标签页中打开”
Status Bar: Click ✱ Claude Code in the bottom-right corner of the window. This works even when no file is open. 状态栏:点击窗口右下角的✱ Claude Code。即使没有打开文件,这个功能也能使用。
You can drag the Claude panel to reposition it anywhere in VS Code. 你可以拖动 Claude 面板将其放置到 VS Code 中的任何位置。 3.2 Send a prompt 发送提示 Ask Claude to help with your code or files, whether that’s explaining how something works, debugging an issue, or making changes. 请让 Claude 帮助您处理代码或文件,无论是解释某个功能的工作原理、调试问题还是进行修改。
Claude automatically sees your selected text. Press Option+K (Mac) / Alt+K (Windows/Linux) to also insert an @-mention reference (like @file.ts#5-10) into your prompt. Claude 会自动识别您选中的文本。按 Option+K (Mac)/ Alt+K (Windows/Linux)将插入一个@引用(如 @file.ts#5-10 )到您的提示中。
Here’s an example of asking about a particular line in a file: 这里有一个关于文件中特定行的示例请求: @utils.py#2-3 What does this line do? 这几行代码是做什么的?
3.3 Review changes 审查更改 When Claude wants to edit a file, it shows a side-by-side comparison of the original and proposed changes, then asks for permission. You can accept, reject, or tell Claude what to do instead. 当 Claude 需要编辑文件时,它会显示原始文件和提议修改的并排比较,然后请求权限。你可以接受、拒绝或告诉 Claude 做其他事情。
The extension includes two built-in tutorials: 扩展包含两个内置教程:
VS Code walkthrough: Run “Claude Code: Open Walkthrough” from the Command Palette for a guided tour of the basics. VS Code 演示:从命令面板运行“Claude Code: Open 演示”以获取基础知识引导式游览。
Interactive checklist: Click the graduation cap icon in the Claude panel header to work through features like writing code, using Plan mode, and setting up rules. 交互式清单:点击 Claude 面板标题中的毕业帽图标,以完成编写代码、使用计划模式和设置规则等功能的操作。
四,Use the prompt box 使用提示框 The prompt box supports several features: 提示框支持多种功能:
Permission modes: Click the mode indicator at the bottom of the prompt box to switch modes. In normal mode, Claude asks permission before each action. In Plan mode, Claude describes what it will do and waits for approval before making changes. In auto-accept mode, Claude makes edits without asking. Set the default in VS Code settings under claudeCode.initialPermissionMode. 权限模式:点击提示框底部的模式指示器来切换模式。在普通模式下,Claude 在每个操作前都会请求权限。 在计划模式下,Claude 会描述它将要做什么,并在进行更改前等待批准。 在自动接受模式下,Claude 会直接进行编辑而不询问。在 VS Code 设置中的 claudeCode.initialPermissionMode 下设置默认值。
Command menu: Click / or type / to open the command menu. Options include attaching files, switching models, toggling extended thinking, and viewing account usage. The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal. 命令菜单:点击 / 或输入 / 打开命令菜单。选项包括附加文件、切换模型、切换扩展思考以及查看账户使用情况。 自定义部分提供对 MCP 服务器、钩子、内存、权限和插件的访问。带有终端图标的项会在集成终端中打开。
Context indicator: The prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run /compact manually. 上下文指示器:提示框显示您正在使用多少 Claude 的上下文窗口。Claude 会根据需要自动压缩,或者您可以手动运行 /compact
Extended thinking: Lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (/). 扩展思考:让 Claude 花费更多时间对复杂问题进行推理。通过命令菜单( / )开启它。有关详细信息,
Multi-line input: Press Shift+Enter to add a new line without sending. 多行输入:按 Shift+Enter 添加新行而不发送。 4.1 Reference files and folders 参考文件和文件夹
Use @-mentions to give Claude context about specific files or folders. When you type @ followed by a file or folder name, Claude reads that content and can answer questions about it or make changes to it. Claude Code supports fuzzy matching, so you can type partial names to find what you need: 使用@来为 Claude 提供关于特定文件或文件夹的上下文。当你输入 @ 后跟文件或文件夹名称时,Claude 会读取该内容,并可以回答有关它的问题或对其进行修改。 Claude Code 支持模糊匹配,因此你可以输入部分名称来查找所需内容:
Explain the logic in @auth (fuzzy matches auth.js, AuthService.ts, etc.) What's in @src/components/ (include a trailing slash for folders) 包括文件夹的尾斜杠
When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press Option+K (Mac) / Alt+K (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., @app.ts#5-10). Click the selection indicator to toggle whether Claude can see your highlighted text - the eye-slash icon means the selection is hidden from Claude. 当你在编辑器中选中文本时,Claude 可以自动看到你高亮的代码。提示框的底部会显示选中的行数。 按 Option+K (Mac)/ Alt+K (Windows/Linux)插入带有文件路径和行号的@引用(例如, @app.ts#5-10 )。 点击选择指示器进行切换 Claude 是否能看到你高亮的文本——斜杠眼睛图标表示该选择对 Claude 隐藏。
You can also hold Shift while dragging files into the prompt box to add them as attachments. Click the X on any attachment to remove it from context. 你也可以在将文件拖入提示框时按住 Shift ,以将它们作为附件添加。点击任何附件上的 X 将其从上下文中移除。 4.2 Resume past conversations 恢复过去的对话
Click the dropdown at the top of the Claude Code panel to access your conversation history. You can search by keyword or browse by time (Today, Yesterday, Last 7 days, etc.). Click any conversation to resume it with the full message history. 点击 Claude Code 面板顶部的下拉菜单来访问你的对话历史。你可以通过关键词搜索或按时间浏览(今天、昨天、过去 7 天等)。 点击任何对话以使用完整的消息历史记录来恢复它。
五,Customize your workflow 自定义你的工作流程 Once you’re up and running, you can reposition the Claude panel, run multiple sessions, or switch to terminal mode. 一旦你开始使用,你可以重新定位 Claude 面板、运行多个会话或切换到终端模式。 5.1 Choose where Claude lives 选择 Claude 的存放位置
You can drag the Claude panel to reposition it anywhere in VS Code. Grab the panel’s tab or title bar and drag it to: 你可以将 Claude 面板拖动到 VS Code 中的任何位置。抓住面板的标签或标题栏并拖动到:
Secondary sidebar: The right side of the window. Keeps Claude visible while you code. 次要侧边栏:窗口的右侧。在编程时保持 Claude 可见。
Primary sidebar: The left sidebar with icons for Explorer, Search, etc. 主侧边栏:带有 Explorer、Search 等图标的左侧侧边栏。
Editor area: Opens Claude as a tab alongside your files. Useful for side tasks. 编辑区域:将 Claude 作为文件旁边的选项卡打开。适用于辅助任务。
Use the sidebar for your main Claude session and open additional tabs for side tasks. Claude remembers your preferred location. Note that the Spark icon only appears in the Activity Bar when the Claude panel is docked to the left. Since Claude defaults to the right side, use the Editor Toolbar icon to open Claude. 使用侧边栏进行主要的 Claude 会话,并为侧任务打开额外的标签页。Claude 会记住您偏好的位置。 请注意,Spark 图标仅在 Claude 面板停靠在左侧时出现在活动栏中。由于 Claude 默认在右侧,请使用编辑器工具栏图标来打开 Claude。
5.2 Run multiple conversations 运行多个对话
Use Open in New Tab or Open in New Window from the Command Palette to start additional conversations. Each conversation maintains its own history and context, allowing you to work on different tasks in parallel. 使用命令面板中的"在新标签页中打开"或"在新窗口中打开"来开始额外的对话。每个对话都保持其自己的历史和上下文,允许你并行处理不同的任务。
When using tabs, a small colored dot on the spark icon indicates status: blue means a permission request is pending, orange means Claude finished while the tab was hidden. 使用标签页时,火花图标上的小彩色点指示状态:蓝色表示权限请求正在等待,橙色表示 Claude 在标签页隐藏时完成了操作。
5.3 Switch to terminal mode 切换到终端模式
By default, the extension opens a graphical chat panel. If you prefer the CLI-style interface, open the Use Terminal setting and check the box. 默认情况下,扩展会打开一个图形聊天面板。如果你更喜欢 CLI 风格的界面,打开"使用终端"设置并勾选相应的框。 vscode://settings/claudeCode.useTerminal
You can also open VS Code settings (Cmd+, on Mac or Ctrl+, on Windows/Linux), go to Extensions → Claude Code, and check Use Terminal. 你也可以打开 VS Code 设置(Mac 上为 Cmd+, ,Windows/Linux 上为 Ctrl+, ),进入 扩展 → Claude Code,并勾选 使用终端。
六,VS Code commands and shortcuts VS Code 命令和快捷键
Open 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. 打开命令面板(Mac 上为 Cmd+Shift+P ,Windows/Linux 上为 Ctrl+Shift+P ),输入“Claude Code”即可查看 Claude Code 扩展的所有可用 VS Code 命令。
Some shortcuts depend on which panel is “focused” (receiving keyboard input). When your cursor is in a code file, the editor is focused. When your cursor is in Claude’s prompt box, Claude is focused. Use Cmd+Esc / Ctrl+Esc to toggle between them. 某些快捷键取决于哪个面板处于“聚焦”状态(接收键盘输入)。当光标位于代码文件中时,编辑器处于聚焦状态。当光标位于 Claude 的提示框中时,Claude 处于聚焦状态。 使用 Cmd+Esc / Ctrl+Esc 在它们之间切换。
These are VS Code commands for controlling the extension. Not all built-in Claude Code commands are available in the extension. 这些是用于控制扩展的 VS Code 命令。扩展中并非所有内置的 Claude Code 命令都可用。
一般有如下这个命令 Focus Input 聚焦输入: Toggle focus between editor and Claude 在编辑器和 Claude 之间切换聚焦
Open in Side Bar 在侧边栏中打开 Open Claude in the left sidebar 在左侧边栏中打开 Claude
Open in Terminal 在终端中打开 Open Claude in terminal mode 以终端模式打开 Claude
Open in New Tab 在新标签页中打开 Open a new conversation as an editor tab 以编辑器标签页形式开启新对话
Open in New Window 在新窗口中打开 Open a new conversation in a separate window 在一个新窗口中开启对话
New Conversation 新对话 Start a new conversation (requires Claude to be focused) 开启新对话(需要将 Claude 置于焦点)
Insert @-Mention Reference 插入@引用 Insert a reference to the current file and selection (requires editor to be focused) 插入当前文件和选择的引用(需要编辑器处于焦点状态)
Show Logs 显示日志
Logout 退出登录
七,Configure settings 配置设置 The extension has two types of settings: 该扩展有两个类型的设置:
Extension settings in VS Code: Control the extension’s behavior within VS Code. Open with Cmd+, (Mac) or Ctrl+, (Windows/Linux), then go to Extensions → Claude Code. You can also type / and select General Config to open settings. VS Code 中的扩展设置:控制扩展在 VS Code 中的行为。使用 Cmd+, (Mac)或 Ctrl+, (Windows/Linux)打开,然后转到扩展 → Claude Code。 您也可以输入 / 并选择通用配置来打开设置。
Claude Code settings in ~/.claude/settings.json: Shared between the extension and CLI. Use for allowed commands, environment variables, hooks, and MCP servers. ~/.claude/settings.json 中的 Claude Code 设置:在扩展和 CLI 之间共享。用于允许的命令、环境变量、钩子和 MCP 服务器。
7.1 Extension settings 扩展设置 有如下13项 1,selectedModel Model for new conversations. Change per-session with /model. 新会话的模型。通过 /model 每次会话更改。
2,useTerminal Launch Claude in terminal mode instead of graphical panel 在终端模式下启动 Claude,而不是图形面板
3,initialPermissionMode Controls approval prompts: default (ask each time), plan, acceptEdits, or bypassPermissions 控制批准提示: default (每次询问), plan , acceptEdits ,或 bypassPermissions
4,preferredLocation Where Claude opens: sidebar (right) or panel (new tab) Claude 打开的位置: sidebar (右侧)或 panel (新标签页)
5,autosave Auto-save files before Claude reads or writes them 在 Claude 读取或写入文件之前自动保存文件
6,useCtrlEnterToSend Use Ctrl/Cmd+Enter instead of Enter to send prompts 使用 Ctrl/Cmd+Enter 而不是 Enter 发送提示
7,enableNewConversationShortcut Enable Cmd/Ctrl+N to start a new conversation 启用 Cmd/Ctrl+N 开始新的对话
8,hideOnboarding Hide the onboarding checklist (graduation cap icon) 隐藏引导清单(毕业帽图标)
9,respectGitIgnore Exclude .gitignore patterns from file searches 从文件搜索中排除 .gitignore 模式
10,environmentVariables Set environment variables for the Claude process. Use Claude Code settings instead for shared config. 为 Claude 进程设置环境变量。对于共享配置,请使用 Claude Code 设置。
11,disableLoginPrompt Skip authentication prompts (for third-party provider setups) 跳过认证提示(适用于第三方提供者设置)
12,allowDangerouslySkipPermissions Bypass all permission prompts. Use with extreme caution. 绕过所有权限提示。请极其谨慎地使用。
13,claudeProcessWrapper Executable path used to launch the Claude process 启动 Claude 进程的可执行路径
八,VS Code extension vs. Claude Code CLI VS Code 扩展与 Claude Code CLI
Claude Code is available as both a VS Code extension (graphical panel) and a CLI (command-line interface in the terminal). Some features are only available in the CLI. If you need a CLI-only feature, run claude in VS Code’s integrated terminal. Claude Code 既可使用 VS Code 扩展(图形面板),也可使用 CLI(终端中的命令行界面)。某些功能仅在 CLI 中可用。如果你需要仅 CLI 中的功能,请在 VS Code 的集成终端中运行 claude 。
2者有如下区别 Commands and skills 命令和技能: Subset (type / to see available) 扩展只是一个子集(输入 / 查看可用选项)
MCP server config MCP 服务器配置 No (configure via CLI, use in extension) 扩展不支持配置(通过 CLI 配置,在扩展中使用)
Checkpoints 检查点 扩展目前还没有
! bash shortcut
! bash 快捷键
暂时不支持
Tab completion Tab 补全 扩展也没有
8.1 Run CLI in VS Code 在 VS Code 中运行 CLI
To use the CLI while staying in VS Code, open the integrated terminal (Ctrl+ on Windows/Linux or Cmd+ on Mac) and run claude. The CLI automatically integrates with your IDE for features like diff viewing and diagnostic sharing.
要在 VS Code 中使用 CLI,请打开集成终端(Windows/Linux 上的 Ctrl+ 或 Mac 上的 Cmd+ ),然后运行 claude 。CLI 会自动与您的 IDE 集成,以支持差异查看和诊断共享等功能。
If using an external terminal, run /ide inside Claude Code to connect it to VS Code. 如果使用外部终端,在 Claude Code 中运行 /ide 将其连接到 VS Code。
8.2 Switch between extension and CLI 在扩展和 CLI 之间切换
The extension and CLI share the same conversation history. To continue an extension conversation in the CLI, run claude --resume in the terminal. This opens an interactive picker where you can search for and select your conversation. 扩展和 CLI 共享相同的对话历史。要在 CLI 中继续扩展对话,请在终端中运行 claude --resume 。这将打开一个交互式选择器,您可以在其中搜索并选择您的对话。
8.3 Include terminal output in prompts 在提示中包含终端输出
Reference terminal output in your prompts using @terminal:name where name is the terminal’s title. This lets Claude see command output, error messages, or logs without copy-pasting. 使用 @terminal:name 引用终端内容到你的提示中,其中 name 是终端的标题。这能让 Claude 查看命令输出、错误消息或日志,而无需复制粘贴。
8.4 Monitor background processes 监控后台进程
When Claude runs long-running commands, the extension shows progress in the status bar. However, visibility for background tasks is limited compared to the CLI. For better visibility, have Claude output the command so you can run it in VS Code’s integrated terminal. 当 Claude 运行长时间的命令时,扩展会在状态栏中显示进度。然而,与 CLI 相比,后台任务的可见性有限。为了更好的可见性,让 Claude 输出命令,这样你就可以在 VS Code 的集成终端中运行它。
8.5 Connect to external tools with MCP 使用 MCP 连接外部工具
MCP (Model Context Protocol) servers give Claude access to external tools, databases, and APIs. Configure them via CLI, then use them in both extension and CLI. MCP(模型上下文协议)服务器为 Claude 提供对外部工具、数据库和 API 的访问。通过 CLI 进行配置,然后在扩展和 CLI 中均可使用。
To add an MCP server, open the integrated terminal (Ctrl+ or Cmd+) and run:
要添加一个 MCP 服务器,打开集成终端( Ctrl+ 或 Cmd+ )并运行:
claude mcp add --transport http github api.githubcopilot.com/mcp/
Once configured, ask Claude to use the tools (e.g., “Review PR #456”). Some servers require authentication: run claude in the terminal, then type /mcp to authenticate. 配置完成后,请让 Claude 使用工具(例如,“审查 PR #456”)。某些服务器需要认证:在终端中运行 claude ,然后输入 /mcp 进行认证。
九,Work with git 使用 git Claude Code integrates with git to help with version control workflows directly in VS Code. Ask Claude to commit changes, create pull requests, or work across branches. Claude Code 与 git 集成,以帮助您直接在 VS Code 中处理版本控制工作流程。让 Claude 提交更改、创建拉取请求或在分支间工作。
9.1 Create commits and pull requests 创建提交和拉取请求
Claude can stage changes, write commit messages, and create pull requests based on your work: Claude 可以根据你的工作来暂存更改、编写提交信息并创建PR请求:
commit my changes with a descriptive message 用描述性消息提交我的更改 create a pr for this feature 为这个特性创建一个pr summarize the changes I've made to the auth module 总结我对auth模块所做的更改
When creating pull requests, Claude generates descriptions based on the actual code changes and can add context about testing or implementation decisions. 在创建PR请求时,Claude 会根据实际的代码更改生成描述,并可以添加关于测试或实现决策的背景信息。 9.2 Use git worktrees for parallel tasks 使用 git worktrees 进行并行任务
Git worktrees allow multiple Claude Code sessions to work on separate branches simultaneously, each with isolated files: Git 工作树允许多个 Claude Code 会话同时处理不同的分支,每个会话都有隔离的文件:
Create a worktree for a new feature
git worktree add ../project-feature-a -b feature-a
Run Claude Code in each worktree
cd ../project-feature-a && claude
Each worktree maintains independent file state while sharing git history. This prevents Claude instances from interfering with each other when working on different tasks. 每个工作树维护独立的文件状态,同时共享 git 历史。这防止了 Claude 实例在处理不同任务时相互干扰。
十,Use third-party providers 使用第三方提供者
By default, Claude Code connects directly to Anthropic’s API. If your organization uses Amazon Bedrock, Google Vertex AI, or Microsoft Foundry to access Claude, configure the extension to use your provider instead: 默认情况下,Claude Code 直接连接到 Anthropic 的 API。如果您的组织使用 Amazon Bedrock、Google Vertex AI 或 Microsoft Foundry 来访问 Claude,请配置扩展以使用您的提供者:
1,Disable login prompt 禁用登录提示
Open the Disable Login Prompt setting and check the box. 打开禁用登录提示设置并勾选该框。 vscode://settings/claudeCode.disableLoginPrompt
You can also open VS Code settings (Cmd+, on Mac or Ctrl+, on Windows/Linux), search for “Claude Code login”, and check Disable Login Prompt. 您也可以打开 VS Code 设置(Mac 上为 Cmd+, ,Windows/Linux 上为 Ctrl+, ),搜索“Claude Code 登录”,并检查禁用登录提示。
2,Configure your provider 配置您的提供者
Follow the setup guide for your provider: 遵循您的提供者的设置指南:
Claude Code on Amazon Bedrock code.claude.com/docs/en/ama…
Claude Code on Google Vertex AI code.claude.com/docs/en/goo…
Claude Code on Microsoft Foundry code.claude.com/docs/en/mic…
These guides cover configuring your provider in ~/.claude/settings.json, which ensures your settings are shared between the VS Code extension and the CLI. 这些指南涵盖了在 ~/.claude/settings.json 中配置您的提供者,这确保了您的设置在 VS Code 扩展和 CLI 之间共享。 十一,Security and privacy 安全和隐私
With auto-edit permissions enabled, Claude Code can modify VS Code configuration files (like settings.json or tasks.json) that VS Code may execute automatically. To reduce risk when working with untrusted code: 启用自动编辑权限后,Claude Code 可以修改 VS Code 配置文件(如 settings.json 或 tasks.json ),这些文件可能会被 VS Code 自动执行。在处理不受信任的代码时,为降低风险:
Enable VS Code Restricted Mode for untrusted workspaces 为不受信任的工作区启用 VS Code 限制模式
Use manual approval mode instead of auto-accept for edits 使用手动审批模式而不是自动接受编辑
Review changes carefully before accepting them 仔细审查更改后再接受它们
十二,Fix common issues 常见问题修复 12.1 Extension won’t install 扩展无法安装
Ensure you have a compatible version of VS Code (1.98.0 or later) 确保你使用的是兼容的 VS Code 版本(1.98.0 或更高版本)
Check that VS Code has permission to install extensions 检查 VS Code 是否有权限安装扩展
Try installing directly from the VS Code Marketplace 直接从 VS Code 市场安装 marketplace.visualstudio.com/items?itemN… 12.2 Spark icon not visible 火花图标不可见 The Spark icon appears in the Editor Toolbar (top-right of editor) when you have a file open. If you don’t see it: 当打开文件时,Spark 图标会出现在编辑器工具栏(编辑器右上角)。如果你看不到它:
Open a file: The icon requires a file to be open. Having just a folder open isn’t enough. 打开一个文件:该图标需要打开一个文件。仅仅打开一个文件夹是不够的。
Check VS Code version: Requires 1.98.0 or higher (Help → About) 检查 VS Code 版本:需要 1.98.0 或更高版本(帮助 → 关于)
Restart VS Code: Run “Developer: Reload Window” from the Command Palette 重启 VS Code:从命令面板运行“开发者:重新加载窗口”
Disable conflicting extensions: Temporarily disable other AI extensions (Cline, Continue, etc.) 禁用冲突扩展:暂时禁用其他 AI 扩展(Cline、Continue 等)
Check workspace trust: The extension doesn’t work in Restricted Mode 检查工作区信任:该扩展在受限模式下无法工作
Alternatively, 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”. 或者,在状态栏(右下角)点击“✱ Claude Code”。即使没有打开文件也能使用。你也可以使用命令面板( Cmd+Shift+P / Ctrl+Shift+P )并输入“Claude Code”。 12.3 Claude Code never responds Claude Code 从不响应
If Claude Code isn’t responding to your prompts: 如果 Claude Code 没有响应你的提示:
Check your internet connection: Ensure you have a stable internet connection 检查你的网络连接:确保你有一个稳定的网络连接
Start a new conversation: Try starting a fresh conversation to see if the issue persists 开始一个新的对话:尝试开始一个全新的对话,看看问题是否仍然存在
Try the CLI: Run claude from the terminal to see if you get more detailed error messages 尝试使用 CLI:从终端运行 claude ,看看你是否能获得更详细的错误消息