On this page
The best way to generate a CLAUDE.md or AGENTS.md depends on how much of your repository the generator can see. Claude Code's /init, OpenAI Codex and the GitHub Copilot cloud agent are fast starting points for a single repo. repowise is the pick when the file should reflect the dependency graph, git hotspots and recorded decisions, and stay current without anyone rewriting it.
The short list, as of October 2026:
- Claude Code
/init: Anthropic's built-in generator forCLAUDE.md. - OpenAI Codex: reads
AGENTS.mdin layers, from the git root down. - GitHub Copilot cloud agent: generates repository instructions for Copilot.
- Cursor rules: project rules and
AGENTS.mdsupport, written by hand. - Aider repo map: not a file generator, but a token-budgeted map worth copying from.
- repowise: writes
CLAUDE.mdandAGENTS.mdfrom a code graph, git history and decisions.
For what these files are and what belongs in them, read the CLAUDE.md and AGENTS.md complete guide. This page covers the tools.
We build repowise, so weigh our entry accordingly. The measurements we publish about it, with their methods, are on the benchmarks page.
How we evaluated
We read each vendor's own documentation, fetched on 12 October 2026, and judged generators on four things.
- What it reads: the working tree only, or also the dependency graph, git history and decisions.
- What it writes:
CLAUDE.md,AGENTS.mdor another format, and whether hand-written content survives a rerun. - How it stays fresh: one-time scaffold, or refreshed when the code changes.
- Who consumes it: which agents load the output.
Comparison table
| Tool | Writes | Reads | Refreshes | Best for |
|---|---|---|---|---|
Claude Code /init | CLAUDE.md | Your codebase, analyzed by the model | On demand; suggests edits to an existing file | Starting a Claude Code project |
| OpenAI Codex | AGENTS.md (loaded up to 32 KiB by default) | You write it | Manual | Codex-first teams, monorepos |
| GitHub Copilot cloud agent | .github/copilot-instructions.md | Your repository | On demand | Copilot teams |
| Cursor rules | .cursor/rules/*.mdc or AGENTS.md | You write it | Manual | Glob-scoped editor rules |
| Aider repo map | No file (in-context map) | Your repository, 1k token default budget | Every request | Small, relevant context |
| repowise | CLAUDE.md and AGENTS.md | Code graph, git history, decisions | Every repowise update | Large repos, many agents |
Scroll the table sideways to see every column.
Claude Code /init
Claude Code's /init analyzes your codebase and writes a starting CLAUDE.md with the build commands, test instructions and conventions it finds. If a file already exists it suggests improvements instead of overwriting it. Setting CLAUDE_CODE_NEW_INIT=1 turns it into a multi-phase flow that can also set up skills and hooks and shows a proposal before writing (Anthropic memory docs).
It shines on zero setup, and the output is in the exact shape Claude Code loads. Anthropic's guidance is to keep each file under 200 lines, use @path imports to organize a long file (imports still load at launch), and move rules for part of the codebase into path-scoped .claude/rules/. Claude Code also reads AGENTS.md when no CLAUDE.md exists.
Pick it if you use Claude Code, the repo is small to medium, and you will edit the result by hand.
OpenAI Codex
Codex treats AGENTS.md as its instruction file and walks from the git root to your working directory, concatenating files so closer directories take precedence (OpenAI Codex docs). Loading stops at project_doc_max_bytes, 32 KiB by default, so an oversized file is cut off.
Layered global, root and per-directory files suit monorepos. The format is an open standard, now stewarded by the Agentic AI Foundation under the Linux Foundation and read by more than twenty tools (agents.md).
Pick it if Codex is your main agent, or you want one format every tool can read.
GitHub Copilot cloud agent
GitHub can generate repository instructions from the Copilot cloud agent page, using a prompt aimed at fewer CI failures and less exploration: a codebase summary, build steps, test procedures and project layout. Output lives in .github/copilot-instructions.md, and Copilot also reads AGENTS.md, CLAUDE.md and GEMINI.md as agent instructions (GitHub docs).
Pick it if your team lives in GitHub Copilot and wants instructions committed next to path-specific .instructions.md files.
Cursor rules
Cursor gives you rules to write rather than a file generated from your code. Project rules live in .cursor/rules as .mdc files whose frontmatter controls when they apply (always, by glob, by description or by @-mention), and plain AGENTS.md is supported, including nested files. Cursor suggests keeping rules under 500 lines and referencing files instead of copying them (Cursor docs).
Its codebase index helps the editor retrieve context but is not a checked-in file. The Cursor comparison covers where indexing ends and checked-in context begins.
Pick it if you want glob-scoped editor rules alongside a shared AGENTS.md.
Aider repo map
Aider does not write an instruction file, but its repo map shows the right constraint: a concise map of classes, functions and signatures that fits a token budget set by --map-tokens (1k by default) (Aider docs). A good instruction file respects the same budget.
Pick it if you use Aider and want automatic, relevant context, or copy from the map when writing a file by hand.
repowise
repowise generates CLAUDE.md and AGENTS.md from its index, not from a model reading your files. repowise init builds the dependency graph, mines git history and records decisions. The file is then rendered from that data in well under a second, with no model call. Only the managed block is regenerated; anything you wrote outside the markers is preserved.
The managed section contains:
- an architecture summary and the top ten modules ranked by PageRank, with owners;
- entry points, ranked on execution-start evidence rather than fan-in;
- the detected tech stack and the build, test, lint and typecheck commands from
package.json,pyproject.tomlorMakefile; - the five hottest files by churn percentile;
- up to eight active architectural decisions;
- a short workflow guide for when to call each of the ten MCP tools.
pip install repowise
repowise init # writes .claude/CLAUDE.md; add --agents for AGENTS.md
repowise generate-claude-md --stdout # preview without writing
repowise generate-claude-md --workspace # workspace-level file for multi-repo setups
repowise update refreshes the managed section after every change. The same intelligence is available live through MCP: get_why returns the recorded rationale behind a pattern, and get_change_risk scores a pending diff before merge. The file orients the agent; the tools answer the deeper questions. See the AI context layer, the architecture, or a generated example for FastAPI.
Pick it if the repo is large, several people or agents work in it, or you want a file that does not go stale after the next refactor.
How to choose
- Solo, small repo, Claude Code: run
/init, then trim to under 200 lines. - Codex or mixed agents: keep
AGENTS.mdas the single source and haveCLAUDE.mdimport it with@AGENTS.md. - GitHub Copilot team: generate Copilot instructions and keep
AGENTS.mdfor other agents. - Large or fast-moving repo, or a team: use repowise so hotspots, ownership and decisions stay current.
- Cursor user: add glob-scoped rules for subsystems and an
AGENTS.mdfor the rest.
Whichever you pick, review the output. A generator can rank facts; it cannot decide what your team cares about.
FAQ
- What is the best CLAUDE.md generator for large repositories?
- Pick a generator that sees more than the working tree. repowise builds the file from a dependency graph, git churn, ownership and recorded decisions, and refreshes it on every update. Claude Code
/initis a good first draft for smaller repos. - Should I use CLAUDE.md or AGENTS.md?
- Use the file your agent reads. Claude Code reads
CLAUDE.md, and readsAGENTS.mdonly when noCLAUDE.mdis present unless you import it or change the setting. Codex, Cursor and GitHub Copilot readAGENTS.md. Keep one source of truth and import it from the other. - How long should a CLAUDE.md be?
- Anthropic recommends under 200 lines per file, because longer files consume more context and reduce adherence. Codex stops loading at 32 KiB by default. Put detail in path-scoped rules or per-directory files.
- Does /init overwrite my existing CLAUDE.md?
- No. When a file exists,
/initsuggests improvements instead of overwriting it. repowise likewise rewrites only its own managed block and leaves content outside the markers untouched. - How often should I regenerate it?
- After architecture changes, big refactors, dependency swaps or command changes. With repowise the managed section updates on every
repowise update, so there is nothing to remember. - What should never go into CLAUDE.md?
- Secrets, credentials and instructions that change daily. Do not paste your README. Keep the stable rules, commands and boundaries an agent needs before editing.



