Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Claude AI for Visual Studio
Claude AI for Visual Studio

Claude AI for Visual Studio

Acceo Solution

|
1,313 installs
| (3) | Free
Claude AI natively embedded in Visual Studio 2022. No terminal, no browser, no copy-pasting. Features: • Auto-context: reads your open file automatically when answering code questions • Sidebar chat with streaming responses and full session history (Ctrl+Alt+C) • Inline ghost...
Download

Claude AI for Visual Studio 2022

A native VSIX extension that brings Claude AI directly into Visual Studio 2022. No terminal, no browser, no copy-pasting. Powered by Anthropic Claude.


Complete Feature List

🧠 Smart Auto-Context

Claude automatically reads your focused open file when your question is about code — without you clicking anything. A two-tier classifier decides silently:

  • Tier 1 (instant, no API call): regex patterns that are unambiguously code-related → attaches file. Patterns that are clearly general → skips.
  • Tier 2 (fast Haiku call, ~50 tokens): fired only for ambiguous messages.

Attaches file automatically: "why is this throwing a null reference?" · "refactor this" · "add xml doc comments" · "explain this method" · "write unit tests" · "is this thread-safe?"

Does NOT attach file: "what is dependency injection?" · "difference between abstract and interface?" · "best practice for error handling?" · "hello"

Priority rules: Manual 📄 Active file > @mentions > Smart auto-context. If no file is open, Claude answers from general knowledge.


📦 Archive & Start Fresh

When a conversation grows long and you want to preserve key findings while starting clean:

  • Click 📦 Archive in the header (next to + New)
  • Current session is renamed to [Archived] {original title} and saved
  • Claude summarizes the session in 8-10 bullet points:
    • Objective · Key findings · Decisions made · Changes · Progress · Issues · Next steps · Context
  • A new session starts automatically with a context carryover bubble at the top containing the summary
  • Follow-up messages can reference the summary — Claude knows what was done before
  • Useful for: keeping long refactoring sessions organized, preserving important decisions across sessions, reducing token bloat when working on large tasks
  • Language-aware: Archive summaries are generated in your configured language (English or French)

🗺️ Dynamic Solution Context & Project-Aware Intelligence

Claude always knows your current solution structure — automatically and in real-time:

  • Live project map — Every message includes your solution root and all project directories
  • Smart file discovery — Claude can search for files dynamically:
    • Use explicit paths: "edit Services/PaymentService.cs"
    • Use @mentions: "@Payment" fuzzy-finds files
    • Use patterns: "Find all *Controller.cs"
    • Scales seamlessly to any project size
  • Seamless multi-project switching — Close Project A, open Project B, continue chatting. Claude's context updates automatically with zero friction
  • Project-aware multi-file modifications — In multi-project solutions, Claude intelligently suggests related file changes:
    • Modify an interface file? Claude also suggests updating the implementation and tests
    • Update a service? Claude proposes corresponding config/factory/test changes
    • Each modified file shows its project context so you know exactly what's being changed
  • Intelligent file discovery — Claude understands your codebase structure and can suggest related files without explicit @mentions
  • Historical session continuity — Load an old session from a closed project. New messages flow seamlessly with the current solution context
  • Like Claude Code in VS Code — Context adapts naturally as you switch between solutions, just like working in VS Code's Claude Code extension

This is powered by a dynamic system prompt that recalculates for every message with the current solution state — ensuring Claude always has accurate, up-to-date project visibility.

Technology detection (async, cached): The extension detects your project's languages and frameworks (C#, Python, TypeScript, Java, ASP.NET Core, Blazor, WPF, .NET version, etc.) on a background thread without blocking the UI. Results are cached and automatically invalidated when the solution changes, so subsequent messages are instant. The cache is pre-warmed when a solution opens, making the first message fast.

System prompt respects your language preference: If you configure the extension to French (Settings), Claude receives all instructions in French — the initial system prompt, archive summaries, and multi-project guidance are all localized.

