Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Bring Claude Code to Visual Studio 2026: A native diff with accept/reject, a live debugger Claude can drive autonomously, Roslyn code navigation, and Test Explorer integration. The IDE half of Claude Code's integration protocol. Community-built, unofficial.
Fetched from the repository for this visit.
Bring Claude Code into Visual Studio 2026. The claude CLI does the agent work. This extension is the IDE half of Claude Code's integration protocol: a native diff window with accept and reject, automatic selection and compiler-diagnostics context, a live debugger Claude can read and drive, Roslyn code navigation with decompile, and a test runner that catches failures under the debugger.

A fresh Claude session driving the Visual Studio debugger to find a bug that is invisible in the output, then opening the fix in the native diff.
Status: community project, not affiliated with Anthropic. Visual Studio 2026 only for now. Tested against claude 2.1.223.
Jump to a feature: Native diff · Drive the debugger · Data breakpoints · Catch flaky tests · Semantic navigation · Integrated terminal · Attach files · Claude's eyes · The panel
More: What you get · Requirements · Install · Quickstart · How it works · Privacy and security · Limitations · Troubleshooting · Build from source
Claude Code ships first-class IDE integration for VS Code and JetBrains, but not Visual Studio. This extension implements that same integration protocol natively for VS, so the CLI drives a real Visual Studio diff window and reads your selection and build errors instead of you copy-pasting into a terminal.
The demand for this is on the Claude Code tracker. These requests ask for what the extension provides:
docs/QOL.md.dotnet build, and gets back real errors and warnings with file, line and project. That matters because the Error List those diagnostics come from is populated by the IDE's build, so before this Claude was reading whatever your last manual Ctrl+Shift+B left behind. It can build a single project (or just the one owning the file it edited), and a long build keeps running in the background instead of timing out. Full reference: docs/BUILD.md.Debug/Trace output, assembly-binding failures, and first-chance exception notices even when the exception is caught and swallowed. All of it lands in the Output window's Debug pane, which no CLI can see. Claude can read it, filter it, and tail it. Full reference: docs/BUILD.md.docs/SEMANTIC.md..csproj text: real target frameworks, package versions including the transitive ones and what pulled each in, project references, the active configuration, the analyzer set, and evaluated properties like LangVersion and Nullable - the values a Directory.Build.props or Central Package Management sets where no project file ever mentions them. Full reference: docs/SEMANTIC.md.docs/DEBUGGER.md.docs/TESTING.md.+3 -1 count. Scoped to the current turn so it stays short, and it is the only record of what happened when auto-accept is on. F8 steps through the whole session's changes from the Output window. Full reference: docs/QOL.md.Alt+K) hand Claude your selection or file; Fix Errors bundles the code with its actual Error List diagnostics; Generate Documentation and Add Comments resolve the function at your caret through Roslyn - no selection needed; Generate Tests finds your test project and its framework, the tests that already cover the function, and asks for new ones verified with a build and a run; in test files, Fix This Test hands Claude the run → debug-at-the-throw → fix → re-run loop. Nothing auto-submits: references land in the CLI composer, the terminal gets focus so Enter sends, and every edit still goes through the diff gate. Full reference: docs/QOL.md.@-mentioned whole-file. A folder is mentioned as itself - the CLI walks the tree - and every reference arrives as a tray chip with its token estimate. Full reference: docs/QOL.md.claude inside Visual Studio's docked Terminal tool window (the same group as Developer PowerShell), already connected - it docks and tabs like any other VS terminal instead of floating over your desktop. An External console button keeps the standalone-window option. Full reference: docs/QOL.md.@ reference lands directly in the CLI's input box with the real image attached. Every attachment shows an estimated token cost before you send, Excel/video/archives attach too (Claude gets the path and reaches for a script), and staged copies live in a gitignored .claude/attachments/. Full reference: docs/QOL.md.docs/VISION.md.docs/QOL.md.docs/QOL.md.claude CLI's own terminal text stays English (upstream). Translation corrections welcome via issue or PR.A few of these are hard to picture from a bullet. Here they are running in the IDE.
Claude's edits open in Visual Studio's own diff viewer, and approving there is the only step. There is no second yes/no prompt in the terminal. You can reject an edit and leave a note, and Claude reconsiders with your feedback. You can also just fix it: the right pane is editable, and Accept applies what you left there. A panel toggle applies edits without the diff for when you want it to run ahead, and it resets each session so it is never silently left on.

