A VS Code extension that enables Claude (or any other MCP-enabled AI assistant) to control Visual Studio Code through the Model Context Protocol (MCP). This allows Claude to search your codebase, open files, navigate to specific lines, create diff views, and use VS Code's language intelligence directly in your VS Code editor.
VS Claude acts as a bridge between Claude and your VS Code editor. When you're chatting with Claude about code, Claude can:
-
Search and navigate code intelligently
- "Find all classes in the workspace"
- "Show me all getter methods in the Animation class"
- "Find all test classes ending with 'Test'"
- "List all the types in this Dart file without their members"
- "Find all references to the processData function"
-
Open specific files in your VS Code editor
- "Open the main.go file in VS Code"
- "Show me the package.json file in VS Code"
-
Highlight code ranges
- "Show me the main loop in glfw-example.cpp in VS Code"
- "Find where we write to the channel file and highlight it in VS Code"
- "Highlight all usages of the updatePhysics method in Skeleton.cs in VS Code"
- "Show me all the error handling blocks in main.py in VS Code"
-
Show diffs between files
- "Compare old.js with new.js in VS Code"
- "Show me the diff between config.json and config.backup.json in VS Code"
-
Show git diffs
- "Show me the git diff for Animation.java between branches 4.2 and 4.3-beta in VS Code"
- "Show me git diff for State.ts, working vs last commit in VS Code"
- "Show me what changed in main.py in the last commit in VS Code"
- "Show the staged changes for UserService.java in VS Code"
-
Get diagnostics and errors
- "Show me all TypeScript errors in the workspace"
- "What errors are in the UserService.ts file?"
-
Work with multiple VS Code windows
- Claude will automatically detect and let you choose which window to use
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
- Search for "VS Claude"
- Click Install
- Download the latest
.vsixfile from the releases - In VS Code, go to Extensions view
- Click the "..." menu and select "Install from VSIX..."
- Select the downloaded file
After installing the extension:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Run
VS Claude: Install MCP - Follow the setup instructions
- The extension will install the MCP server and provide configuration for Claude
- Node.js (v16 or higher)
- Go (v1.21 or higher)
- VS Code (latest version)
- npm or yarn
vs-claude/
├── src/ # TypeScript extension source
│ ├── extension.ts # Main extension entry point
│ ├── window-manager.ts # Window tracking and heartbeat
│ ├── command-handler.ts # Executes MCP commands
│ ├── open-handler.ts # File opening and diff logic
│ ├── query-handler.ts # Language intelligence queries
│ └── setup.ts # MCP installation logic
├── mcp/ # Go MCP server
│ ├── main.go # MCP server implementation
│ └── go.mod # Go module definition
├── scripts/ # Build and utility scripts
│ └── build-binaries.sh # Cross-platform Go build
├── out/ # Compiled TypeScript (generated)
├── bin/ # Compiled Go binaries (generated)
└── docs/ # Documentation
├── open-tool-design.md
└── query-tool-design.md
# Install dependencies
npm install
# Build everything (TypeScript + Go binaries)
npm run build
# Build only Go binaries
npm run build:go- Open the project in VS Code
- Press F5 to launch a new VS Code window with the extension loaded
- The debug console will show extension logs
- Set breakpoints in the TypeScript code as needed
The extension includes a built-in query tester:
- Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Run
VS Claude: Test Query Tool - Use the web UI to test different query types
Example queries to try:
- Find all classes:
query="*" kind="class" - Find getters in a class:
symbol="ClassName.get*" - List top-level types:
depth="1" kind="class,interface"
The MCP server logs to stderr, which you can see when running Claude with --debug:
claude --debugTo test the MCP server directly:
# Initialize and list tools
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05"},"id":1}' | ./bin/mcp-server-darwin-arm64-
Window Tracking: Each VS Code window creates a unique ID and maintains files in
~/.vs-claude/:{id}.json- Window metadata (workspace, timestamp){id}.cmd.jsonl- Command queue for that window
-
Heartbeat Mechanism: The extension touches its metadata file every second, allowing the MCP server to detect and clean up stale windows (not updated in 5+ seconds)
-
Command Flow:
- Claude sends commands to the MCP server via stdio
- MCP server writes commands to the appropriate window's command file
- Extension watches its command file and executes commands
- Results are returned through the MCP protocol
Opens files, diffs, or navigates to specific locations in VS Code.
Supports multiple item types:
- file: Open a file with optional line highlighting
- diff: Compare two files side-by-side
- gitDiff: Show git changes for a file
Examples:
{"type": "file", "path": "/path/to/file.ts", "startLine": 10, "endLine": 20}
{"type": "diff", "left": "/path/to/old.js", "right": "/path/to/new.js"}
{"type": "gitDiff", "path": "/path/to/file.ts", "from": "HEAD", "to": "working"}Queries VS Code's language intelligence for semantic code understanding.
Query Types:
-
findSymbols - Search for symbols across the workspace
- Supports glob patterns:
*,?,[abc],{a,b} - Examples:
get*(getters),*Test(test classes),{get,set}*(getters/setters)
- Supports glob patterns:
-
outline - Get file structure with filtering
- Supports hierarchical queries:
Animation.get*(getters in Animation class) - Use
depth: 1to list only top-level symbols
- Supports hierarchical queries:
-
diagnostics - Get compilation errors and warnings
- Can be scoped to specific files or entire workspace
-
references - Find all usages of a symbol
- Requires file path and line number
Examples:
{"type": "findSymbols", "query": "*Service", "kind": "class"}
{"type": "outline", "path": "/path/to/file.java", "symbol": "Animation.*"}
{"type": "references", "path": "/path/to/file.ts", "line": 42}# Run TypeScript compiler in watch mode
npm run watch
# Type checking
npm run typecheck # Check TypeScript types without building
# Lint TypeScript code
npm run lint
npm run lint:fix # Auto-fix linting issues
# Format code
npm run format # Format TypeScript and Go code
npm run format:check # Check formatting without modifying
# Run all checks (lint + format)
npm run check
npm run check:fix # Auto-fix all issues
# Clean build artifacts
npm run clean
# Package extension
vsce packageThis project uses Husky and lint-staged to ensure code quality. The pre-commit hook automatically:
- Runs TypeScript type checking on the entire codebase
- Lints and formats staged TypeScript/JavaScript files using Biome
- Formats staged Go files using gofmt
To bypass hooks in emergency (not recommended):
git commit --no-verify- Check the VS Claude output channel in VS Code for extension logs
- Run Claude with
--debugto see MCP server logs - Ensure
~/.vs-claude/directory has proper permissions - Verify the MCP server binary matches your platform architecture
MIT