Project-specific guidance from CLAUDE.md: On every message, the extension reads CLAUDE.md from your solution root (fresh from disk) and injects it into the system context. Edit your project rules while you're chatting → Claude picks them up on the next message, no session restart needed. Your project guidance stays dynamic and under your control. If the file doesn't exist, the extension falls back to default guidance.

Project badges in multi-project solutions: When your solution has 2+ projects, each modified file displays its project name in parentheses — a visual clue showing exactly which project's code is being changed. Solution-level files (like .editorconfig, README.md) are labeled (Solution-level). This makes it easy to track cross-project edits at a glance.

Example in a multi-project solution:

✏ Modified: Interfaces/IEngine.cs (in MyProject.Interfaces)
✏ Modified: Services/Engine.cs (in MyProject.Services)
✏ Modified: Tests/EngineTests.cs (in MyProject.Tests)
✏ Modified: .editorconfig (Solution-level)

Single-project solutions don't show the badge — just the filename — keeping the UI clean.


💬 Sidebar Chat Panel

  • Open: View → Other Windows → Claude AI or Ctrl+Alt+C
  • Can be docked, floated, or tabbed like any VS tool window
  • Full conversation history in chat bubbles
  • Streaming responses — Claude's reply appears word-by-word as it is generated
  • ⏹ Stop — the Send button becomes a red Stop button while Claude is responding; click it to cancel mid-stream
  • Expanding input box — grows line-by-line as you type; capped at 25% of the panel height, then scrolls
  • Context window warning — a warm banner appears above the input when ≥ 50% of the 200 K-token context window is used. Text reads "You've used 85% of your session limit · resets in 12m" (reset time comes from the anthropic-ratelimit-tokens-reset response header; falls back to "new session resets it"). Includes a View usage link and a × to dismiss for the current session.
  • Token usage counter — compact display in the header showing "X / 200K (Y%)" after each API response. Color-coded: grey (< 50%), amber (50-79%), red (≥ 80%) for quick visual feedback on context fill
  • Session auto-saved after every assistant reply
  • Right-click any message bubble to copy:
    • Automatically copies the message text to clipboard (no menu required)
    • Visual feedback: 1.5-second floating notification popup with "Copy to clipboard" text
    • Works on the entire bubble surface (both text and background areas)
  • Double-click any message bubble to view full context:
    • Works anywhere on the bubble: text content, padding, or empty background
    • User messages: See the complete payload sent to Claude — includes system prompt, conversation history, and all attached context (@mentions, active file, build output) baked into one message
    • Assistant replies: See the complete response Claude generated
    • Two views: Full Payload tab shows the raw message; Breakdown tab explains what was included
    • Copy button in the viewer to copy full message to clipboard
    • Helpful note for old messages loaded from history: "⚠ Full context not available — message loaded from history" (shows original prompt text only)

📂 Session History Sidebar

  • Toggle with the ☰ button in the chat header
  • Solution-scoped — only sessions from the currently open solution are shown. Sessions from other/closed projects are automatically hidden
  • Sessions grouped: TODAY, THIS WEEK, OLDER
  • Each entry shows: title, first-message preview, timestamp
  • 🔍 Search box — filters sessions by title, preview, and full message content in real time
  • ✎ Rename button per session — opens an inline rename dialog
  • 🗑 Delete button per session — with confirmation
  • Delete all sessions button at the bottom of the sidebar

Session Storage & Sharing

  • Sessions stored at %APPDATA%\ClaudeVS\sessions\{SolutionName_GUID}/:
    • Folder name combines human-readable solution name with solution GUID (e.g., MyApp_A1B2C3D4)
    • _index.json — lightweight metadata index for fast listing (title, preview, message count, timestamps, tokens used)
    • {YYYY}-{MM}-{DD}_{HH}.{MM}.{SS}.json — individual session files with full message history, system prompts, and extension context
  • Solution isolation: Each solution's sessions are stored in its own folder. When a solution closes, in-memory session data is cleared to prevent accidental data leakage. When a solution opens, a fresh session begins.
  • Portable paths: File references stored relative to solution root for colleague sharing:
    • Instead of D:\Projects\MyApp\Services\Engine.cs, stored as Services/Engine.cs
    • When colleague loads session from different path (e.g., C:\Work\MyApp), paths still resolve correctly ✓
  • Share with colleagues: Copy entire MyApp_A1B2C3D4/ folder → colleague puts it in their %APPDATA%\ClaudeVS\sessions\ → all sessions load with correct paths on their machine
  • Resuming a session replays the full message history with context from the current solution

