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
Answer 3 questions and Léa tailors the prompt to your situation.
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
Be the first to comment on this prompt.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Master Git Reset, Rebase, and Cherry-Pick
Master advanced Git commands (reset, rebase, cherry-pick, stash) with clear diagrams and practical scenarios.
Implement Kubernetes network policies
Secure Kubernetes networking
Perplexity Prompt for Generating JavaScript Code
Perplexity stands out from other AI assistants by its unique ability to combine real-time web search and code generation. When you ask it to produce JavaScript code, it doesn't just rely on static knowledge: it consults official documentation, recent GitHub repositories, and current technical discussions to provide you with up-to-date and functional code. This approach is especially valuable in JavaScript, an ecosystem where best practices, browser APIs, and conventions evolve rapidly. Where a classic LLM might suggest outdated syntax or a deprecated method, Perplexity checks its sources and cites the references used. Whether you need a React component, a Node.js utility function, or a vanilla DOM manipulation, crafting a structured prompt with the right technical context ensures a result that is immediately usable. This guide shows you how to get the most out of Perplexity for your JavaScript code generation needs, from simple scripts to complete modular architectures.
Copy Variations for Different Brand Tones
Brand voice testing, A/B tests