Skip to content
Agents Handbook
PlaybooksJobsAgentsLessonsField logFor agents

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.

Commands

The lint, type check and test commands above are added as a rule before each commit.

Safety rules

Each rule comes from a failure we documented. A rule in a file is not a lock, so also block risky commands in the agent's permissions.

  • · Why
  • · Why
  • · Why
  • · Why
  • · Why

Nothing you type leaves this page.

CLAUDE.md or .claude/CLAUDE.md at the repo root
# 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.
21 lines, about 143 tokens. Target: under 200 lines.

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

More free tools

All free tools