CLAUDE.md generator and checker
Fill in your commands, rules and folders and get a short CLAUDE.md that Claude Code loads at the start of every session. Share one file with Codex and Cursor through an @AGENTS.md import, or paste your CLAUDE.md to see what to fix. It runs in your browser and stores nothing.
A CLAUDE.md for repos where only Claude Code works.
Common defaults. Edit them to match your repo.
The lint, type check and test commands above are added as a rule before each commit.
Nothing you type leaves this page.
# CLAUDE.md
Stack: TypeScript, Node.js, pnpm.
## Commands
- Install: `pnpm install`
- Dev server: `pnpm dev`
- Build: `pnpm build`
- Test: `pnpm test`
- Lint: `pnpm lint`
- Type check: `pnpm tsc --noEmit`
## Commits and pull requests
- Run `pnpm lint`, `pnpm tsc --noEmit`, `pnpm test` before you commit. Fix every failure.
## Safety
- Ask me before you deploy, publish, send a message, spend money or change anything outside this repo. Wait for a yes.
- Do not change, skip or delete a test or assertion to make a run pass. If a test looks wrong, stop and ask.
Claude Code loads it at the start of every session. Codex ignores CLAUDE.md unless you add it to project_doc_fallback_filenames.
How to use it
- 1
Pick the files you need
Choose CLAUDE.md alone if only Claude Code works on the repo. Choose AGENTS.md plus CLAUDE.md if other agents do too: the CLAUDE.md imports AGENTS.md and adds Claude-only lines below it.
- 2
Save it in the right place
Commit ./CLAUDE.md or ./.claude/CLAUDE.md for the team. Use ~/.claude/CLAUDE.md for rules you want in every project, and a gitignored CLAUDE.local.md for personal notes on one project.
- 3
Confirm Claude loaded it
Start a new session and run /context. Your file should appear under Memory files. If Claude still ignores a rule, make it more specific or block the action with a hook or a permissions rule.
Questions
Where do I put CLAUDE.md?
Put the team file at ./CLAUDE.md or ./.claude/CLAUDE.md in the repo. Put rules for all your projects in ~/.claude/CLAUDE.md. Put personal notes for one project in CLAUDE.local.md and add it to .gitignore. Claude Code loads these from your working folder and every folder above it.
How long should a CLAUDE.md be?
Anthropic's docs say to target under 200 lines per CLAUDE.md. Longer files use more context and Claude follows them less well. Move rules for one part of the code into .claude/rules/ with a paths field, and move multi-step procedures into a skill. Imports do not cut the cost, because imported files load too.
What are CLAUDE.md best practices?
Write rules Claude can check: "Use 2-space indentation" instead of "Format code properly", and "Run `npm test` before committing" instead of "Test your changes". Group rules under headings and bullets, and remove rules that contradict each other. Add a rule when Claude makes the same mistake twice.
Does Claude Code read AGENTS.md?
Yes, from v2.1.277, when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working folder or above it. If you have a CLAUDE.md, it reads only that by default. Put @AGENTS.md at the top of your CLAUDE.md, or set Project instructions in /config to claude-md-and-agents-md.
Should CLAUDE.md import AGENTS.md or be a symlink to it?
Use the @AGENTS.md import in most cases. It lets you add Claude-only lines below the import and works on Windows. A symlink (ln -s AGENTS.md CLAUDE.md) holds no extra lines, and on Windows Git can check it out as a one-line text file unless core.symlinks is on.
Why does Claude ignore my CLAUDE.md?
Claude treats CLAUDE.md as context, not as enforced config. Run /context to check the file loaded, then make the rule more specific and remove any rule that contradicts it. Rules inside block HTML comments are stripped before Claude sees them. To block an action every time, use a PreToolUse hook or permissions.deny.
Can Claude Code write a CLAUDE.md for me?
Yes. Run /init and Claude scans the codebase and writes a starting CLAUDE.md, or suggests changes if one exists. Use this page when you want to set the rules yourself, add lesson-backed safety rules, or check a file before you commit it.
Sources
Every path, key and command comes from the vendor docs below. We checked them on 2026-10-30.
Related playbooks
- Map an unfamiliar codebase into a checked architecture document before you change it
- Upgrade a framework across a repo with a coding agent and the test suite as the gate
- Turn small tracker issues into reviewed pull requests with cloud coding agents
- Triage a production error from Sentry or logs into a tested fix pull request
- Agents act before you approve, even when you told them to ask first
- Desktop and terminal agents delete files while they tidy up
- Coding agents change, skip or misreport tests to reach a green run
- Coding agents write code for old library versions or invent APIs
- An email can carry hidden instructions to the agent that reads it
More free tools
- MCP Config GeneratorWrite the MCP config file, path and install command for Claude, Codex, VS Code and Cursor.
- AGENTS.md GeneratorWrite a lean AGENTS.md for Codex, Cursor, Copilot and Claude Code, or check the one you have.
- SKILL.md ValidatorCheck a SKILL.md against the Agent Skills spec and get each fix, with the source for every rule.
- Claude Code Permissions BuilderBuild the permissions block of Claude Code's settings.json, with presets, plain rules and risk checks.
- Claude Code Cost CalculatorCompare Claude Code on the API with Pro, Max 5x and Max 20x, from your real token counts or an estimate.
- AI Agent FinderType a job and see which AI agents our sourced playbooks use for it, ranked by evidence.