How to Set Up Claude Code in VS Code (Step by Step)
Claude Code is Anthropic's coding agent. Its VS Code extension gives you a chat panel that can read your project, plan, edit files and show you the changes as diffs.
In short: install the “Claude Code” extension, sign in with a paid Claude plan or a Claude Console account, open the Spark icon, and start in Manual or Plan mode.
Why use Claude Code in VS Code
You stay in your editor. You see every change as a side-by-side diff before you accept it. It can work on many files at once, like adding a feature plus its tests.
What you need
- VS Code: version 1.94.0 or later (Help → About).
- An Anthropic account: any paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account. No API key needed for sign-in.
- Claude Code extension: search “Claude Code” in Extensions. It includes its own copy of the CLI for the panel.
- Optional: the CLI: install it separately if you want to type
claudein the terminal.
How setup flows
Install steps
- Open VS Code. Check the version is 1.94.0 or later.
- Press Ctrl+Shift+X (Mac: Cmd+Shift+X) to open Extensions.
- Search Claude Code (publisher Anthropic). Click Install.
- If it does not appear, run Developer: Reload Window from the Command Palette.
- Open any file. Click the Spark icon in the top-right of the editor. (Or click ✻ Claude Code in the bottom status bar.)
- Click Sign in and finish authorisation in your browser.
- You will see a short “Learn Claude Code” checklist. Follow it or close it.
Settings (what to change first)
Open Ctrl+, → Extensions → Claude Code.
- Permission mode: click the mode at the bottom of the prompt box. Beginners: use Manual (asks before edits) or Plan (shows a plan first).
- initialPermissionMode: set the default for new chats, e.g.
plan. - preferredLocation:
sidebarkeeps Claude on the right while you code. - respectGitIgnore: keep it on so ignored files are left out.
- Model: click the model name at the bottom of the prompt box, or type
/model, to switch models.
Configuration (project and user files)
- CLAUDE.md in the project root: short project rules (language, test command, style). Claude reads it each session.
- ~/.claude/settings.json: shared by the extension and the CLI. Use it for allowed or denied commands and MCP servers.
- Block secret files with a deny rule so Claude never reads them:
{
"permissions": {
"deny": ["Read(./.env)", "Read(./secrets/**)"]
}
}CLAUDE.md# Project rules - Language: Python 3.12 - Tests: pytest -q (must pass before you finish) - Style: type hints, short functions - Never touch .env or deploy scripts
First test (5 minutes)
- Open a folder with one small file, e.g.
utils.py. - Select a function. Claude sees the selected text automatically.
- Type: “Add input checks and a pytest test for this function. Run the tests.”
- In Manual mode, Claude shows a side-by-side diff. Read it. Click accept or reject for each change.
- When it wants to run
pytest, approve it. Check the result yourself. - Use Rewind (hover a message) if you want to undo its file changes.
Useful shortcuts
| Action | Windows/Linux | Mac |
|---|---|---|
| Focus Claude / editor | Ctrl+Esc | Cmd+Esc |
| Insert @file#lines | Alt+K | Option+K |
| New tab chat | Ctrl+Shift+Esc | Cmd+Shift+Esc |
| New line in prompt | Shift+Enter | Shift+Enter |
- Optional CLI: to run
claudein the terminal, install the standalone CLI from the official Claude Code docs. The extension does not add it to PATH. - Company cloud: if your company uses Amazon Bedrock or Google Cloud, turn on Disable Login Prompt and set the provider in
~/.claude/settings.json.
Quick quiz
1. What VS Code version does the extension need?
1.94.0 or later.
2. Which mode shows the plan before any change?
Plan mode.
3. Which file holds project rules for Claude?
CLAUDE.md in the project root.
4. How do you stop Claude reading .env?
Add a Read(./.env) deny rule in ~/.claude/settings.json.
Save tokens and money
Select only the code you need and use @file#lines instead of whole folders. Keep CLAUDE.md short. Start a new chat for a new task. Run /compact on long chats. Check /usage to see what is using your plan.