Write a project's CLAUDE.md: the brief Claude Code reads at every session
Turns your project description into a dense CLAUDE.md: commands, structure, conventions, pitfalls, off-limits areas and situations where the agent must ask before acting.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
You are a senior developer preparing a code agent (Claude Code) to join a project. Write the CLAUDE.md file placed at the root: Claude Code reads it at the start of every session, so it must contain only what a competent new developer cannot guess by reading the code.
The project:
- Name and purpose in one sentence: [PROJECT]
- Stack and versions: [LANGUAGES, FRAMEWORKS, DATABASE, TOOLS]
- Commands: install [CMD], run in dev [CMD], test [CMD], build [CMD], lint/format [CMD]
- Folder structure that matters: [3 TO 6 FOLDERS AND THEIR ROLE]
- Non-obvious conventions: [e.g. named exports, no default; commits in French; interface over type]
- Known pitfalls: [e.g. never run npm install in a worktree; migration must precede deploy]
- Off-limits areas: [FILES OR FOLDERS NOT TO MODIFY, SECRETS NEVER TO READ]
- Git workflow: [BRANCHES, PR, WHO REVIEWS]
Writing constraints:
- 60 to 120 lines maximum. Every line must prevent an error or a question. If something can be inferred from the code or the README, leave it out.
- Sections: Project · Commands · Structure · Conventions · Pitfalls · Off-limits · Git workflow · When to ask before acting.
- Imperative, verifiable wording ("run X before Y"), no generalities ("write clean code").
- The "When to ask before acting" section lists 3 to 5 precise situations (database schema, dependencies, deploy config, content deletion…).
Return the file alone, in Markdown.
Personalize this prompt with Léa · AI assistant
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
CLAUDE.md is the context file Claude Code loads automatically when a session starts in a repository. Well written, it keeps the agent from running the wrong commands, touching the wrong files or asking ten already-settled questions. Badly written — too long, too generic — it degrades results: studies on context files show noise costs more than it brings. This prompt applies the criterion that makes the difference: every line must prevent an error or a question. It enforces a length cap, stable sections and an explicit list of situations where the agent must stop and ask — that last section is what protects your database schemas and deploy configuration. Re-read the file after two weeks of use: delete what the agent never needed, add every mistake it made twice.
Use Cases
Expected Output
A 60–120-line CLAUDE.md in eight sections, with exact commands, verifiable rules and 3 to 5 “ask before acting” situations.
Frequently Asked Questions
Can Claude Code generate this file itself with /init?
Yes, but /init describes what it sees in the code — exactly what is not worth writing. This prompt starts from what you know and the code does not say: pitfalls, off-limits, workflow.
Does the same file work for Codex, Cursor or Copilot?
The content, yes. The name changes: AGENTS.md is read by several code agents (including Codex), Cursor uses its rules. You can make CLAUDE.md a symlink to AGENTS.md to maintain a single file.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
Be the first to comment on this prompt.
Glossary Terms
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Improve this prompt with the Optimizer
Analyze the prompt, strengthen the context and get a more precise version.
Claude Prompts
Structure, context and examples to get better answers from Claude.
AI prompts for web developers
Code review and debugging, keeping API keys and secrets out of the prompt.
Security, GDPR & Business Plans
ChatGPT Business, Claude Team, Gemini Workspace and Mistral Vibe compared from vendor sources: training, EU hosting and a GDPR checklist.
Similar Prompts
Task brief for Claude Code: frame a feature end to end
Brief template to delegate a complete feature to Claude Code: goal, starting point, constraints, definition of done, working rules and recap format.
Design a Secure Webhook API
Design a webhook API with event subscriptions, signed deliveries, retry limits, and a delivery log your support team can inspect.
Generate Storybook Stories for UI Components
Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.
Prompt to Master SSR and Hydration with Next.js
Diagnose server rendering and hydration issues in Next.js, choose a rendering strategy, and get TypeScript fixes with a test example.