Torna al blog
Intelligenza Artificiale

Claude Code with C# and .NET: how I use an AI coding agent on real projects every day

Claude Code is not an assistant that suggests snippets. It's an AI agent that reads your project, opens files, runs commands and implements complete features. In this article I share how I use it daily on C# and .NET projects, from Git workflow to MCP Server creation.

The difference between an AI assistant and an AI agent

I've used AI coding tools since the first copilots appeared. For a long time I treated them as intelligent dictionaries: ask a question, receive a snippet, apply manually. Useful, but limited. Claude Code is different. It doesn't wait to be asked — it acts. It reads your repository, understands the project structure, opens the needed files, runs commands, fixes compilation errors, makes commits. It's an agent, not an assistant. This distinction changes everything about how I work.

CLAUDE.md: the file that instructs the agent about your project

The CLAUDE.md file in the project root is the most important thing you can do to work effectively with Claude Code. It's the document the agent reads to understand the project context: architecture, conventions, constraints, preferred patterns, dos and don'ts. With this file, I can ask Claude Code to 'add the endpoint to create an order' without explaining the architecture every time. The agent follows the defined conventions, creates files in the right places, and produces code consistent with the rest of the project.

FEATURES.md and TASK.md: from requirement to implementation

My workflow uses three context files working together: CLAUDE.md for stable project context (architecture, conventions), FEATURES.md for descriptions of features to implement, and TASK.md for specific operational tasks ready for the agent to execute. I write what I want to build in FEATURES.md, then specify the implementation in concrete steps in TASK.md. Claude Code reads the TASK.md and implements the steps in sequence while I review each step before proceeding.

Integrated Git workflow: commits, branches and merge conflicts

One of the first things I automated with Claude Code is the Git workflow. The agent can initialize a repository, make commits with descriptive messages generated automatically from the content of changes, create and manage feature branches, and — most usefully — resolve merge conflicts. I use the /plan command most often before important Git operations: it shows what the agent intends to do before executing, letting me confirm or correct the strategy.

Permissions and Tools: controlling what the agent can do

Claude Code has a detailed Permissions system that specifies exactly which operations it can perform: read files, write files, run shell commands, access external tools. The settings.json file in the .claude/ folder defines permissions. I can specify exact commands that are always authorized, specific MCP tools, or limit the agent to read-only operations until I've manually verified its intentions. This granularity is essential for production code.

Parametric Skills: automating repetitive tasks

Claude Code Skills are reusable workflows I can invoke with a command. I've created Skills for: generating the boilerplate of a new aggregate (entity + events + command handler + tests), adding an Entity Framework migration with automatic naming and validation, and creating a complete REST endpoint from a JSON schema. What previously required 20 minutes of copy-paste is now a single command.

MCP Server: connecting Claude Code to the outside world

The Model Context Protocol lets Claude Code communicate with external systems: databases, APIs, business tools. We build a complete MCP Server in C#: a SQL Server database with employees, a Minimal API exposing the data, and MCP Tool endpoints that Claude Code can use as instruments. Once connected, I can ask Claude Code 'who are the employees in the IT department?' and the agent queries the database directly. This opens scenarios far beyond code generation.

What has changed in how I work

After six months of daily use: time to implement a complete REST endpoint (with tests) dropped from 45 minutes to 10-15. I spend more time defining requirements and doing code review than writing boilerplate. CLAUDE.md has become the de facto architecture documentation for the project. I no longer resolve merge conflicts manually. The mechanical, repetitive parts are delegated, and I can focus on architectural decisions and product quality.

Condividi