✦ Inline Code Suggestions

  • Ghost text appears after your cursor while typing in .cs files
  • Powered by claude-haiku-4-5-20251001 for low latency
  • Tab — accept the suggestion
  • Esc — dismiss
  • *Alt+* — toggle on/off globally
  • Configurable via Tools → Options → Claude AI → Inline Suggestions

✏ Ask to Edit / 📋 Review

The toolbar button is dynamic — its label and behavior change based on whether you have text in the chat input:

📋 Review mode (empty input):

  • Click to get a detailed code review of the active file in chat
  • Claude analyzes for: bugs, code smells, improvement opportunities, overall observations
  • No file editing — output is text analysis only

✏ Edit mode (has input):

  • Type your instruction first (e.g. "extract this into a helper method", "add null checks", "convert to async")
  • Click ✏ Edit to have Claude rewrite the active file
  • Reads the currently active/focused file automatically — no need to attach it manually
  • Sends the instruction + full file content to Claude; Claude returns the complete rewritten file
  • Opens a Beyond Compare-style side-by-side diff viewer: original on the left, Claude's version on the right
    • Green = added lines · Red = removed lines · Character-level highlighting for modified lines
    • Original file line numbers in both gutters
    • Both panels scroll in sync
    • ✓ Accept Changes — writes to disk, reloads in editor
    • ✕ Reject — closes with no changes
  • If Auto-accept is ON (green dot in header), the diff viewer is skipped and the file is written directly to disk

💾 File Write Capability

Claude can now create and save new files directly to your solution:

  • How it works: When you ask Claude to "create CLAUDE.md" or "save a config file", Claude wraps the file content with special markers:
    <<<WRITE_FILE path="relative/path/from/solution/root">>>
    [file content here]
    <<<WRITE_FILE_END>>>
    
  • Automatic file creation — The extension detects the markers, validates the path, and writes the file to disk without user interaction
  • Safe paths — Files must be within your solution directory; paths outside the solution are blocked
  • Security-aware — Respects file scope protection rules:
    • .md files can be written anywhere under the solution root
    • Code files (.cs, .json, .xml, etc.) must be written to project directories
    • Out-of-scope writes are blocked with a clear error message in chat
  • Automatic backups — If the file already exists, a backup is created in {ProjectRoot}/Backups/ before the file is overwritten
  • Confirmation in chat — A file action bubble appears showing:
    • Whether it was Created (new) or Saved (overwritten)
    • The relative file path
    • Undo button if a backup exists (reverts to the previous version)
  • Use cases:
    • "Create a CLAUDE.md with development guidelines for this project"
    • "Generate a .gitignore file for this project"
    • "Create a new configuration file with these settings"
    • "Generate a helper class for common utility functions"

🔁 Fix & Build Loop

  • Triggered by 🔁 Fix & Build in the chat toolbar
  • Maximum 3 attempts
  • Each attempt:
    1. Runs dotnet build (SDK-style) or msbuild (legacy)
    2. Parses all compiler errors (file + line + column + code)
    3. Reads every affected source file
    4. Claude fixes all errors in one pass
    5. Writes corrected files (respects Auto-accept / diff setting)
    6. Waits 500ms then recompiles
  • Live progress streams line-by-line into a single chat bubble
  • If errors remain after 3 attempts: remaining errors listed in chat, partial fixes kept

🖼 Image Paste

  • Ctrl+V in the chat input — captures clipboard image
  • Drag and drop image files onto the chat area
  • Supported: PNG, JPG/JPEG, GIF, WebP, BMP
  • Thumbnails appear in a strip above the input with × to remove before sending
  • Can send images with no text
  • Images base64-encoded and sent as multipart content — Claude sees the full image

