tutorial

How to Set Up Claude Code with VS Code in 2026

A step-by-step tutorial for installing Claude Code, the official Anthropic CLI, and wiring it into Visual Studio Code via the Claude Code extension. Covers npm install, authentication, extension configuration, per-project permissions, and the most common errors encountered during setup.

Overview

Claude Code is Anthropic's official CLI and IDE companion for Claude. While Claude Code runs natively in the terminal, integrating it with Visual Studio Code provides a richer editing experience: in-editor diffs, faster file navigation, and the ability to keep an existing VS Code workflow. This tutorial covers installation, authentication, IDE wiring, and common errors as of April 2026.

Prerequisites

  • Visual Studio Code 1.85 or newer
  • Node.js 20.x or newer (Claude Code is distributed as an npm package)
  • An Anthropic account with API access or a Claude Pro/Max subscription with Claude Code entitlement
  • macOS, Linux, or Windows (WSL2 recommended on Windows)

Step 1: Install Claude Code

Install the CLI globally via npm:

npm install -g @anthropic-ai/claude-code
claude --version

A successful install reports a version such as claude-code 1.x.x. If npm install fails with permission errors on macOS or Linux, fix the npm prefix to a user-owned directory rather than running with sudo:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATH

Step 2: Authenticate

Run the auth flow:

claude auth

The CLI opens a browser window to console.anthropic.com. Sign in with the same account holding the API or Claude subscription. The browser returns a one-time code; paste it back into the terminal. Credentials are stored in ~/.claude/credentials.json with file permissions 600.

Verify auth by running:

claude --help
claude "What model am I using?"

Step 3: Install the VS Code Extension

Open VS Code and install the official "Claude Code" extension from the Marketplace:

  1. Open Extensions (Cmd/Ctrl+Shift+X)
  2. Search for "Claude Code" — publisher Anthropic
  3. Click Install

The extension auto-detects the global claude binary if it is on the PATH. If not, set the path explicitly in VS Code settings:

{
  "claudeCode.cliPath": "/Users/yourname/.npm-global/bin/claude"
}

Step 4: Open the Claude Code Panel

Open the Command Palette (Cmd/Ctrl+Shift+P) and run Claude Code: Open Chat. The panel docks in the sidebar. From here:

  • Send prompts that include the active editor file as context
  • Accept or reject diffs inline before they touch disk
  • Use / slash commands the same way you would in the terminal

Step 5: Configure Per-Project Settings

Each project can have a .claude/settings.json file that controls allowed tools, environment variables, and hooks. A minimal config:

{
  "permissions": {
    "allow": ["Read", "Edit", "Bash(git status)", "Bash(npm test)"]
  }
}

Storing this file in the repository root keeps the team aligned on which Bash commands Claude is permitted to run unattended. A CLAUDE.md file at the repo root provides project-specific instructions that the agent reads on every session.

Common Errors

  • claude: command not found — The npm global bin directory is not on PATH. Add ~/.npm-global/bin (or your npm prefix) to the shell rc file.
  • 401 Unauthorized — The auth token expired or the account lost API access. Re-run claude auth.
  • rate limit exceeded — Either the daily message budget on a Pro plan is hit, or the API tier is too low for the model selected. Check usage at console.anthropic.com.
  • VS Code extension shows "CLI not found" — Set claudeCode.cliPath explicitly. Restart VS Code after changing the setting.
  • Diffs do not apply — The extension requires the workspace to be a single root folder; multi-root workspaces can confuse path resolution. Open one folder at a time.

Tips

  • Pin the Claude Code panel to the secondary sidebar so it sits next to a terminal panel; switching context between chat and shell is faster
  • Keep CLAUDE.md in version control so onboarding new contributors does not require re-explaining repo conventions
  • For privacy-sensitive code, set ANTHROPIC_DISABLE_TELEMETRY=1 in the shell environment

Editor's Note: We use Claude Code with VS Code daily at ShadowGen for the Automation Atlas codebase and several client engagements. The VS Code extension cuts roughly 30-40% of context-switching time compared to terminal-only usage, mainly because diffs review inline with the existing tab. The biggest practical caveat is the per-project permissions.allow list — without one, the agent prompts on every shell command, which destroys flow. Spending 10 minutes upfront enumerating safe Bash commands per repo pays back within a single session. We have not yet hit a case where the VS Code extension and terminal disagree on auth state, but if it ever happens, deleting ~/.claude/credentials.json and re-running claude auth resolves it.

Written & reviewed by Rafal Fila · Last updated:

Tools Mentioned

Related Guides

comparison

Keystroke vs n8n in 2026: Agent-Built TypeScript vs the Visual Canvas

Keystroke, launched in July 2026 by Y Combinator W24 company Sprint Labs, is a code-first automation platform where AI coding agents write workflows as TypeScript in the user's repository. n8n, founded in 2019, is the most widely deployed source-available visual workflow platform, with 200,000+ users and a $2.5 billion valuation. This comparison covers the agent-authored versus canvas building models, durable execution, licensing (Elastic License 2.0 vs the Sustainable Use License), verified July 2026 pricing including Keystroke's usage metering, and the maturity gap between a days-old platform and an established ecosystem.

comparison

QuantumBPM vs Camunda 2026: Single-Binary Challenger vs the BPMN Incumbent

QuantumBPM (launched 2026, Coroid s.r.o., Slovakia) packages a BPMN 2.0 runtime and DMN 1.5 decision engine into one Go binary backed by Temporal and PostgreSQL. Camunda (Berlin, founded 2013) is the category incumbent: Camunda 7 (Apache 2.0, in maintenance) and the Zeebe-based Camunda 8 platform. This comparison covers product structure, architecture, DMN TCK conformance with recording dates, deployment, pricing, and vendor maturity, verified July 2026.

case-study

Migrating 23 Make Scenarios to Self-Hosted n8n: a 3-Week Breakdown

Anonymized retrospective of a DTC ecommerce brand migrating 23 Make scenarios to a self-hosted n8n instance over three weeks. Tooling cost dropped from $348/month on Make Teams to roughly $12/month on a Hetzner VPS, but credential and webhook recreation consumed about 40% of total project time.

Related Rankings

Common Questions

Is Keystroke worth it in 2026?

Keystroke earns a provisional 6.5/10 in its July 2026 open alpha: the agent-native TypeScript model is genuinely differentiated and the free Hobby tier makes it safe to trial, but the platform is pre-1.0 (npm at v0.1.98, public repository published July 13, 2026), has no third-party production track record, and its Elastic License 2.0 restricts offering it as a hosted service. Worth trialing for teams that build through coding agents; too young for production-critical workflows.

What is Keystroke?

Keystroke is a code-first workflow automation and AI agent platform, launched July 13, 2026 by Y Combinator-backed Sprint Labs, that positions itself as an n8n alternative built for AI coding agents. Workflows are written as typed TypeScript in the user's own repository, usually by agents such as Claude Code, Cursor, or Codex, and deployed to Keystroke's managed cloud or self-hosted under the source-available Elastic License 2.0.

How much does Keystroke cost in 2026?

Keystroke offers three tiers as of July 2026: Hobby (free forever, with $1/month of included usage credit), Pro ($20/month, including $20/month of usage credit), and Organization (custom pricing with SSO, RBAC, and audit logs). Usage is metered on every tier: $0.01 per agent or workflow run, $0.005 per empty poll, $0.007 per web search, roughly $0.067 per hour of sandbox compute, and a 1.1x markup on AI model calls unless you bring your own API keys.

Is Keystroke a good n8n alternative?

Keystroke is a credible n8n alternative only for teams that build automations through coding agents such as Claude Code or Cursor, and even then as an experiment rather than a replacement as of July 2026: it launched July 13, 2026 and is pre-1.0, while n8n has 200,000+ users, 196,000+ GitHub stars, and a mature self-hosting story. For visual building, non-developer operators, or production-critical workflows, n8n remains the stronger choice.