Claude Code in Cursor: Extension and CLI Setup
How to use Claude Code in Cursor: install Anthropic's extension from Open VSX, sign in with your Claude plan, run the CLI in its terminal, and what it costs.
Josh Pocock7 min read
AI Coding
Claude Code in Cursor
Stride AI Academy
To use Claude Code in Cursor, install Anthropic's Claude Code extension from Cursor's Extensions view, then sign in with your Claude account. Cursor is a fork of VS Code, and Anthropic's docs list Cursor as a supported editor for the same extension. You can also install the Claude Code CLI and run claude in Cursor's built-in terminal. Either way, Claude Code runs on your Claude plan, not on Cursor's credits.
This guide covers both ways in, what you need, how billing works on each side, and what to check when something doesn't connect. Everything here was checked against Claude Code's VS Code docs, Anthropic's gateway connection guide, Cursor's extensions docs, Cursor's models docs and Cursor pricing on November 22, 2026. Stride AI Academy isn't affiliated with Anthropic or Cursor.
What you need
- Cursor installed. Anthropic's docs ask for VS Code 1.94.0 or later for the extension. They don't give a separate Cursor version, so keep Cursor updated.
- A Claude plan or Console account. Any paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account works, and you don't need an API key. The Free Claude plan doesn't include Claude Code.
- Optional: the standalone CLI, if you want to type
claudein Cursor's terminal. See how to install Claude Code.
You don't need a paid Cursor plan to run Claude Code inside Cursor. Cursor's plans only matter if you also want Cursor's own agent to use Claude models, which is covered below.
Option 1: install the Claude Code extension in Cursor
Anthropic's docs give a direct install link for Cursor, cursor:extension/anthropic.claude-code, which opens the extension page inside Cursor. Or install it by hand:
- Press
Ctrl+Shift+X(Windows and Linux) orCmd+Shift+X(Mac) to open the Extensions view. - Search for "Claude Code".
- Check the publisher is Anthropic, then click Install.
Cursor pulls third-party extensions from the Open VSX Registry, and Anthropic publishes Claude Code there. Cursor's docs warn that the same extension ID can point to a different publisher on Open VSX than on Microsoft's marketplace, so checking the publisher name is worth the two seconds.
Sign in
Open the Claude Code panel from the Spark icon in the editor toolbar (it shows when a file is open), or from the Command Palette with "Claude Code". The first time, click Sign in and approve access in your browser.
If you've set ANTHROPIC_API_KEY in your shell but still see the sign-in screen, the editor may not have picked up your shell's environment. Anthropic's fix for VS Code is to launch the editor from a terminal so it inherits your variables, or to sign in with your Claude account instead.
What you get
The extension is the same one VS Code uses, so the panel works the same way in Cursor:
- Side-by-side diffs you accept or reject
- @-mentions for files, folders and terminal output
- Plan mode with a Markdown plan you can comment on
- Permission modes, switched at the bottom of the prompt box
- Several conversations in tabs, plus checkpoints to rewind
We cover every feature, setting and shortcut in the Claude Code VS Code extension guide, and all of it applies here. For how permission modes and rules fit together, see Claude Code permissions.
Option 2: run the Claude Code CLI in Cursor's terminal
If you prefer the terminal version, open Cursor's integrated terminal and run:
claudeThis needs the standalone CLI. Anthropic's docs say installing the extension does not put claude on your PATH. On macOS, Linux and WSL, the docs' install command is:
curl -fsSL https://claude.ai/install.sh | bashOn Windows PowerShell:
irm https://claude.ai/install.ps1 | iexAnthropic's docs also say this is the fallback for any editor that can't install the extension: the CLI works in any terminal.
The CLI has every command and skill, the ! bash shortcut and tab completion. The extension supports a subset of the CLI's commands. Settings in ~/.claude/settings.json are shared between the two, so permission rules, hooks and MCP servers you set up once apply in both.
You can use both at once: the panel for reviewing diffs, the terminal for commands the panel doesn't have. Conversation history is shared, so claude --resume in the terminal picks up a panel session.
Claude Code vs Cursor's own Claude models
This is where people get confused. There are two separate ways to use Claude inside Cursor, and they bill differently.
| Claude Code extension or CLI | Cursor's agent with a Claude model | |
|---|---|---|
| Made by | Anthropic | Cursor |
| Who you pay | Anthropic (your Claude plan or Console) | Cursor |
| How it's billed | Your Claude plan's usage limits | API list price from prepaid Cursor credit |
| Cursor plan needed | None | Premium or higher |
| Free or Plus Cursor plan | Works | Claude models not available |
From Cursor's models docs, November 22, 2026: Claude is a third-party model in Cursor, so it isn't in the included usage pool. "Plus and Free don't include third-party models." On Premium and above, Claude models are billed at API list price from prepaid credit. On Teams and Enterprise, Cursor adds a token rate of $0.25 per million tokens on eligible models. Cursor's pricing page lists Premium at $30 a month.
So if you already pay for Claude Pro or Max, the Claude Code extension in Cursor is the way to use Claude without paying twice. Cursor's own agent can still run its own models in the same editor. For worked monthly numbers on both sides, see Cursor model pricing vs Claude Code.
Running Claude Code through a gateway in Cursor
If your company routes Claude Code through an LLM gateway, Anthropic's connection guide says to set the variables for the extension in its own claudeCode.environmentVariables setting, in the editor's user settings JSON. The extension checks credentials from this setting before it launches:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://llm-gateway.example.com" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-gateway-key" }
]
}The guide documents this for VS Code and doesn't mention Cursor, so after setting it, run /status in the panel and check the Anthropic base URL line shows your gateway. Values in ~/.claude/settings.json reach the Claude Code process but not the extension's own login check.
Troubleshooting Claude Code in Cursor
The extension won't install or doesn't show up. Update Cursor, then search "Claude Code" again and check the publisher is Anthropic. Reload the window after installing.
The Spark icon is missing. Open a file first. The toolbar icon only shows with a file open.
claude isn't found in the terminal. You've installed the extension but not the CLI. Install the CLI with the commands above, then open a new terminal.
You see "Claude Code process exited with code 1". That's a Claude Code error, not a Cursor one. Our fix for exit code 1 walks through the causes.
Claude never responds. Check your connection, start a new conversation, then run claude in a terminal to see a fuller error message.
Should you use Claude Code inside Cursor?
It suits you if you like Cursor as an editor but want Anthropic's agent and your Claude plan's usage. You get Claude Code's agent inside the editor you already use, and you only pay Cursor if you want its paid features.
If you're still choosing between the two tools, read Claude Code vs Cursor. If you're choosing between the editors themselves, see Cursor vs VS Code.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
Does Claude Code work in Cursor?
Yes. Anthropic's VS Code extension installs in Cursor, and Anthropic's docs include a Cursor install link. You can also run the Claude Code CLI in Cursor's integrated terminal.
Do I need a paid Cursor plan to use Claude Code?
No. Claude Code in Cursor runs on your Claude plan or Console account. A paid Cursor plan only matters if you want Cursor's own agent to use Claude models, which needs Premium or higher.
Is Claude Code in Cursor the same as using Claude in Cursor's chat?
No. The Claude Code extension is Anthropic's agent and bills to your Claude plan. Cursor's agent with a Claude model is Cursor's product and bills at API list price from prepaid Cursor credit.
Why can't I run claude in Cursor's terminal?
The extension doesn't add claude to your PATH. Install the standalone CLI with Anthropic's install command, then open a new terminal in Cursor.
Where does Cursor get the Claude Code extension?
From the Open VSX Registry, where Anthropic publishes it. Check the publisher is Anthropic before installing, since Cursor's docs warn that an extension ID can map to a different publisher on Open VSX.