ClaudeFolio

Claude Code in VS Code and Cursor: setup and the features worth using

Installing the Claude Code extension in VS Code or Cursor, the PATH gotcha that confuses almost everyone, reviewing changes as diffs, rewinding, permission modes, and when to switch to the terminal.

·3 min read
Claude Code in VS Code and Cursor: setup and the features worth using

The Claude Code extension puts the agent in a panel inside VS Code, with its changes shown as diffs in the files you already have open. Anthropic calls it "the recommended way to use Claude Code in VS Code," and it installs in Cursor and other VS Code forks too. This guide covers installing it, the features worth using from day one, and the one gotcha that confuses almost everyone. The full reference is Anthropic's VS Code documentation.

Install and sign in

You need VS Code 1.94 or later and a paid Claude subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console account. No API key is required. Install Claude Code from the Extensions view. In Cursor there's a direct install link in the docs, and other forks can install it from the Open VSX registry. Open the Claude Code panel and sign in with your account the first time.

If your editor can't install the extension at all, install the CLI and run claude in the editor's built-in terminal instead. The CLI works in any terminal.

The gotcha: the extension doesn't put claude on your PATH

The extension ships its own private copy of Claude Code for its panel. In the docs' words, "the extension does not add claude to your PATH." So the panel works, but typing claude in a terminal fails with "not recognized" or "command not found." That isn't a broken install. Run the standalone installer once and claude works in every terminal, including VS Code's own. If it's still missing after that, the PATH fix in our Windows guide or our Linux guide applies.

Review changes as diffs

This is the main reason to use the extension. When Claude edits a file, you see the change as a diff in the editor and can accept or reject it. You can also step through a proposed edit one change at a time with Accept Change at Cursor and Reject Change at Cursor, from the editor's right-click menu or the Command Palette.

The docs list the rest of what the panel adds: 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." Selecting some lines and @-mentioning them is the fastest way to point Claude at exactly the code you mean.

Rewind when a change goes wrong

Hover over any message to get the rewind button. The docs describe three options: Fork conversation from here, which branches the conversation and keeps your code; Rewind code to here, which reverts file changes and keeps the conversation; and Fork conversation and rewind code, which does both. Checkpoints only track Claude's own file edits, so commit before big changes and keep git as your real safety net.

Permission modes and sessions

The mode indicator in the panel switches between Manual, accept edits, plan, and auto, the same modes as the CLI. If you want new conversations to start in a particular mode, the claudeCode.initialPermissionMode setting does that, though it doesn't accept auto; to start in auto, leave it unset and pick Auto from the indicator once.

The Session history button lists past conversations, and you can search them and resume any one with its full history. The extension and the CLI "share the same conversation history," so a conversation from the panel can be picked up in a terminal with claude --resume. Settings in ~/.claude/settings.json, such as allowed commands, hooks, and MCP servers, apply to both.

When to use the terminal instead

Some features only exist in the CLI: the full set of commands and skills, the ! shortcut for running a shell command yourself, and tab completion. For those, open the integrated terminal (Ctrl+` on Windows and Linux, Cmd+` on Mac) and run claude. The CLI "automatically integrates with your IDE for features like diff viewing and diagnostic sharing," so you keep the diffs. From a terminal outside VS Code, run /ide to connect it.

Two smaller things worth knowing. You can reference a terminal's output in a prompt with @terminal:name, using the terminal's title, so Claude sees an error without you copying it. And if you prefer the CLI look but want it in the editor, check the useTerminal setting to open Claude in terminal mode instead of the panel. If you work across several projects at once, the Claude desktop app is another option, and we wrote about why it won over a longtime terminal user.

Steps

  1. Check the requirements

    You need VS Code 1.94 or later, or a fork like Cursor, and a paid Claude plan or an Anthropic Console account. No API key is required.

  2. Install the extension

    Search for Claude Code in the Extensions view and install it. In Cursor use the install link from Anthropic's docs; other forks can install it from Open VSX.

  3. Sign in

    Open the Claude Code panel and sign in with your Claude account the first time you use it.

  4. Install the CLI for terminal use

    The extension doesn't add claude to your PATH, so run the standalone installer if you also want to use claude in VS Code's integrated terminal or any other terminal.

  5. Ask for a change and review the diff

    @-mention a file or selected lines, describe the change, then accept or reject the proposed diff, or step through it with Accept Change at Cursor and Reject Change at Cursor.

  6. Rewind if needed

    Hover over a message and use the rewind button to fork the conversation, revert the code, or both. Commit before big changes, since checkpoints only track Claude's edits.

Frequently asked questions

How do I install Claude Code in VS Code?
Search for Claude Code in the Extensions view, install it, open the Claude Code panel, and sign in with a paid Claude plan or Console account. It needs VS Code 1.94 or later, and no API key is required.
Does the Claude Code extension work in Cursor?
Yes. Anthropic's docs include a direct install link for Cursor, and the extension also installs in other VS Code forks from the Open VSX registry. If an editor can't install it, run the CLI in its terminal.
Why doesn't claude work in the VS Code terminal after installing the extension?
The extension bundles a private copy of Claude Code for its panel and doesn't add claude to your PATH. Run the standalone installer once and claude works in the integrated terminal and every other terminal.
Can I undo changes the Claude Code extension made?
Hover over a message and use rewind to fork the conversation, rewind the code, or both. Checkpoints only cover Claude's own file edits, so commit before large changes and rely on git as your safety net.
Do the VS Code extension and the Claude Code CLI share history?
Yes. They share the same conversation history, so you can continue a panel conversation in a terminal with claude --resume. Settings in ~/.claude/settings.json, including hooks and MCP servers, apply to both.
Which Claude Code features are only in the CLI?
The CLI has the full set of commands and skills, the ! shortcut for running shell commands yourself, and tab completion. The extension has a subset of commands. MCP setup and checkpoints work in both.

Built something with Claude Code?

ClaudeFolio is the directory of projects built with Claude Code. If this guide helped you ship something, the community would like to see it.

More guides