[CS] CARLOS SEIDL PT
Articles

Claude Code with .NET, Part 1: From Setup to Skills

Part 1: install Claude Code, write the CLAUDE.md, set permissions and modes, master the ask, iterate, and confirm rhythm, and create skills.

By 6 min read
  • Claude Code
  • AI
  • .NET 10
Article cover: Claude Code with .NET, Part 1: From Setup to Skills

Five-step journey with Claude Code in .NET

The journey in five steps: install, instruct, limit, reuse, and kick off
The journey in five steps: install, instruct, limit, reuse, and kick off

People trying a coding assistant for the first time tend to jump straight to the request ("create a tasks API") and get frustrated with the result: names that don't follow the conventions, packages nobody asked for, tests that don't run. The problem is rarely the model. It doesn't know the project, doesn't know what it can run on its own, and was used as autocomplete instead of a coworker. Setup and conversation rhythm shape the quality of the result as much as the request itself.

This article walks through the complete journey with Claude Code, Anthropic's command-line agent, in a .NET 10 project: install it, write the CLAUDE.md, set permissions, master the ask, iterate, and confirm rhythm, create skills, and finally use it all to kick off a Minimal API with tests. In this series, the MCP article showed how a model reaches your tools; here we look at how the developer works with the model day to day. All the code and configuration files are in a repository and were compiled and run.

Installing Claude Code and its configuration mechanisms

Claude Code is an agent that runs in your terminal (there are also extensions for VS Code and JetBrains, and a desktop app). It reads project files, edits code, runs commands such as dotnet build and dotnet test, and repeats that cycle until the request is done. Because it acts on your repository, three decisions matter from day one: what it needs to know, what it can do on its own, and when it should ask.

Installation and login. On Windows, from PowerShell (or WinGet):

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


winget install Anthropic.ClaudeCode


claude --version

The first time you run claude, the login opens in the browser; after that, /login switches accounts. Go into the project folder before starting, because that folder defines what Claude can see.

Installation and first session: install, check, open in the folder, log in, and run /init
Installation and first session: install, check, open in the folder, log in, and run /init

The four configuration mechanisms are:

  • CLAUDE.md: text instructions that go into the context of every session. It lives in ./CLAUDE.md (or ./.claude/CLAUDE.md) for the team, in ~/.claude/CLAUDE.md for you across all projects, and in ./CLAUDE.local.md for your personal project preferences (outside git). The /init command generates a first draft from the code.
  • settings.json: permission rules and other options. It exists at ~/.claude/settings.json (user), .claude/settings.json (project, versioned), and .claude/settings.local.json (personal, outside git). The most specific level wins.
  • Permission modes: define when Claude asks. The main ones are default (asks before editing or running), acceptEdits (accepts file edits), plan (only reads and proposes a plan), and auto (a classifier reviews actions on your behalf). Shift+Tab cycles through them during the session.
  • Skills: reusable procedures, a folder with a SKILL.md, which Claude loads when the task matches the description or when you call /name.

Watch the initial mode: starting with version 2.1.283, auto mode is the initial one in interactive terminal sessions. Check the active mode in the status bar and, in a new project, start in plan or default until you trust the rules.

Where everything lives: CLAUDE.md, settings.json, skills, and modes
Where everything lives: CLAUDE.md, settings.json, skills, and modes
Permission modes, from most control (plan) to most autonomy (auto)
Permission modes, from most control (plan) to most autonomy (auto)

CLAUDE.md can import other files with @path, which avoids duplicating text:

Markdown
Overview and how to run: @README.md

Permission rules have the format Tool(pattern), evaluated in the order deny, ask, allow; the first one that matches decides. A space before the trailing * matters: Bash(dotnet test *) matches dotnet test and dotnet test --no-build, but not dotnet testx.

Permissions: deny, ask, and allow evaluated in this order, with examples from the project
Permissions: deny, ask, and allow evaluated in this order, with examples from the project

The ask, plan and iterate cycle in Claude Code, with skills

The approach is a cycle with confirmation gates. You ask, Claude plans and executes, you review, and only then do you record the result.

The ask, iterate, and confirm cycle, with the human confirmation points
The ask, iterate, and confirm cycle, with the human confirmation points

Ask. A good request has a goal, constraints, and a definition of done. Compare:

Text
Before: create a tasks API





After:  Create a tasks Minimal API in .NET 10 with an in-memory


        list (create, get, list, complete). No database and no


        extra packages. Done when dotnet build and dotnet test


        pass.

Plan. For changes that touch several files, start in plan mode. Claude reads the code, proposes the plan, and edits nothing until you approve:

Bash
claude --permission-mode plan

In the session, /plan and Shift+Tab enter this mode. When it's done, Claude presents the plan with three options: approve and continue in auto mode, approve and review each edit, or keep planning with your adjustments. Ctrl+G opens the plan in your editor so you can change it before approving.

Execute and review. Once the plan is approved, Claude edits and runs dotnet build and dotnet test. The allow rules in settings.json avoid interruptions on safe commands; the ask rules keep the gate on git commit and git push.

Iterate. Ask for one adjustment at a time, in writing, instead of redoing the whole request. Esc interrupts an action in progress, /rewind takes the conversation and code back to an earlier point, and /clear starts a fresh conversation, which is worth doing when you switch tasks. When the conversation gets long, /compact summarizes the history.

Reuse. When you repeat the same routine, turn it into a skill. The structure is one folder and one file:

Text
.claude/skills/


  novo-endpoint/


    SKILL.md          instructions (required)


  pronto-para-commit/


    SKILL.md

The SKILL.md has a YAML header (name, description, and optionally argument-hint, allowed-tools, disable-model-invocation) followed by the instructions. The description is what Claude reads to decide when to use the skill.

Anatomy of a skill: YAML header and SKILL.md instructions
Anatomy of a skill: YAML header and SKILL.md instructions

Next step. With the CLAUDE.md, the settings.json, the permission modes, and the skills in place, all that's left is to put it all to use. In Part 2 this setup goes to work in the kickoff of a Minimal API in .NET 10 with tests, from the repository to the commit.

Part 1 references: Claude Code docs and repository

Want to bring AI and Claude Code into your .NET team workflow? See the backend and .NET architecture service.

← all articles