
- Updated
Write a CLAUDE.md file for your project
CLAUDE.md is a short file Claude Code reads at the start of every session. This prompt helps you write one with your commands, folder map, style and testing rules, keeping only what is not obvious from the code.
Help me write a CLAUDE.md file for this project, so an AI coding agent works the way my team does. Project: [WHAT IT DOES] Stack: [e.g. Next.js, TypeScript, Prisma, Postgres] Commands: [HOW TO INSTALL, RUN, TEST, LINT, BUILD] Rules we follow: [e.g. no default exports, tests next to files, never edit generated code] Keep it short and specific: project overview in two lines, key commands, folder map, code style rules, testing rules, and things the agent must never do. Only include rules that are not obvious from the code. Use bullet points, not paragraphs.
Short beats long. If a rule is ignored, make it more specific instead of adding more text.
Get a better result
A short CLAUDE.md in bullet points: a two-line project overview, the commands to install, run, test and build, a folder map and the style, testing and never-do rules that the agent cannot guess from the code.
The file grows into a long manual and the agent starts to ignore parts of it.
Fix: Cut anything the agent can see in the code. Keep only rules that would cause a mistake if missing, and aim for a file you can read in one minute.
- Rules are vague, such as “write clean code”. Make each rule checkable: “run npm test before finishing”, “never edit files in /generated”, “no default exports”. A rule you cannot test is easy to ignore.
- The file is named for the wrong tool. Claude Code reads CLAUDE.md, while Cursor reads its own rules files. Check which file name your tool loads, and keep one copy of the rules so they do not drift apart.
For a repo with several packages, ask for “a short root file with shared rules, plus one very short file for each package folder with only that package’s commands and rules”. Smaller files load in the right place.
Shorten this CLAUDE.md to the rules that are not obvious from the code, turn every vague line into a rule I can test, and list the commands exactly as I would type them.
Guides that use this prompt
More chat & writing prompts
See all 465 →More like this
- Let an AI agent fix failing tests properlyClaude Code · Cursor
- Give an AI coding agent a clear task briefClaude Code · Cursor
- Understand a new codebase fastClaude · ChatGPT · Claude Code
- Do a large refactor in small safe stepsClaude Code · Cursor
- Build a small command-line toolClaude · ChatGPT · Gemini



