CLAUDE.md file builder
Pick your stack, set your commands, tick your rules. Copy a CLAUDE.md Claude Code actually follows.
Runs in your browser. Nothing is sent anywhere.
1 · Your stack
Pick the closest one. It fills in commands and conventions you can change.
2 · The project
3 · Commands
Exact commands, so the agent doesn’t guess. Leave a line empty to skip it.
4 · How to work
5 · Never
Agents treat these files as guidance, not locks. To block a command for sure, use permissions or a hook: Claude Code hooks →
Your file
# Project A Next.js app in TypeScript, using the App Router and pnpm. ## Commands - Install: `pnpm install` - Run locally: `pnpm dev` - Test: `pnpm test` - One test: `pnpm test -- path/to/file.test.ts` - Lint: `pnpm lint` - Type check: `pnpm tsc --noEmit` - Build: `pnpm build` ## Layout - `app/`: routes and pages - `components/`: React components - `lib/`: shared code, no React - `public/`: static files ## How to work - TypeScript strict mode. No `any`; use `unknown` and narrow it. - Server Components by default. Add "use client" only for state, effects or browser APIs. - Use pnpm, never npm or yarn. - Match the style of the code around you: naming, comments, file layout. - Keep changes small and focused on the task. Don't refactor what you weren't asked to. - Add or update a test for every behavior you change. - Before you say you’re done, run `pnpm test` and `pnpm lint`, and fix what fails. ## Never - Never commit secrets, `.env` files or API keys. - Never run `git push --force`, `git reset --hard` or delete a branch without asking. - Never edit generated files or lockfiles by hand. - Never delete, skip or weaken a test to make it pass.
Save it at the root of your repo. Claude Code reads it at the start of every session.
A link shares your stack and the boxes you ticked. What you type stays on this page.
CLAUDE.md best practices
Keep it under 200 lines.
Anthropic’s own target. Longer files use more context and are followed less.
Write rules you can check.
“Run pnpm test before committing”, not “test your changes”.
Put in what the agent can’t guess.
Exact commands, where things live, what never to touch. Skip what the code already says.
One topic per rule, no contradictions.
If two rules disagree, Claude may pick either one.
Move the rest out.
Rules for one folder go in .claude/rules/ with a paths list. Long procedures go in a skill.
From Anthropic’s memory docs, November 2026.
Questions
What is a CLAUDE.md file?
A Markdown file Claude Code reads at the start of every session: your project’s commands, layout and rules. You write it; Claude treats it as context, not as locks.
Where does CLAUDE.md go?
At the root of your repo, as CLAUDE.md or .claude/CLAUDE.md, shared through git. Your own rules for every project go in ~/.claude/CLAUDE.md. Personal notes for one project go in CLAUDE.local.md, added to .gitignore.
How long should CLAUDE.md be?
Under 200 lines per file, per Anthropic. Imports with @path keep the file tidy but don’t save context: imported files load with it.
Does Claude Code read AGENTS.md?
Yes, since v2.1.277, when there’s no CLAUDE.md or CLAUDE.local.md in your folder or above it. To use one file for every agent, keep AGENTS.md and add a CLAUDE.md that says @AGENTS.md.
How do I make a CLAUDE.md automatically?
Run /init in Claude Code. It reads your code and writes a starting file, or suggests changes to the one you have. Then add what it can’t find: the rules only your team knows.
Why does Claude ignore my CLAUDE.md?
Usually it’s too long, vague, or contradicts itself. Run /doctor prompt-audit to find stale or conflicting lines. To block something for sure, use permissions or a PreToolUse hook.
Coral isn’t affiliated with Anthropic.