Claude Code for Visual Studio 2022: Setup Guide

An alternative to CoPilot for Visual Studio 2022. Takes about 10 minutes to set up.

If you’re not a fan of CoPilot but still want some AI in your editor while you’re working in Visual Studio 2022, Claude Code is worth a look. I got it running in my lab environment last week and figured I’d write up the steps, since a few of them aren’t obvious the first time through. The PATH variable bit at the end trips people up the most.

Subscription required (updated May 20, 2026): Claude Code requires a Claude Pro ($20/month) or Max subscription to connect. The free tier cannot authenticate. A community member flagged this after the guide was first published, and I missed it because I already had a Pro account. Thanks to @PPrososki for catching it.


What You’ll End Up With

Claude Code running inside Visual Studio 2022, with a chat panel docked in your IDE that can read your code, make changes across files, and actually run tasks for you instead of just autocompleting.

Two pieces are involved

  • The Visual Studio extension (the UI panel inside VS)

  • The Claude Code CLI (the engine that does the actual work, installed via PowerShell)

You need both. The extension won’t do anything useful without the CLI installed and reachable from your PATH.


Requirements

Your Machine Accounts
Windows 11 Anthropic account with Pro or Max subscription
Visual Studio 2022 (Enterprise, Professional, or Community) Admin rights to edit environment variables
PowerShell 5.1 or newer Internet access for the installer

Step 1: Install the Visual Studio Extension

  1. Open Visual Studio 2022.

  2. Go to Extensions, then Manage Extensions.

  3. Search for Claude.

  4. Install Claude Code Extension for Visual Studio.

  5. Close Visual Studio once the install completes. The extension actually finishes installing on shutdown, so this part matters.


Step 2: Install Claude Code via PowerShell

  1. Open PowerShell.

  2. Run this command:


irm https://claude.ai/install.ps1 | iex

  1. When the installer finishes, it prints a folder path and tells you to add it to your environment variables. Copy that path somewhere you can grab it in a second.


Step 3: Add Claude Code to Your PATH

  1. Press Win + R, type System Properties, and hit Enter.

  2. Click Environment Variables at the bottom of the window.

  3. In the top section (User variables), select Path and click Edit.

  4. Click New.

  5. Paste the path from Step 2.

  6. Click OK on all three dialogs to save and close.



Step 4: Verify Everything Works

  1. Open Visual Studio 2022 and follow any first run prompts the extension shows you.

  2. If the Claude panel doesn’t appear on its own, go to View, then Other Windows, then Claude.

  3. Sign in when prompted and you should be good to go.



Troubleshooting

  • Extension isn’t in View, Other Windows. Make sure Visual Studio was fully closed after the extension install. Sometimes VS needs a clean restart before the new window registers itself.

  • “claude command not found” errors in the extension. Your PATH entry didn’t take. Open a fresh PowerShell window and try claude --version. If that fails, redo Step 3 and double check you pasted the exact path the installer gave you.

  • PowerShell blocks the install script. Run PowerShell as Administrator, or allow the script for one session with Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass before running the install command.


Links


Hope this saves someone an hour of fiddling. Drop any questions or weird issues you ran into in the replies.

Hey @CaptainDumbass ,

I went through the steps in VS and got to the sign in page for Claude in VS2022 and was greeted with a message stating Claude Max or Pro is required to hit the API key. Not sure if I did something wrong or if that’s part of it?

I attached a screen shot of what popped up. Solid guide!!

1 Like

Quick note, I should have caught that in the original guide. Since I already have a Pro subscription, I didn’t run into the paywall myself and overlooked calling it out as a requirement. Thanks for flagging it so others know what to expect going in. I’ll update the guide to make the subscription requirement clear up front.

Thank you for confirming the steps worked. This is expected since it requires at a minimum the $20/month Pro subscription. The free version can’t connect, sadly. That said, the quality of the help is worth the $10 difference over what Copilot charges if you go with the paid version. Of course, this is just my experience and preference. Your mileage may vary. I just wanted to share the option for anyone who would like to use Claude. I appreciate the post and feedback.

Happy to test out the steps listed above and provide confirmation that they worked!

I have had a few other colleagues from the past suggest purchasing the Claude Pro version for $20/month stating that they have found it very beneficial so, I am going to pull the trigger and purchase it myself.

1 Like

Much appreciated. The disclaimer has been added to the post towards the top. Again I appreciate you pointing it out and sharing for all to see.

1 Like

Some security news worth flagging for anyone who followed this guide.

Microsoft’s open source GitHub repositories were breached twice in about a month. Attackers injected password-stealing malware into the code and GitHub disabled more than 70 Microsoft repositories in response. The news coverage names Azure SDKs, VS Code extensions and Claude Code among the affected tools.

Since this guide walks through setting up Claude Code in Visual Studio 2022, here is where we stand on exposure.

The setup in this guide installs Claude Code from Anthropic’s official installer at claude.ai and the extension from the Visual Studio Marketplace. Neither source is Microsoft GitHub, which is where the breach happened. Installs done through this guide came from the legitimate Anthropic source and were not part of the compromised packages.

Bottom line: no action is required for Claude Code installs done through this guide.

The broader pattern still matters. These attacks compromise trusted sources without warning. Going forward:

  • If you pull packages from Microsoft’s GitHub repos, especially Azure or AI tooling, verify you are on a current clean version
  • Watch for unexpected credential prompts from any dev tool
  • If a GitHub repo you use suddenly shows as disabled or unavailable, do not pull from mirrors or alternate sources until you know why

Reference articles: