← CLAUDE.md
Claude Code CLAUDE.md template Free

ASP.NET Core Project Free Claude Code CLAUDE.md template, copy & paste

A CLAUDE.md for an ASP.NET Core app: build and test commands, project layout, EF Core rules and the traps.

WHEN TO USE IT

When you start using Claude Code on a .NET web project and want it to build, test and migrate the way your team does.

Lives in ./CLAUDE.md for the project, ~/.claude/CLAUDE.md for you, CLAUDE.local.md for private notes.
Checked

Formats change. If a field stops working, check it against Anthropic's documentation.

CLAUDE.md

Replace the bracketed parts. Keep the 'Do not' section even if it feels obvious — those are the lines that save the most time.

# [Project name]

[One sentence: what this application does and who uses it.]

## Commands
- Build: `dotnet build`
- Run: `dotnet run --project src/[App]` → http://localhost:5000
- Test: `dotnet test` (all tests must pass before a change is done)
- Format: `dotnet format`
- New migration: `dotnet ef migrations add <Name> --project src/[App].Data`

## Layout
- `src/[App]` — web host, controllers / Razor Pages
- `src/[App].Domain` — entities and business rules, no EF references
- `src/[App].Data` — DbContext, migrations, repositories
- `tests/` — xUnit; integration tests use WebApplicationFactory

## Conventions
- Nullable reference types are on; fix warnings, do not suppress them
- Async all the way: no `.Result` or `.Wait()`
- Options classes bound with `ValidateOnStart()`
- Every new endpoint gets an integration test

## Do not
- Edit files under `Migrations/` by hand — add a new migration instead
- Put secrets in appsettings.json — use user secrets or environment variables
- Add a NuGet package without saying why in the summary
Where it goes

The project root. Commit it — it is as much documentation for the next person as it is for Claude.

mv CLAUDE.md ./CLAUDE.md
git add CLAUDE.md

# or let Claude draft one from the codebase, then edit it:
#   /init

MORE CLAUDE.MD

The authority

Anthropic's documentation for CLAUDE.md

This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.

Read the docs ↗

https://code.claude.com/docs/en/memory

New drops, every week

Free tools & Claude templates, landing regularly.

We keep shipping new free tools, code recipes and Claude Code templates. Follow @freeyantra on Instagram or join the newsletter so you never miss one.

Follow @freeyantra

or get them by email

Double opt-in. Unsubscribe any time. Privacy