Claude Code para desarrolladores .NET: De cero a productivo en VS Code y Visual Studio
Claude Code for .NET Developers: From Zero to Productive in VS Code and Visual Studio
Claude Code para desarrolladores .NET: De cero a productivo en VS Code y Visual Studio
AI tools feel magical during the first few days. You ask something, it answers correctly, and you think: “this is going to change everything.” Then, a few weeks pass, the context gets muddled, the answers become generic, and you start feeling like you’re having a conversation with someone who has selective amnesia. The problem isn’t the AI. The problem is that no one explained how it actually works. This article demystifies Claude Code for .NET developers. It’s not a “look how cool this is” tutorial—it’s a practical guide on how it works, why it works that way, and how to get the most out of it in real C# projects, both in VS Code and Visual Studio 2022/2026.
Las herramientas de IA se sienten mágicas los primeros días. Le preguntas algo, te responde bien, y piensas: “esto va a cambiar todo”. Luego pasan unas semanas, el contexto se confunde, las respuestas se vuelven genéricas, y empiezas a sentir que estás teniendo una conversación con alguien que tiene amnesia selectiva. El problema no es la IA. El problema es que nadie te explicó cómo funciona realmente. Este artículo desmitifica Claude Code para desarrolladores .NET. No es un tutorial de “mira qué cool es esto” — es una guía práctica de cómo funciona, por qué funciona así, y cómo sacarle el máximo provecho en proyectos C# reales, tanto en VS Code como en Visual Studio 2022/2026.
What Claude Code is (and what it isn’t)
Qué es Claude Code (y qué no es)
Claude Code is not a glorified chat window. It is a CLI (Command Line Interface) that runs directly in your terminal and has real access to your file system; it can execute commands, read and edit files, and maintain context about your project. The difference from “asking Claude in the browser” is huge: In the browser, you paste code manually, lose context between sessions, and Claude knows nothing about your project beyond what you tell it. With Claude Code, Claude lives in your repository. It reads files, executes dotnet build, runs your tests, and understands your solution’s architecture. Besides the CLI, there is an extension for VS Code that integrates Claude Code directly into the editor—with automatic context of what you have open and selected. For Visual Studio, the story is different (and we will tell it honestly later).
Claude Code no es una ventana de chat glorificada. Es una CLI (interfaz de línea de comandos) que corre directamente en tu terminal y tiene acceso real a tu sistema de archivos, puede ejecutar comandos, leer y editar archivos, y mantener contexto sobre tu proyecto. La diferencia con “preguntarle a Claude en el navegador” es enorme: En el navegador, pegas código manualmente, pierdes contexto entre sesiones, y Claude no sabe nada de tu proyecto más allá de lo que tú le dices. Con Claude Code, Claude vive en tu repositorio. Lee archivos, ejecuta dotnet build, corre tus tests, y entiende la arquitectura de tu solución. Además de la CLI, existe una extensión para VS Code que integra Claude Code directamente en el editor — con contexto automático de lo que tienes abierto y seleccionado. Para Visual Studio, la historia es diferente (y la contaremos honestamente más adelante).
Installation and Setup
Instalación y setup
Prerequisites:
- Node.js 22 LTS or higher
- A claude.ai account with access to Claude Code
Install the CLI:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
To start an interactive session in your project, navigate to the root directory and run:
claude
Prerrequisitos:
- Node.js 22 LTS o superior
- Una cuenta en claude.ai con acceso a Claude Code
Instalar la CLI:
npm install -g @anthropic-ai/claude-code
Verifica la instalación:
claude --version
Para iniciar una sesión interactiva en tu proyecto, navega al directorio raíz y ejecuta:
claude
VS Code — Full Integration
VS Code — integración completa
Install the official extension from the Marketplace:
- Name: Claude Code
- ID:
anthropic.claude-code - Requires VS Code 1.98 or higher
Once installed, Claude Code appears in the sidebar. The integration is deep: when you have a file open or code selected, Claude receives it automatically as context. You don’t need to copy and paste anything. JetBrains Rider also has full integration through its official plugin—if your team uses Rider, the workflow is very similar to VS Code.
Instala la extensión oficial desde el Marketplace:
- Nombre: Claude Code
- ID:
anthropic.claude-code - Requiere VS Code 1.98 o superior
Una vez instalada, Claude Code aparece en la barra lateral. La integración es profunda: cuando tienes un archivo abierto o código seleccionado, Claude lo recibe automáticamente como contexto. No necesitas copiar y pegar nada. JetBrains Rider también cuenta con integración completa a través de su plugin oficial — si tu equipo usa Rider, el workflow es muy similar al de VS Code.
Visual Studio 2022/2026 — The blunt truth
Visual Studio 2022/2026 — la verdad sin rodeos
Visual Studio has been the king of .NET development for decades. It just hasn’t realized that Claude exists yet. As of June 2026, there is no official Claude Code extension for Visual Studio. Period. There is no magical workaround that changes that. What does work, and works well, is using the Visual Studio integrated terminal:
- Go to View > Terminal (or
Ctrl+\, `Ctrl+“) - Navigate to your solution’s root directory (you are usually already there)
- Run
claude
Claude reads your repository exactly the same way as in VS Code. The difference is that you don’t have the automatic visual context—you will have to mention files explicitly with @ (we will see this in detail later). For many refactoring, code generation, and architecture review tasks, the terminal is more than enough. Many .NET developers have both IDEs open in parallel: Visual Studio for advanced debugging, form designers, and profiling tools; VS Code for working with Claude Code.
Visual Studio ha sido el rey del desarrollo .NET por décadas. Simplemente aún no se ha enterado de que existe Claude. A junio de 2026, no existe una extensión oficial de Claude Code para Visual Studio. Punto. No hay workaround mágico que cambie eso. Lo que sí funciona, y funciona bien, es usar la terminal integrada de Visual Studio:
- Ve a Ver > Terminal (o
Ctrl+\, `Ctrl+“) - Navega al directorio raíz de tu solución (normalmente ya estás ahí)
- Ejecuta
claude
Claude lee tu repositorio exactamente igual que en VS Code. La diferencia es que no tienes el contexto visual automático — tendrás que mencionar archivos explícitamente con @ (lo veremos en detalle más adelante). Para muchas tareas de refactoring, generación de código y revisión de arquitectura, la terminal es más que suficiente. Muchos desarrolladores .NET tienen ambos IDEs abiertos en paralelo: Visual Studio para debugging avanzado, diseñadores de formularios, y herramientas de profiling; VS Code para trabajar con Claude Code.
CLAUDE.md — The brain of the operation
CLAUDE.md — el cerebro de la operación
Here is the most important insight of the article, so read it slowly. Claude Code does not work like a chatbot with persistent memory. Every time you start a session, it starts from scratch. So, how does it “know” your project? Through a file called CLAUDE.md.
Aquí está el insight más importante del artículo, so léelo despacio. Claude Code no funciona como un chatbot con memoria persistente. Cada vez que inicias una sesión, parte de cero. Entonces, ¿cómo “conoce” tu proyecto? A través de un archivo llamado CLAUDE.md.
How Claude discovers CLAUDE.md
When you run claude from a directory, Claude performs a filesystem traversal upwards from your current working directory (CWD), looking for CLAUDE.md files. Additionally, it loads CLAUDE.md from subdirectories lazily as it accesses them. This means two important things:
- It is not based on project files—Claude does not read your
.csprojto discoverCLAUDE.md. It discovers it by location in the filesystem. - If your
CLAUDE.mdis in the repo root and you runclaudefrom there, it loads. If you run it from a subdirectory, it will also load it (because it traverses upwards).
Cómo Claude descubre CLAUDE.md
Cuando ejecutas claude desde un directorio, Claude realiza un recorrido del filesystem hacia arriba desde tu directorio de trabajo actual (CWD), buscando archivos CLAUDE.md. Además, carga CLAUDE.md de los subdirectorios de forma lazy a medida que accede a ellos. Esto significa dos cosas importantes:
- No está basado en archivos de proyecto — Claude no lee tu
.csprojpara descubrirCLAUDE.md. Lo descubre por ubicación en el filesystem. - Si tu
CLAUDE.mdestá en la raíz del repo y ejecutasclaudedesde ahí, se carga. Si lo ejecutas desde un subdirectorio, también lo cargará (porque sube hacia arriba).
In Visual Studio, CLAUDE.md does not appear in the Solution Explorer—because it is not referenced in any .csproj. But Claude does load it. You don’t need to add it to the project. In fact, it’s better if you don’t—it’s a context file for the AI, not a resource of your application.
En Visual Studio, CLAUDE.md no aparece en el Explorador de Soluciones — porque no está referenciado en ningún .csproj. Pero Claude sí lo carga. No necesitas agregarlo al proyecto. De hecho, es mejor que no lo hagas — es un archivo de contexto para la IA, no un recurso de tu aplicación.
Verify what is loaded
You can verify at any time which CLAUDE.md files Claude has loaded with the command:
/memory
This shows the current memory content, including all active CLAUDE.md files in the session.
Verificar qué está cargado
Puedes verificar en cualquier momento qué archivos CLAUDE.md tiene cargados Claude con el comando:
/memory
Esto muestra el contenido actual de memoria, incluyendo todos los CLAUDE.md activos en la sesión.
Generate an initial CLAUDE.md
If your project doesn’t have a CLAUDE.md, Claude can generate it by reading the repo:
/init
This analyzes your code, folder structure, and configuration files, and produces a base CLAUDE.md that you can refine.
Generar un CLAUDE.md inicial
Si tu proyecto no tiene CLAUDE.md, Claude puede generarlo leyendo el repo:
/init
Esto analiza tu código, estructura de carpetas, y archivos de configuración, y produce un CLAUDE.md base que puedes refinar.
Practical Example: CLAUDE.md for a .NET project
Ejemplo práctico: CLAUDE.md para un proyecto .NET
Here is a complete and realistic example for a .NET 10 e-commerce API:
Aquí un ejemplo completo y realista para una API de e-commerce en .NET 10:
# ECommerceApi — Contexto para Claude Code
## Descripción del proyecto
API REST para gestión de catálogo y órdenes de compra.
Stack: .NET 10, C# 14, Entity Framework Core 9, PostgreSQL, MassTransit (RabbitMQ).
Arquitectura: Clean Architecture con CQRS via MediatR.
## Comandos esenciales
### Build y tests
dotnet build ECommerceApi.sln
dotnet test ECommerceApi.sln --logger "console;verbosity=normal"
dotnet test --filter "Category=Unit"
dotnet test --filter "Category=Integration"
### Migraciones EF Core
cd src/ECommerceApi.Infrastructure
dotnet ef migrations add <NombreMigracion> --startup-project ../ECommerceApi.Api