geo

A Comprehensive Guide to Using Claude Code in VS Code for AI-Powered Coding Assistance

Author 编辑
A Comprehensive Guide to Using Claude Code in VS Code for AI-Powered Coding Assistance

Learn how to install, configure, and leverage the Claude Code extension in VS Code—including key features like @-mentions, inline diff reviews, and permission modes—to boost your coding productivity.

Claude Code VS Code Extension AI Coding Assistant Anthropic Development Workflow Coding Productivity

AI coding assistants have revolutionized how developers work, and Anthropic’s Claude Code extension brings this power directly into VS Code. This guide walks you through setting up the extension and using its core features to streamline your development workflow.

Before installation, ensure you have VS Code 1.98.0 or higher and an Anthropic account (any paid plan like Pro/Max or a Claude Console account—no API key needed). For third-party access via Amazon Bedrock or Google Vertex AI, refer to Anthropic’s specialized setup docs.

To install: Open VS Code’s Extensions view (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows/Linux), search for “Claude Code”, and click Install. For VS Code forks like Devin Desktop, use the Open VSX registry. Note: The extension includes a built-in CLI for chat, but a separate CLI is needed for terminal use.

Access Claude Code via the Spark icon (editor toolbar or activity bar), Command Palette (search “Claude Code”), or status bar. First-time users log in via their Anthropic account through a browser prompt.

Key features to explore:
1. **Permission Modes**: Switch between normal (asks before actions), plan (shares changes first), and auto-accept (edits without approval).
2. **@-Mentions**: Reference files/folders with fuzzy matching to let Claude read or modify content.
3. **Command Menu**: Type “/” to access commands like attaching files or viewing usage stats.
4. **Extended Thinking**: Enable for complex tasks—Claude’s reasoning appears as collapsible blocks.

For more details, visit Anthropic’s official documentation at code.claude.com/docs/zh-CN/vs-code.