Comparisons
Project Instructions: CLAUDE.md vs AGENTS.md
All three tools inject a project-level instructions file into the model’s context, but the filename, discovery, and merge rules differ. Claude Code uses CLAUDE.md; Codex and Kimi Code both use AGENTS.md — with different discovery rules between them.
Related per-tool pages: Claude Code — Project Instructions (CLAUDE.md) · Codex CLI project instructions (AGENTS.md) · Project Instructions (AGENTS.md)
File locations and precedence
Claude Code (CLAUDE.md)
| Type | Location |
|---|---|
| Enterprise policy | macOS /Library/Application Support/ClaudeCode/CLAUDE.md; Linux/WSL /etc/claude-code/CLAUDE.md; Windows C:\ProgramData\ClaudeCode\CLAUDE.md |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md (commit to git) |
| User | ~/.claude/CLAUDE.md |
| Project local | ./CLAUDE.local.md — deprecated in favor of @ imports |
- All memory files load into context at launch; higher levels in the table are loaded first and take precedence.
- Lookup recurses up from the cwd to (not including)
/, reading CLAUDE.md/CLAUDE.local.md on the way; nested CLAUDE.md files in subtrees load on demand when Claude reads files there. - No size cap is documented.
Codex (AGENTS.md)
Discovery runs once per run (or per TUI session):
- Global scope (
~/.codex): readsAGENTS.override.mdif it exists, otherwiseAGENTS.md— only the first non-empty file at this level. - Project scope: from the project root (typically the Git root; configurable via
project_root_markers) walk down to the cwd. In each directory Codex checksAGENTS.override.md, thenAGENTS.md, then the names inproject_doc_fallback_filenames. At most one file per directory. - Merge: files are concatenated root-down, joined with blank lines; files closer to the cwd appear later and therefore override earlier guidance.
- Empty files are skipped.
- Combined size is capped at
project_doc_max_bytes(default 32 KiB).
Kimi Code (AGENTS.md)
- Project-level:
AGENTS.mdat the project root or.kimi-code/AGENTS.md. Content is injected into the system prompt as reference data (the${agents_md}template variable). - Global Kimi-specific:
$KIMI_CODE_HOME/AGENTS.md(default~/.kimi-code/AGENTS.md); moves withKIMI_CODE_HOME. - Generic cross-tool:
~/.agents/AGENTS.mdin the real OS home, shared across tools; does not move withKIMI_CODE_HOME. - Size limit: ? The docs do not specify an exact size cap or whether nested subdirectory AGENTS.md files merge; the changelog mentions a visible warning when AGENTS.md is truncated (previously silent), so a cap exists but is undocumented.
Import and override mechanisms
| Mechanism | Claude Code | Codex | Kimi Code |
|---|---|---|---|
| Import other files | @path/to/file imports (relative/absolute, @~/... supported, recursive up to 5 hops, not evaluated in code spans) | No direct equivalent verified. | No direct equivalent verified. |
| Per-directory override | Nested CLAUDE.md files load on demand in subtrees | AGENTS.override.md replaces AGENTS.md in the same directory | No direct equivalent verified. |
| Replace built-in instructions | --system-prompt / --system-prompt-file CLI flags | model_instructions_file config key (replaces built-in instructions, not AGENTS.md) | $KIMI_CODE_HOME/SYSTEM.md replaces the default main agent’s system prompt |
| Quick add from the composer | # prefix prompts which memory file to append to | No direct equivalent verified. | No direct equivalent verified. |
/init behavior
- Claude Code:
/initbootstraps (generates) a project CLAUDE.md. - Codex:
/initgenerates an AGENTS.md scaffold in the current directory. - Kimi Code:
/init(idle only) analyzes the codebase and generates AGENTS.md.
Porting your instructions
- Claude Code → Codex or Kimi Code: rename
CLAUDE.mdtoAGENTS.md. Unroll any@importlines first — neither Codex nor Kimi documents import syntax, so inline the imported content yourself. In Codex, keep the total under 32 KiB (project_doc_max_bytes) or raise the limit. - Codex → Claude Code: rename
AGENTS.mdtoCLAUDE.md. Remember Codex concatenates multiple AGENTS.md files root-down while Claude loads nested CLAUDE.md files on demand, so a multi-file Codex setup may become a single file or a set of nested files in Claude. - Kimi Code → Claude Code / Codex: check all three Kimi locations (
AGENTS.mdor.kimi-code/AGENTS.mdin the project,~/.kimi-code/AGENTS.md,~/.agents/AGENTS.md) and consolidate. - Automated importers: Kimi Code ships a built-in
/import-from-cc-codexskill command that imports Claude Code and Codex instructions, skills, and MCP settings. Codex ships/import, which migrates Claude Code (or Cursor) setup, projects, and chats. Neither Claude Code nor Codex documents an importer from Kimi Code.
Last verified: 2026-09-07
Official sources:
- https://docs.claude.com/en/docs/claude-code/memory
- https://developers.openai.com/codex/guides/agents-md
- https://developers.openai.com/codex/config-reference
- https://www.kimi.com/code/docs/en/kimi-code-cli/customization/agents.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/configuration/data-locations.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.