CLAUDE.md, AGENTS.md and Cursor Rules Generator

Coding agents read a plain Markdown instructions file at the start of each session: CLAUDE.md for Claude Code, AGENTS.md for most other agents, and .mdc rule files in .cursor/rules for Cursor. Choose your framework, package manager and test command, get a short file in any of the three formats, then check it for bloat.

Three instruction files compared (as of October 2026)
FileWhere it livesFront matterSize advice
CLAUDE.md./CLAUDE.md or ./.claude/CLAUDE.mdNoneUnder 200 lines
AGENTS.mdRepository root, plus nested foldersNoneNo limit stated
Cursor rule.cursor/rules/<name>.mdcdescription, globs, alwaysApplyUnder 500 lines

Updated

Most instruction files fail the same way: they grow. Every incident adds a rule, nobody removes one, and the agent ends up reading three hundred lines of advice where the build command is buried on line 140. This generator starts you from the facts an agent cannot guess (commands, stack, folders, hard rules) and the checker points at the lines that cost context without changing behaviour.

Generate an instructions file

Built in this tab. Nothing you type is uploaded.

Check an instructions file

Paste a CLAUDE.md, AGENTS.md or .mdc rule. The format is detected; change it if the guess is wrong.

One file for every agent

Keep the shared instructions in AGENTS.md and let Claude Code import them, so the two never drift apart.

CLAUDE.md that imports AGENTS.md

The @ line pulls the whole file in at launch. Claude-only notes go underneath.

@AGENTS.md

## Claude Code only
- Use plan mode for changes that touch more than three files.

A Cursor rule scoped to test files

Saved as .cursor/rules/tests.mdc. It loads only when a matching file is in context.

---
description: Conventions for unit tests
globs: **/*.test.ts,**/*.test.tsx
alwaysApply: false
---

- Use Vitest and Testing Library.
- One behaviour per test; name it after what the user sees.

What belongs in an instructions file

Facts the agent cannot infer quickly and that change its actions: the exact commands to run, where the main code lives, which folders are generated and must not be edited, and the few conventions your team enforces in review.

What does not belong: general coding advice, long architecture essays, and anything already enforced by a linter or type checker. Those rules are either followed anyway or better expressed as a tool the agent runs.

How the checker scores a file

It counts lines against the documented size advice for the detected format, finds exact duplicate lines, and flags phrases that sound like rules but give the agent nothing to act on, such as 'follow best practices' or 'be careful'.

For Cursor rules it also reads the front matter: unknown keys, an alwaysApply value that is not true or false, and globs that will be ignored because alwaysApply is on.

How it works

  1. Pick the output format: CLAUDE.md, AGENTS.md or a Cursor rule.
  2. Choose your framework and package manager. The dev, build, test and lint commands fill in for you; edit any that differ.
  3. Add a one-line project summary and the few rules that really matter, one per line.
  4. Copy or download the file, or paste an existing file into the checker to find bloat, vague rules and repeats.

Tips

  • Write commands, not principles. 'Run pnpm test before committing' changes behaviour; 'write good tests' does not.
  • Delete any rule the agent already follows without being told. Each line costs context in every session.
  • Move rules that only apply to one folder into a nested AGENTS.md, a .claude/rules file with paths, or a Cursor rule with globs.
  • If you use both Claude Code and other agents, keep the shared content in AGENTS.md and import it from CLAUDE.md with @AGENTS.md.

Frequently asked questions

Where does Claude Code look for CLAUDE.md?

The project file can be ./CLAUDE.md or ./.claude/CLAUDE.md. Personal instructions go in ~/.claude/CLAUDE.md, and private project notes in ./CLAUDE.local.md, which you should add to .gitignore. Files in parent folders load at launch; files in subfolders load when Claude works there.

Does Claude Code read AGENTS.md?

Yes, from recent versions. It reads AGENTS.md when there is no CLAUDE.md in the working folder or above it. If both exist it reads CLAUDE.md only, unless your CLAUDE.md imports AGENTS.md with an @AGENTS.md line.

Does AGENTS.md need front matter or required sections?

No. It is plain Markdown with any headings you like. The agents.md site suggests a project overview, build and test commands, code style, testing instructions and security notes, and says the nearest file to the edited code takes precedence.

What front matter does a Cursor .mdc rule use?

Three fields: description, globs and alwaysApply. alwaysApply: true loads the rule every time; a description with no globs lets the agent decide; globs attach it to matching files; neither field means it loads only when you mention it.

How long should CLAUDE.md be?

The Claude Code docs suggest under 200 lines per file, because longer files use more context and reduce how well instructions are followed. The checker on this page warns past that line count.

Related: Claude skills builder, Claude Code settings generator, App spec template, React with TypeScript, Next.js vs React, We.Inc with Cursor and VS Code.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

Product

Who It's For

Features

Resources

Company

View Sitemap