Back to Knowledge

Claude Code + VS Code

Bypass the copy-paste. Integrate Claude directly into your VS Code terminal for a seamless agentic coding loop.

1

Prerequisites

VS Code

Download from code.visualstudio.com

Node.js LTS

Download from nodejs.org

Restart your terminal

After installing Node, close and reopen your terminal

2

Verify Node

Open your terminal and run these commands:

node -v\nnpm -v

Success

You see version numbers like v20.x.x and 10.x.x

Error

"not recognized" or "command not found"

To fix: Restart terminal → Reinstall Node → Check "Add to PATH" during install

3

Install Claude Code

Open VS Code's integrated terminal:

Ctrl + ` on WindowsCmd + ` on Mac
npm install -g @anthropic-ai/claude-code

Success: No errors, you're ready to launch

4

Launch

Navigate to your project and run claude:

cd my-project\nclaude

Success: Browser opens for auth → Approve → Back to terminal

Alternative: Set ANTHROPIC_API_KEY environment variable to skip browser auth

5

Key Commands

/help

See all commands

Get a full list of available commands and their usage

/clear

Reset conversation

Mission accomplished, time for the next task. Use /clear to clear the context before starting fresh

/compact

Compress context

Running low on tokens? Compress conversation history to free up space

/config

Adjust settings

Customize Claude Code settings like model, permissions, and more

/cost

Check token usage

Track your API usage and token costs for the current session

/resume

Resume conversation

Pick up where you left off. Resume your last conversation and continue working

/doctor

Run diagnostics

Something not working? Run diagnostics to troubleshoot Claude Code issues

/mcp

View MCP servers

Manage your connected and authenticated MCP connections

Escape

Cancel action

Stop Claude mid-action to prevent unwanted changes

Ctrl+C

Exit Claude

End your Claude session and return to the terminal

6

Capabilities

Read

Understands your entire codebase

Edit

Modifies files with permission

Run

Executes npm, git, tests

Search

Glob & grep your code

Ship

Creates commits & PRs

Research

Web search for docs (with MCP)

7

Pro Tips

Be specific

"fix null pointer in utils.ts:42"

Use file names

Claude sees your project structure — reference files directly

Iterate

Start broad, then refine with follow-up questions

Review

Always verify changes before committing

Want to supercharge Claude Code?

Add MCP servers for web search, database access, and more.