8.1 — Claude Code in VS Code: install the extension and review diffs
The Claude Code extension adds a conversation panel to VS Code. You talk to Claude next to your code. Its edits show up in the editor's diff view.
You need VS Code 1.94 or later. You also need a paid Claude subscription (Pro, Max, Ultra, Team or Enterprise) or a Console account.
Installation takes four steps:
1. Open the Extensions view with Cmd+Shift+X (Ctrl+Shift+X on Windows and Linux).
2. Search for "Claude Code", published by Anthropic, then click Install.
3. Open a file, then click the Spark icon in the top-right corner of the editor.
4. Click Sign in and finish signing in from your browser.
The extension installs the same way in Cursor. Other VS Code forks find it in the Open VSX registry.
For a first request, select a function in your file. Claude sees your selection without you copying it. Then type your request in the panel:
Explain what this function does, then suggest a test for each edge case.
Two shortcuts come up every day. On Windows and Linux, replace Cmd with Ctrl and Option with Alt.
| Shortcut | Effect |
|---|---|
Cmd+Esc |
Moves the cursor from the editor to the Claude panel, and back. |
Option+K |
Inserts a reference to the file and the selected lines into your request, such as @app.ts#5-10. |
The indicator below the prompt box shows the permission mode. Click it to switch.
| Mode | What Claude does |
|---|---|
| Auto | It edits files without asking. A classifier reviews its actions for you. |
| Edit automatically | It edits files without asking. It still asks for most shell commands. |
| Manual | It shows each edit as a diff and waits for your approval. |
| Plan | It describes what it intends to do and waits for your approval before editing a file. |
Since version 2.1.283, a new conversation starts in Auto mode. After that, the extension reuses the last mode you picked. Switch to Manual when you're new to a project or the code is sensitive. Claude then opens a side-by-side diff, with the original on the left and its proposal on the right. You accept, you reject, or you tell it what to do instead. Under each change, the Accept this change and Reject this change buttons let you sort through a diff piece by piece.
In Plan mode, VS Code opens the plan as a Markdown document. You can comment on lines before Claude starts.
To start every conversation in Manual, add this setting to your VS Code user settings:
{
"claudeCode.initialPermissionMode": "manual"
}
VS Code ignores this setting when it sits in workspace settings.
Key takeaways
• The extension installs from the VS Code Extensions view, and in Cursor too.
• Claude sees your selection, and Option+K (Alt+K) adds it to your request with its line numbers.
• By default, a conversation starts in Auto mode, and the indicator below the prompt box lets you switch.
• In Manual mode, you approve each edit in a side-by-side diff.
• The claudeCode.initialPermissionMode setting fixes the mode your conversations start in.