While you are paused at a breakpoint, Claude reads your program's runtime state: the call stack, variable values, and threads. With driving turned on it also steps, sets breakpoints, and runs your code to corner a bug instead of guessing from the source. The clip above is a scoring function that returns the wrong total. Claude stopped inside the loop, stepped through the rounds, and watched a counter that should reset but did not.
It kept a running trace of what it saw at each round, which is how it caught the reset it was missing. For the input {5, 3, 0, 4, 2, 0, 6}:
| round | points | combo (after) | total | should be |
|---|---|---|---|---|
| 0 | 5 | 1 | 5 | 5 |
| 1 | 3 | 2 | 11 | 11 |
| 2 | 0 | 2, stays | 11 | 11 |
| 3 | 4 | 3 | 23 | 15 |
| 4 | 2 | 4 | 31 | 19 |
| 5 | 0 | 4, stays | 31 | 19 |
| 6 | 6 | 5 | 61 | 25 |
It has grown well past stepping. Claude can attach to a program that is already running (a hosted web service or a desktop app, not just F5), break at the throw site of an exception instead of the catch that swallows it, and pause a hung process to walk a deadlock back to the exact cycle. Full tool list and worked walkthroughs are in docs/DEBUGGER.md.
Point Claude at a field and it stops the moment that field is written, or traces every value the field takes, in order. It can watch conditionally (break only when the value goes below zero, for example) and on several fields at once. Visual Studio's own UI can set this, but there is no automation API for it, so the extension arms it through a bundled debug-engine component. That makes it new ground for catching the write that corrupts your state.
The plain watch records every write, so the corrupting step is obvious at a glance, and the conditional watch (< 0) breaks on exactly that one:
| # | value (cents) | written by | |
|---|---|---|---|
| 1-3 | 0 → 30000 → 42000 → 54000 | AddItems | three line items |
| 4 | 54000 → 48600 | ApplyBulkDiscount | 10% off |
| 5 | 48600 → 52488 | ApplyTax | +8% tax |
| 6 | 52488 → -47512 | ApplyLoyaltyCredit | the corruption |
The full data-breakpoint reference is in docs/DEBUGGER.md.
Claude discovers, runs, and debugs your unit tests through Visual Studio's Test Explorer engine. You get real per-test results (outcome, message, and stack), and after a fix it re-runs only the tests that failed. The test tools sit on top of the debugger, so a red test becomes a live investigation: Claude can launch one failing test and stop at the throw with the exception and locals in view. It can also loop a flaky test until the failing run happens and leave you paused inside that run, holding the state that caused it.

Full tool list and the worked flow are in docs/TESTING.md.
Most assistants navigate code by searching text, which misses indirect references and over-counts on comments and same-named symbols. This gives Claude Visual Studio's resolved model of your C# (Roslyn): find-all-references, go-to-definition, find-implementations, and call and type hierarchies, resolved through interfaces, overrides, and overloads. It also reads the decompiled body of a method inside a referenced DLL, which searching your repo cannot do. Point it at a framework or NuGet call and it returns the real decompiled C#, and for core .NET types it fetches the actual runtime source via SourceLink.
| Tool | What it caught that a text search misses |
|---|---|
| find-implementations | Triangle's explicit IShape.Area, which .Area() or : IShape never ties back to the interface |
| type-hierarchy | Circle and Square reach IShape transitively through ShapeBase; grep on : IShape finds only the two direct implementers |
| call-hierarchy | the interface-dispatched callers of IShape.Area, back to Main, that a search on the concrete Circle.Area would miss |
| go-to-definition | the right Describe overload at a call site, not all three declarations |
| decompile | the real body of Enumerable.Sum from the library, with Math.Sqrt falling back to SourceLink |
It needs no debug session and works whenever a C#/VB solution is open. Details are in docs/SEMANTIC.md.
The same server also answers what the project actually builds with. A .csproj in a modern repo is missing most of it: the LangVersion and Nullable a Directory.Build.props sets two folders up, the package versions Central Package Management moved into Directory.Packages.props, and the whole transitive package closure. vs_solution_model returns the evaluated graph instead - target frameworks, resolved package versions with what pulled each one in, project references, the active configuration, analyzers, and evaluated properties - so "which Newtonsoft.Json is this using, and why" gets the real answer. Details: docs/SEMANTIC.md.
Claude tells you it edited Pricing.cs:22, but that text lives in the terminal, where Visual Studio offers nothing to click. The panel lists the changes instead, one row per changed region:

Click a row and the file opens at that line. The list covers the current turn, so it stays short, and it survives while you type your next message. It earns its keep most with auto-accept on, where no diff opens and this is the only record of what changed. The Output window keeps the same list for the whole session, steppable with F8. Details: docs/QOL.md.
The Claude Code flyout sits mid-menu in the editor's right-click menu - below the Go To block, where you'd expect it:

The separator inside is the design: above it, actions that give Claude context (Explain, Add to Chat with Alt+K); below it, actions that ask Claude to change the file (Fix Errors with the real Error List diagnostics attached, Generate Documentation and Add Comments resolved to the function at your caret by Roslyn, Generate Tests composed with your test project, its framework and the tests that already cover the function - and in test files, in its place, Fix This Test, which hands Claude the run → debug → fix → re-run loop):

Every action stages a self-describing reference in the CLI composer (never auto-submits), focuses the terminal so Enter sends, and every resulting edit still comes through the diff gate. Details: docs/QOL.md.
claude runs inside Visual Studio's docked Terminal tool window - the same terminal group as Developer PowerShell - instead of a separate console floating over your desktop. Under the hood this is VS 2026's own terminal engine, reached through an undocumented service, so the launch is guarded: any failure or stall falls back to the classic external console automatically. Prefer the standalone window anyway (a second monitor, or a session that survives closing VS)? The External console button next to Launch does exactly that. Details and known quirks: docs/QOL.md.

Pasting a screenshot into the Claude Code CLI on Windows silently does nothing (a long-open upstream gap), and a screenshot is not a file you can drag. The panel closes that gap: take the capture, click Paste (or Ctrl+V in the panel, or drop files from Explorer), and the extension stages it and pushes an @ reference straight into the CLI's input box - the same at_mentioned protocol message the official VS Code plugin uses, verified to deliver the actual pixels, not just a path. You type your question around the chip and send.

Text gets a composer (1.15.0): pasting or dragging multi-line text opens an editor to review and shape it first - line breaks, trimming, a live token estimate - and Attach stages it as a .txt with its @ reference in the CLI. The Compose button opens the same editor empty, which is the pleasant way to write multi-line prompt material from scratch.

Every attachment shows an estimated token cost before you send - on the chip's tooltip, and totaled next to the tray. A full screenshot and a 4K one both land near ~1.5k tokens (the API downscales), while a tight Win+Shift+S crop costs a fraction of that, and a 2 MB JSON log announcing ≈212k tokens is your cue to ask Claude to Grep it instead of reading it whole. Formats Claude cannot read directly (Excel, video, archives) still attach - the chip is labeled, Claude gets the path, and it reaches for a script or tool on its own. BMPs are transcoded to vision-ready PNGs automatically. Files already in your workspace are referenced in place; everything else is copied into a gitignored .claude/attachments/ so reads never hit a permission prompt.
With the Allow screen capture toggle on, Claude stops asking you for screenshots and takes its own: the debugged app's window, any window by title (the browser running your site), or the screen. Asked only "in one of my monitors I have an image, a notepad, and a documentation file - screen grab that and tell me what you see", it captured the desktop once (≈922 tokens) and read all three: the sunflower photo described, the Notepad numbers transcribed digit-for-digit, the visible .NET 11 doc bullets summarized.

Every capture is staged as a visible chip in the attachment tray and logged in the activity feed, so what Claude saw is never invisible to you. The full story - the browser flow for web apps, the debugger composition, safety and limitations - is in docs/VISION.md.
A dockable Claude Code panel shows connection status, edit decisions, and token usage with an estimated cost for the latest call and the running session. It also holds the three safety toggles (apply edits without the diff, allow Claude to drive the debugger, and allow screen capture), all off by default and all reset each session, plus a Notify toggle (on by default) that mutes the finished/needs-input notifications.

