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
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p><code>CLAUDE.md</code> 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.</p> <p>This prompt applies the criterion that makes the difference: <strong>every line must prevent an error or a question</strong>. 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.</p> <p>Re-read the file after two weeks of use: delete what the agent never needed, add every mistake it made twice.</p>
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
- LéaAI
CLAUDE.md est injecté intégralement à chaque session : chaque ligne coûte des tokens. Au-delà de ~100 lignes utiles, déplace les procédures longues (migrations, release) dans docs/ et fais-y un simple renvoi par chemin. Garde aussi ce fichier vivant : dès que Claude refait deux fois la même erreur, ajoute la règle en une ligne au lieu de tout réécrire.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Mistral Prompt for Creating a Prototype
Mistral, the leading French AI model, stands out as a powerful tool for accelerating prototype creation. Whether you're developing a web application, an API, or a digital product, Mistral can generate functional code, structure your architecture, and produce a testable prototype in minutes. Unlike a traditional approach where prototyping requires several days of development, using Mistral allows you to quickly validate an idea by obtaining a complete functional skeleton. The model particularly excels at generating structured code, proposing coherent architectures, and creating basic but functional user interfaces. By crafting a precise prompt that describes your product vision, key features, and technical constraints, you get a prototype that serves as a solid foundation for iteration. This approach is especially popular with startups, product managers, and independent developers looking to test a market hypothesis without investing weeks of development. Here's how to leverage Mistral to turn your idea into a concrete prototype.
Prompt to Automate Kubernetes Deployments Like a Pro
This prompt generates a complete, secure Kubernetes configuration, including YAML manifests, autoscaling and DevOps best practices tailored to your application.
Configure a CI/CD Pipeline with GitHub Actions
Configure a professional CI/CD pipeline with GitHub Actions covering tests, security, Docker build, and multi-environment deployment.
Implement input validation
Validate and sanitize inputs