Modern AI coding assistants are great, if you're in a modern editor. But I have a soft spot for old tooling, and I wanted to know: could I bring Claude Code into Visual Studio 2005, a 20-year-old IDE?

The add-in model

VS2005 predates the modern VSIX system. It uses the old COM add-in model: a .AddIn XML manifest pointing at an assembly that implements IDTExtensibility2. Drop the manifest in the Addins folder under your Visual Studio documents directory and the IDE picks it up at startup.

IDTExtensibility2 is five methods, and OnConnection is the one that matters. It hands you the DTE automation object, which is the root of everything: the solution, the open documents, the output window, the command bars. Cast it to DTE2 from the EnvDTE80 interop assembly to get the parts added after 2003.

Wiring up a command is a two-step dance that is easy to get wrong. You register the command once with Commands2.AddNamedCommand2, guarded so a reinstall doesn't throw on the duplicate, and you implement IDTCommandTarget for it. That interface has two halves: QueryStatus, which the IDE polls constantly to decide whether your menu item should be greyed out, and Exec, which actually runs it. Return the wrong status flags from QueryStatus and your command is permanently disabled with no error anywhere.

Tool windows go through Windows2.CreateToolWindow2, which hosts a .NET UserControl through an ActiveX shim and wants a GUID you generate yourself.

Bridging to Claude Code

From there it's a bridge: capture the current file or selection, shuttle it out to Claude Code, and write the response back into the editor or a tool window.

Reading and writing the buffer is the pleasant part. DTE.ActiveDocument.Selection gives you a TextSelection you can read from and insert into, and edits made through it land in the IDE's undo stack, so the user can back out an unwanted change with Ctrl+Z like any other edit. Wrapping a batch of insertions in an UndoContext makes the whole response a single undo step.

The transport is where the age of the platform bites. This add-in runs on the .NET 2.0 CLR, and .NET 2.0 negotiates TLS through the Windows crypto stack of its era, which tops out well below what any current HTTPS endpoint will accept. Calling a modern API directly from inside the IDE fails at the handshake, before you get anywhere near authentication. So the add-in doesn't try: it launches the Claude Code CLI as a child process and talks to it over stdin and stdout, which sidesteps the entire problem and keeps credentials out of a twenty-year-old process. Redirect both streams, read asynchronously so you don't deadlock on a full pipe buffer, and marshal back to the UI thread before touching the DTE, because the automation model is single-threaded apartment and will punish you for forgetting.

The AI is the easy part. The hard part is coaxing a 2005-era extensibility API into doing something it was never designed for.

It's gloriously cursed, and it works: AI-assisted coding inside an IDE older than some of my coworkers.

Source is on GitLab if you want to see how the pieces fit together.