claude 2.1.223..vsix from Releases and double-click it.After installing, everything lives in one dockable panel: View > Other Windows > Claude Code.
claude opens in Visual Studio's docked Terminal window, already connected to the IDE, so you do not need /ide. The panel pill turns green and reads Connected. (Want a standalone window instead? Click External console.)Diagnostics need a loaded project, not a loose file in Open-Folder mode, for the compiler to analyze it.
To let Claude debug: set a breakpoint, tick Allow Claude to drive debugger in the panel, start debugging, then ask it to investigate. Reading runtime state works without the toggle. The toggle only gates driving execution. See docs/DEBUGGER.md.
For a full first-run walkthrough with screenshots, a panel tour, and troubleshooting, see docs/GETTING-STARTED.md.
This is a protocol bridge, not a re-implementation of the agent. On launch the extension:
~/.claude/ide/<port>.lock.claude with ENABLE_IDE_INTEGRATION and the bridge port, so it auto-connects and speaks MCP over the socket.openDiff, openFile, getDiagnostics, selection updates, and the diff-tab lifecycle.To make the Visual Studio diff the single approval point, the extension installs a small PreToolUse hook into your workspace's .claude/settings.json that routes proposed edits through the diff. The CLI does all agent work, and the extension never makes model calls.
For debugger access it adds a UserPromptSubmit hook that injects live break state when you are paused, and a second MCP server, vs-debug, reached through a small stdio shim registered in your workspace .mcp.json. Reading runtime state is always allowed. Driving execution is opt-in behind the panel toggle. The same vs-debug server carries the test-runner tools, co-located with the debugger on purpose so a failing or intermittent test can be caught under it, and the build and Output-window tools, which feed both. For semantic navigation it adds a third MCP server, vs-semantic, backed by the live Roslyn workspace and read-only. Details live in docs/DEBUGGER.md, docs/TESTING.md, docs/BUILD.md, and docs/SEMANTIC.md.
claude CLI, under your own authentication..claude/ folder and merges hook entries into .claude/settings.json, preserving existing content. Each script's first line carries a vs:auto-managed marker - delete that line to take ownership of a script and the extension will never overwrite your copy:
vs-permission-hook.ps1, which routes Edit/Write/MultiEdit edits through the VS diff.vs-usage-hook.ps1, which reports the transcript path so the panel can show token stats.vs-debug-context-hook.ps1, which injects live break state into your prompt while you are paused.vs-notify-hook.ps1, which reports when Claude needs your input so the extension can raise an in-IDE notification.vs-mcp-shim.ps1, the stdio bridge for the vs-debug and vs-semantic MCP servers, registered in your workspace .mcp.json..claude/attachments/ (screenshots become PNGs there; out-of-workspace files are copied in). The folder carries its own * gitignore so nothing lands in your repo, staged copies are pruned after 7 days, and files already inside the workspace are referenced in place, never copied or deleted.claude update could change it. Known-good: 2.1.223.docs/TESTING.md.docs/BUILD.md.PrintWindow fall back to a screen-region copy, which includes anything overlapping them. See docs/VISION.md./ide in a claude terminal and pick Visual Studio.vs-debug and vs-semantic servers did not load for a session. Relaunch Claude from the panel (or from inside the workspace folder) and approve the project MCP servers if the CLI prompts.claude updated (connected, but the panel warns that hooks & tools didn't load, and stats stay at zero): newer CLIs (2.1.222+) tie project hooks to workspace trust. In the claude terminal run /hooks - if it shows nothing, restart claude and accept the trust prompt for the folder. If it recurs, open ~/.claude.json and remove duplicate project entries that differ only by path casing (c:/… vs C:/… - an upstream CLI bug, anthropics/claude-code#46586); close other running claude sessions first so the fix can save.claude from inside the repo.claude opened in a separate console instead of the docked terminal: the native terminal path failed or timed out and fell back (by design - the reason is in Output > Claude Code). Everything still works.claude --version.Requires Visual Studio 2026 with the Visual Studio extension development workload.
msbuild src/ClaudeCodeVS/ClaudeCodeVS.csproj /t:Rebuild /p:Configuration=Release
Press F5, or launch devenv /rootsuffix Exp, to debug in the experimental instance. Architecture and contributor guidance live in CLAUDE.md. Future work lives in ROADMAP.md.
Issues and PRs are welcome. The protocol contract is undocumented and has regressed before, so if you bump the claude CLI, please run the spike smoke test in spike/ and note the version.
MIT © 2026 Rishi Gulati. Not affiliated with Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic, used here only to describe interoperability.
GitHub checked 63h ago - refresh overdue. Recently viewed repositories target hourly refresh.