Free tool

AGENTS.md & CLAUDE.md generator

Answer a few questions, get a clean, best-practice context file — commands, conventions, project map, and boundaries your coding agents will actually follow. Runs entirely in your browser.

By Kylian Migot · Updated July 2026 · 5 min read

Output format

Claude Code loads CLAUDE.md from the repo root automatically at session start.

Stack
Commands

Leave a command empty to drop it from the file.

One rule per line (or separate with semicolons).

One directory per line, e.g. "src/app — routes".

Paths and areas the agent must never touch without asking.

Optional sections
Your CLAUDE.md
61 lines · save it at the repo root
# my-app

Customer dashboard built with Next.js App Router, Postgres, and Stripe.

**Stack:** Next.js / React · Node / TypeScript

## Commands

```bash
npm install        # install dependencies
npm run dev        # start the dev server
npm test           # run the test suite
npm run lint       # lint
npx tsc --noEmit   # typecheck
```

Run lint and typecheck before finishing any task — CI runs the same
checks, and a red pipeline costs a full review cycle.

## Conventions

- Prefer server components
- Tailwind for styling
- No default exports

When a case is not covered here, match the surrounding code —
consistency beats personal preference.

## Project map

- `src/app` — routes
- `src/lib` — domain logic
- `src/components` — shared UI

New code goes where its neighbors live. Ask before adding a new
top-level directory.

## Boundaries

Hard limits. Stop and ask a human before crossing any of these.

- Never edit src/generated/**
- Don't touch billing code without asking

## Testing

- Behavior changes ship with a test that fails without the change.
- Run `npm test` before finishing; fix any failure you caused.
- Never delete, skip, or weaken a failing test to get to green.

## Git workflow

- Branch from `main`: `feat/<short-name>` or `fix/<short-name>`.
- Keep commits small and imperative ("Add invoice export", not "changes").
- One concern per PR — leave unrelated refactors out of the diff.

## When unsure

If a task is ambiguous, crosses a boundary above, or needs a new
dependency or schema change, stop and ask instead of guessing. A short
question is cheaper than a wrong PR.
01

What AGENTS.md and CLAUDE.md actually are

A context file is the standing brief a coding agent reads before it touches your repo. CLAUDE.md is Claude Code's convention: the CLI loads it automatically at the start of every session, from the repo root and from directories it works in. AGENTS.md is the newer cross-agent convention — one file, adopted by Codex CLI, Cursor, and a growing list of tools, so you don't maintain a separate rules file per agent.

Either way, the job is the same: replace the twenty things you'd otherwise repeat in every prompt — how to run tests, which patterns the codebase uses, what never to touch — with one committed file. It is the cheapest piece of infrastructure in an agentic development setup, and one of the highest-leverage.

FileRead byBest when
CLAUDE.mdClaude Code, at session startYou work primarily in Claude Code
AGENTS.mdCodex CLI, Cursor, and other adopting toolsYou mix tools — keep one source of truth
BothCLAUDE.md contains a single line: @AGENTS.mdOne file, every agent reads it
02

What belongs in one — and what doesn't

The test for every line: would the agent do something wrong without it? If yes, it stays. If the agent could discover it by reading code, or it's only true this sprint, it goes. Four kinds of content pass that test reliably:

Commands

Exact install, dev, test, lint, and typecheck commands in a fenced block. Agents guess these otherwise — and guess wrong across package managers.

Conventions

Short imperative rules the code can't teach on its own: “no default exports”, “prefer server components”, “errors go through lib/errors”.

Project map

Five to ten lines of directory-to-purpose mapping, so new code lands next to its neighbors instead of in a fresh utils/ folder.

Boundaries

Explicit no-go zones: generated code, migrations, billing, auth. The one section where being blunt beats being polite.

What doesn't belong: long architecture prose (agents read code faster than essays), anything already stale, aspirational rules nobody follows, and — ever — secrets or credentials. The file is committed and fed verbatim into model context; treat it as public. Per-task detail doesn't belong either: that lives in a spec, which is what the agent spec builder is for.

03

The #1 mistake: write it once, let it rot

Most context files are written in an enthusiastic afternoon and never touched again. Six months later the test command has changed, the "new" directory structure is old, and the agent is confidently following instructions that are wrong. A stale context file is worse than none — the agent has no way to know which lines to distrust.

The fix is to treat the file like code. When a PR changes a command, a convention, or the directory layout, the same PR updates AGENTS.md — and reviewers check for it, the way they check for updated tests. Some teams add a checklist item; the discipline is the same one that makes spec-driven development work: written artifacts only pay off while they're true.

04

Per-directory files and imports

One root file doesn't scale to a monorepo. The convention that works: keep the root file short and global — commands, universal conventions, boundaries — and add a small CLAUDE.md or AGENTS.md inside each package with rules that only apply there. Claude Code reads nested files as it works in those directories, so an agent editing packages/api sees the API rules without paying for the frontend's.

CLAUDE.md also supports explicit imports: a line like @docs/testing.md pulls another file into context. That's how the one-line @AGENTS.md bridge works, and it keeps any single file under the ~120-line budget. If terms like context window or MCP are fuzzy, the AI glossary covers the vocabulary these files keep bumping into.

FAQ

What's the difference between AGENTS.md and CLAUDE.md?
Mostly the reader. CLAUDE.md is Claude Code's own convention — it loads the file automatically at session start. AGENTS.md is the emerging cross-tool convention read by Codex CLI, Cursor, and a growing list of agents. The useful content is identical: commands, conventions, a project map, and boundaries. If you use several tools, keep AGENTS.md as the single source and make CLAUDE.md a one-line file containing @AGENTS.md so Claude Code imports it.
Where do I put the file?
At the repository root, committed to git. Claude Code reads CLAUDE.md from the root (and from parent and child directories as it works), and most AGENTS.md-aware tools look in the root first. In a monorepo, keep a short root file plus a small per-package file next to the code it describes.
How long should a CLAUDE.md or AGENTS.md be?
Short — roughly 60 to 120 lines. The file is prepended to every session, so every line spends context-window budget on every task. Keep commands, hard rules, and boundaries; cut history, architecture essays, and anything the agent can discover by reading code. If a section only matters in one directory, move it to a nested file there.
Does this work with Cursor and other tools?
Yes. AGENTS.md is supported by Codex CLI, Cursor, and other agents that have adopted the convention, and the generated markdown is plain enough that any tool with a rules or context mechanism can consume it. For tools with their own format (like Cursor's .cursor/rules), you can point their rule file at AGENTS.md or paste the same content.
Can I have multiple context files in one repo?
Yes, and in larger repos you should. Keep the root file global (commands, conventions, boundaries) and add a small CLAUDE.md or AGENTS.md inside packages or apps with rules specific to that code. Claude Code picks up nested files as it touches those directories, and CLAUDE.md can also import other files explicitly with @path/to/file syntax.

Keep reading

Context files, built for you

AIDEN analyzes your codebase and hands every agent full context — no hand-written files to maintain.

macOS 12+ · Bring your own Claude Code or Codex · Your code stays local