📄 Active File Button

  • Manually force-attaches the focused open file
  • If text is selected in the editor, attaches only the selection — useful for asking about a single method without sending the whole file
  • Toggles on/off — turns blue when active
  • Takes priority over smart auto-context

@ File Mentions

  • Type @ + 2+ characters of a filename in the chat input
  • Fuzzy-matches all files in your solution
  • Matched file appears as a chip/badge above the input
  • Remove with × on the chip (tooltip: "Remove this file mention")
  • Multiple files per message supported
  • @ Mention file toolbar button pre-fills @ in the input

📋 Output / @terminal

  • Type @terminal or @output in the chat input — an amber 📋 Output chip appears
  • Click the 📋 Output toolbar button to add it with one click
  • When sent, the VS Output window content (Build pane) is appended to the message
  • Falls back to the recent command buffer if the Output window is empty
  • Build errors are parsed and included in structured form alongside the raw log
  • Useful for: "why did this build fail?", "what do these errors mean?", "fix these errors"

⚙ Auto-Accept Toggle

  • The Auto badge (coloured dot) in the chat header
  • Grey = OFF — diff view shown before every edit
  • Green = ON — edits applied directly to disk, no popup (default)
  • Click the badge to toggle
  • When ON: optional VS status bar notification on apply
  • Also in Tools → Options → Claude AI → Edit Behaviour

📖 Documentation Viewer

  • Click the ⚙ Settings button in the chat header
  • Click 📖 Documentation button in the settings dialog
  • Opens a window with the complete README.md formatted as beautiful HTML
  • Styled to match VS 2022's dark theme
  • Includes all features, keyboard shortcuts, and settings documentation

💾 Automatic File Backups

When Enable Backups is turned ON in settings, the extension automatically backs up files before Claude modifies them:

  • Location: Backups are stored in {ProjectRoot}/Backups/{Year}/ where {ProjectRoot} is the project directory and {Year} is the current year (e.g., 2026) — one backup directory per project
  • Naming: Backup files use the format {YYYY}-{MM}-{DD}_{HH}.{MM}.{SS}.{originalfilename} where:
    • {YYYY} = 4-digit year (e.g., 2026)
    • {MM} = 2-digit month (01-12)
    • {DD} = 2-digit day (01-31)
    • {HH} = 2-digit hour (00-23)
    • {MM} = 2-digit minute (00-59)
    • {SS} = 2-digit second (00-59)
    • {originalfilename} = the original file name (e.g., Helper.cs)
    • Example: 2026-05-17_14.32.45.Helper.cs
  • Scope: Only files within project directories (see File Scope Protection) are backed up
  • Comparison: When editing, a file action bubble appears in chat showing:
    • The action (Modified, Added, or Deleted)
    • The relative file path (e.g., src/Utils/Helper.cs)
    • Click to copy the full path to clipboard
    • Double-click to compare the backup with the current file in Beyond Compare (versions 2 to 5 supported; falls back to opening in editor if not installed)

🛡 File Scope Protection

File write boundaries: Before writing any file, the extension checks whether the target path is inside one of the solution's project directories. Projects can be anywhere on disk — including in a parent directory of the solution folder.

Exception: Any .md file anywhere in the solution directory tree (at any nesting level) is allowed (documentation is dynamic and should be editable by Claude).

If the target file is outside the solution and not a .md file, an approval bubble appears in chat:

  • ✅ Allow — proceed with this file operation
  • ❌ Refuse — cancel; the file is not touched

This applies to: ✏ Ask to edit, the Fix & Build loop, and any auto-accepted edits.

Context scope: When building file lists for Claude's context, only files within project directories are included. .md files (even in project subdirectories), NuGet packages, external references, and analyzer files are automatically filtered out — ensuring Claude only sees your project code, not documentation or framework dependencies.


🔒 Command Security

Every background command passes through CommandGuard before execution.

Tier 1 — Whitelisted (silent) Default: dotnet, msbuild, nuget, git, npm, yarn, pnpm, node, tsc, webpack, cake, fake, nuke

