Lesson
Combine Claude Code and Your Favorite IDE
Install Claude Code, learn the context-first mental model, and practice the fastest ways to open, prompt, and safely apply code edits.
- Access
- Included
- Transcript
- Needs source
To combine the power of Claude Code and IDEs, you'll need the VS Code extension. Once it is installed, the chat panel understands which files you have open, what you have selected, and the diff it should propose back to you. This lesson is the baseline setup that unlocks every workflow that follows.
What you’ll learn
- Install and sign in to the Claude Code extension inside VS Code (or Cursor).
- Give Claude Code rich context so it understands your files, selections, and changes.
- Launch the chat fast, reconnect the IDE bridge, and apply diffs with confidence.
Install the Claude Code extension
- Open VS Code (or Cursor) and press
Cmd+Shift+Xto open the Extensions view. - Search for
Claude Codeand install the official Anthropic extension. - Click Sign in when prompted and connect with your Anthropic account.
- Accept the workspace access request so the extension can stream file context.
If you are in Cursor the extension ships preinstalled—still open the Extensions view to confirm it is enabled and updated.
Why the extension matters
- Context bridge: The extension tunnels your open file, selection, and tabs so Claude Code replies with precise edits instead of generic answers.
- Diff safety: Responses arrive as proposed diffs inside VS Code, letting you inspect and apply or discard changes line by line.
- Command surface: Slash commands, quick actions, and keyboard shortcuts live in the extension; without it, the Claude CLI runs blind.
Tips & tricks once it is installed
- Open Claude instantly:
Cmd+Escapeopens the panel. Prefer the built-in terminal? Runclaudefrom an editor terminal. - Reconnect the IDE bridge: If you see "IDE disconnected," type
/idein the Claude terminal to re-establish context streaming. - Pin the extension: Drag the Claude icon to the top of the Activity Bar or set up a custom keybinding so it is always one shortcut away.
- Verify context: Watch the prompt header for
@ In FILENAMEor@ N lines selectedbefore you send a request.
Try it
Prompts:
Explain what this selected function does and list any obvious tests.
Refactor this component to use a custom hook. Keep behavior identical.
Terminal:
claude
/ide