# 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.

Use the tool: https://agentshandbook.com/tools/claude-md-generator (runs in the browser).

## 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

- [Claude Code: How Claude remembers your project (CLAUDE.md and AGENTS.md)](https://code.claude.com/docs/en/memory) (checked 2026-10-30)
- [AGENTS.md: a simple, open format for guiding coding agents](https://agents.md) (checked 2026-10-30)
- [Codex: Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md) (checked 2026-10-30)
- [GitHub Copilot: Adding repository custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) (checked 2026-10-30)
- [Cursor: Rules and AGENTS.md](https://cursor.com/docs/rules) (checked 2026-10-30)
- [Gemini CLI: Provide context with GEMINI.md files](https://geminicli.com/docs/cli/gemini-md) (checked 2026-10-30)

## Related playbooks

- [Map an unfamiliar codebase into a checked architecture document before you change it](https://agentshandbook.com/p/map-an-unfamiliar-codebase-before-you-change-it.md)
- [Upgrade a framework across a repo with a coding agent and the test suite as the gate](https://agentshandbook.com/p/upgrade-a-framework-across-a-repo-with-tests-as-the-gate.md)
- [Turn small tracker issues into reviewed pull requests with cloud coding agents](https://agentshandbook.com/p/turn-issues-into-pull-requests-with-cloud-agents.md)
- [Triage a production error from Sentry or logs into a tested fix pull request](https://agentshandbook.com/p/triage-production-error-into-a-fix-pr.md)

## Lessons

- [Agents act before you approve, even when you told them to ask first](https://agentshandbook.com/lessons/agents-act-before-you-approve.md)
- [Desktop and terminal agents delete files while they tidy up](https://agentshandbook.com/lessons/agents-delete-files-while-organizing.md)
- [Coding agents write code for old library versions or invent APIs](https://agentshandbook.com/lessons/coding-agents-use-outdated-library-apis.md)
- [Coding agents change, skip or misreport tests to reach a green run](https://agentshandbook.com/lessons/coding-agents-weaken-tests-to-pass.md)
- [An email can carry hidden instructions to the agent that reads it](https://agentshandbook.com/lessons/email-can-carry-instructions-to-your-agent.md)

More free tools: https://agentshandbook.com/tools.md