Tier 2 — Needs approval (approval bubble in chat) Unknown executables show a yellow bubble with the exact command and shell. Three buttons:

  • ✅ Accept — run once, prompt again next time
  • ✅ Accept & save to whitelist — run and add the executable to the whitelist permanently (disabled when no solution is loaded)
  • ❌ Refuse — block and cancel the current operation

Tier 3 — Hard-blocked (no override possible)

  • Filesystem: format, del /s /f /q, rd /s /q, rmdir /s /q, Remove-Item -Recurse, rm -r
  • Registry: reg delete/add/import/export, Remove-ItemProperty, Set-ItemProperty HKLM
  • Disk: diskpart, cipher /w
  • System: shutdown, Restart-Computer, Stop-Computer
  • Users: net user, net localgroup, Add-LocalGroup, New-LocalUser
  • Obfuscated PS: -EncodedCommand, Invoke-Expression(, iex(, DownloadString
  • Persistence: schtasks /create, New-ScheduledTask
  • Firewall: netsh firewall/advfirewall/interface, Set-NetFirewallProfile
  • Elevation: runas /user:administrator, Start-Process -Verb runas

🔒 Whitelist editor

  • Click the 🔒 button in the chat header
  • Lists all whitelisted executables — add, remove, or reset to defaults
  • Read-only view of all hard-blocked patterns
  • Whitelist is saved to {solutionDir}\.claude\command-whitelist.json — per-project and source-control friendly
  • Save and Reset to defaults buttons are disabled when no solution is loaded (shown with an orange warning)

Tools → Options → Claude AI

Category Setting Default
Authentication API Key (optional — auto-detected from Claude Code or ANTHROPIC_API_KEY)
Model Claude Model claude-sonnet-4-6
Inline Suggestions Enable Inline Suggestions true
Inline Suggestions Suggestion Delay (ms) 800
Chat Max Tokens 4096
Chat Enter key sends message true
Chat Show history sidebar on open false
Edit Behaviour Auto-accept edits true
Edit Behaviour Auto-accept notification true
Command Security Show security badge true
Command Security Build Shell PowerShell
Backups Enable Backups false

Header Controls (top of chat panel)

Left: | Control | What it does | |---|---| | ☰ | Toggle session history sidebar | | Session title | Rename current session |

Center (token usage display): | Display | What it shows | |---|---| | Token counter | Current session tokens / 200K (percentage). Grey < 50%, amber 50-79%, red ≥ 80%. Updates after each API response |

Right (top to bottom): | Control | What it does | |---|---| | 🔒 | Open whitelist / command security editor | | 📦 Archive | Summarize this session, save as [Archived], start fresh with context carried over | | + New | New session (current auto-saved) | | 📋 Copy | Copy entire conversation to clipboard | | 🗑 | Clear all messages in current session (with confirmation) | | ⚙ | Configure settings (token warning threshold, language) |

Toolbar Buttons (below chat)

Settings: | Button | What it does | |---|---| | Model selector | Choose Claude model (Opus, Sonnet, Haiku) | | Auto badge | Grey = show diff · Green = auto-apply edits |

Context & Editing: | Button | What it does | |---|---| | 📄 Active file | Force-attach the open file (or selected text) | | @ Mention file | Pre-fill @ to fuzzy-attach a solution file | | 📋 Output | Attach VS Output window content as context (also: type @terminal) | | 📋 Review / ✏ Edit | Review code or rewrite the active file (label changes with input) | | 🔁 Fix & Build | Compile → fix errors → recompile (up to 3×) |

Keyboard Shortcuts

Shortcut Action
Ctrl+Alt+C Open Claude chat panel
Enter Send message (when Enter key sends message is ON), or new line (when OFF)
Shift+Enter New line (when Enter key sends message is ON), or send (when OFF)
Ctrl+V (in chat input) Paste image from clipboard
Tab Accept inline suggestion
Esc Dismiss inline suggestion
Alt+\ Toggle inline suggestions on/off

Models Used

Task Model
Chat, edits, Fix & Build Configurable — default: claude-sonnet-4-20250514
Inline suggestions claude-haiku-4-5-20251001 (fast, low latency)
Smart context classification claude-haiku-4-5-20251001 (~50 tokens per message)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft