Research date: 23 June 2026 · Scope: Codex CLI, Kimi Code CLI, MiMo Code, Cursor (cursor-agent), Antigravity CLI (agy), OpenCode. Claude Code excluded (already known). Multi-agent cited research.
- Project-level
AGENTS.mdis effectively universal. Every tool here reads anAGENTS.mdat the repo root. Your existingAGENTS.md → CLAUDE.mdsymlink per project already works for all of them. - Global instructions are the messy part — each tool reads a different global path, and two of the tools have no global instructions file at all.
- Kimi's specific issue is now explained: Kimi has no global instructions file whatsoever — it only scans the project tree for
AGENTS.md. A global~/.claude/CLAUDE.md(or~/.kimi/AGENTS.md) is simply never read. That's why "Kimi doesn't use agents.md." - In-file
@-references only resolve in Claude Code (and partly MiMo). Codex, Kimi, Cursor's AGENTS.md, OpenCode, and Antigravity all treat@pathas plain text — so your CLAUDE.md's references to other~/.claude/files silently break in every non-Claude tool. - Two free wins: OpenCode and MiMo Code both fall back to
~/.claude/CLAUDE.mdfor global instructions if they don't find their own — so they already read your global file for free. Cursor's CLI also reads a projectCLAUDE.md. - Recommended fix: a tiny "flatten + fan-out" sync script — resolve the references into ONE self-contained file, then symlink it to each tool's global path. This solves both the filename/location differences and the cross-file-reference problem in one shot.
| Agent | Global instructions file | Project instructions file(s) | Reads project AGENTS.md? |
Falls back to ~/.claude/CLAUDE.md? |
Resolves in-file @-imports? |
Native "load multiple files" mechanism |
|---|---|---|---|---|---|---|
| Claude Code (ref) | ~/.claude/CLAUDE.md |
CLAUDE.md (+ AGENTS.md) |
Yes | — | Yes (@path) |
@-imports |
| Codex CLI | ~/.codex/AGENTS.md (or AGENTS.override.md) |
AGENTS.md (root → cwd, concatenated) |
Yes (native standard) | No | No | project_doc_fallback_filenames in ~/.codex/config.toml |
| Kimi Code CLI | None (only ~/.kimi/config.toml, which has no instructions key) |
AGENTS.md / .kimi/AGENTS.md / agents.md (root → cwd) |
Yes — project only | No | No | None (plain concat, 32 KiB cap) |
| MiMo Code | ~/.config/mimocode/AGENTS.md |
AGENTS.md (+ CLAUDE.md fallback) |
Yes (primary) | Yes (global + project) | Yes (@filename lazy import) |
instructions[] in mimocode.json (paths, globs, URLs) |
Cursor (cursor-agent CLI) |
None for CLI (User Rules are GUI-only, not on disk) | AGENTS.md, .cursor/rules/*.mdc, .cursorrules |
Yes (CLI reads AGENTS.md and CLAUDE.md) |
CLI reads project CLAUDE.md |
No in AGENTS.md; @file in .mdc pulls source-file context only |
.cursor/rules/*.mdc (glob-scoped rules) |
Antigravity CLI (agy) |
~/.gemini/GEMINI.md |
AGENTS.md and GEMINI.md (both read) |
Yes | No | No (@ works at prompt-time only) |
None in-file |
| OpenCode | ~/.config/opencode/AGENTS.md |
AGENTS.md (+ CLAUDE.md fallback) |
Yes (primary) | Yes (global + project) | No | instructions[] in opencode.json (paths, globs, URLs) |
Sources per row are in the per-tool sections below.
- Global:
~/.codex/AGENTS.md.AGENTS.override.mdat the same level replaces it.$CODEX_HOMEoverrides the dir. (OpenAI Codex docs, 2026) - Project:
AGENTS.mdat the git root and one per subdirectory down to cwd; all concatenated (closer to cwd = later = higher effective priority). 32 KiB cap; one file per directory level. (OpenAI Codex docs) - Custom filenames: add names via
project_doc_fallback_filenamesin~/.codex/config.toml. (same) @-imports: NOT supported — treated as plain text. Open, unmerged feature requests: #17401@includedirective, #3413 file-content inclusion.
- Global instructions: NONE.
~/.kimi/config.tomlis the only global config and has nosystem_prompt/instructions_file/agents_mdkey. The loader (load_agents_md()insrc/kimi_cli/soul/agent.py) only searches the project hierarchy (root → cwd) — it never reads~/.kimi/or~/.claude/for an instructions file. (Kimi config docs, soul/agent.py) - Project:
.kimi/AGENTS.md,AGENTS.md, or lowercaseagents.md(uppercase wins) at root or any ancestor up to cwd; concatenated and injected via the${KIMI_AGENTS_MD}template variable. (kimi-cli AGENTS.md) - Why "Kimi ignores agents.md": almost always because (1) the file is placed at a global path (
~/.kimi/or~/.claude/) — Kimi only reads it inside the project tree; (2) Kimi was launched from a cwd outside the project; (3) a custom--agent-filewhose system prompt omits${KIMI_AGENTS_MD}; or (4) the file is empty after.strip(). - Global SKILLS are shared though: Kimi does scan
~/.kimi/skills/and~/.claude/skills/globally — but skills ≠ instructions. (Kimi skills docs) @-imports: NOT supported inAGENTS.md(plain-text concat).
- Global:
~/.config/mimocode/AGENTS.md(+~/.config/mimocode/mimocode.json). (MiMo Code config docs) - Project:
AGENTS.mdat root, falling back toCLAUDE.md. Precedence: localAGENTS.md> localCLAUDE.md> globalAGENTS.md> globalCLAUDE.md, all merged. (MiMo Code rules docs) - Multi-file / references:
instructions[]inmimocode.jsonaccepts paths, globs, and remote URLs;@filenameinsideAGENTS.mdlazy-imports;{file:path}inlines content. (config docs) - Adopts AGENTS.md as primary; ships a
CLAUDE.mdfallback. (repo)
- Global/User Rules: GUI-only, stored in app settings — not a file on disk, and the
cursor-agentCLI does not read them. Confirmed gap. (Cursor Rules docs, forum: global rules with cursor CLI) - Project:
.cursor/rules/*.mdc(frontmatter + globs + activation modes),AGENTS.md(plain markdown, read by both IDE and CLI), legacy.cursorrules. The CLI explicitly readsAGENTS.mdandCLAUDE.mdat project root. (Cursor CLI docs) @-imports:AGENTS.mdhas none;@filenameinside.mdcpulls source-file context, not rule composition. (Cursor Rules docs)
- Global:
~/.gemini/GEMINI.md(auto-loaded across all workspaces). Global skills:~/.gemini/antigravity-cli/skills/. Main config:~/.config/antigravity/config.toml. No globalAGENTS.mdconfirmed. (Antigravity deep-dive, hands-on guide) - Project: reads both
AGENTS.mdandGEMINI.mdat root (no rename needed;AGENTS.mdis the new convention). Project skills:.agents/skills/. (AI Builder Club guide) @-imports inside instruction files: No data found —@works at prompt-time only. Useagy inspectto see exactly which files were loaded.
- Global:
~/.config/opencode/AGENTS.md, falling back to~/.claude/CLAUDE.mdif absent (disable viaOPENCODE_DISABLE_CLAUDE_CODE). Global config:~/.config/opencode/opencode.json. (OpenCode Rules docs) - Project:
AGENTS.mdat root, falling back toCLAUDE.md(if both exist, onlyAGENTS.mdis used). (OpenCode Rules docs) - Multi-file / references — the key feature:
instructions[]inopencode.jsonaccepts file paths, globs, and remote URLs, additively merged (concat + dedup across global/project). In-file@-imports are NOT parsed — use this array instead. (OpenCode config docs, DeepWiki)
| Tool | Where its GLOBAL instructions must live |
|---|---|
| Claude Code | ~/.claude/CLAUDE.md (your source of truth) |
| OpenCode | auto-reads ~/.claude/CLAUDE.md ✅ free |
| MiMo Code | auto-reads ~/.claude/CLAUDE.md ✅ free |
| Codex CLI | ~/.codex/AGENTS.md — needs a symlink |
| Antigravity | ~/.gemini/GEMINI.md — needs a symlink |
| Kimi CLI | no global option — project AGENTS.md only |
| Cursor CLI | no global option — project AGENTS.md only |
Your CLAUDE.md points to other ~/.claude/ files. Only Claude Code resolves those; every other tool reads them as dead text. So even where the global file is picked up (OpenCode, MiMo via fallback), the referenced content is missing.
One canonical source, flattened into one self-contained file, fanned out to each tool's expected path. This fixes both problems with no per-tool divergence.
#!/usr/bin/env bash
# ~/.claude/sync-agent-config.sh — run on change (hook/cron) or manually
set -euo pipefail
SRC="$HOME/.claude/CLAUDE.md"
FLAT="$HOME/.claude/AGENTS.flat.md" # self-contained, references inlined
# 1) FLATTEN: inline @-references / linked files into one file.
# (Claude Code resolves @-imports itself, so it keeps using CLAUDE.md.
# Everyone else gets the flattened, self-contained version.)
# Implement the resolver to match how YOUR CLAUDE.md references files —
# e.g. expand lines like `@~/.claude/refs/foo.md` or `@refs/foo.md`:
python3 - "$SRC" "$FLAT" <<'PY'
import re, sys, pathlib
src, out = pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2])
base = src.parent
seen = set()
def expand(p: pathlib.Path) -> str:
p = p.expanduser().resolve()
if p in seen or not p.exists(): # avoid cycles / missing
return f"<!-- missing or cyclic: {p} -->"
seen.add(p)
lines = []
for line in p.read_text().splitlines():
m = re.match(r'^\s*@([~./\w\-/]+\.md)\s*$', line) # a bare @path import on its own line
if m:
ref = (base / m.group(1)).expanduser() if not m.group(1).startswith(('/','~')) else pathlib.Path(m.group(1))
lines.append(f"\n<!-- inlined from {m.group(1)} -->\n" + expand(ref))
else:
lines.append(line)
return "\n".join(lines)
out.write_text(expand(src))
print(f"flattened -> {out}")
PY
# 2) FAN-OUT: symlink the flattened file to each tool's GLOBAL path.
mkdir -p ~/.codex ~/.gemini ~/.config/opencode ~/.config/mimocode
ln -sf "$FLAT" ~/.codex/AGENTS.md # Codex
ln -sf "$FLAT" ~/.gemini/GEMINI.md # Antigravity
ln -sf "$FLAT" ~/.config/opencode/AGENTS.md # OpenCode (overrides the CLAUDE.md fallback w/ the flattened one)
ln -sf "$FLAT" ~/.config/mimocode/AGENTS.md # MiMo (same)
# 3) PROJECT level (covers Kimi + Cursor CLI, which have NO global option):
# symlink AGENTS.md -> the flattened file in each repo you use.
# (You already symlink AGENTS.md -> CLAUDE.md; point it at $FLAT instead
# so the references resolve for non-Claude agents too.)
# e.g.: ln -sf "$FLAT" /path/to/repo/AGENTS.md
echo "done."Trigger it automatically so it stays in sync — you already run a config_sync tmux session and a sync-claude-config skill; add this script there, or wire a Claude Code Stop/PostToolUse hook that re-runs it when ~/.claude/CLAUDE.md (or a referenced file) changes.
| Approach | Pros | Cons | Best for |
|---|---|---|---|
| Flatten + fan-out (above) | One source of truth; references actually resolve everywhere; one self-contained file | Need a small flattener; must re-run on change | Recommended — universal, handles both problems |
Plain symlink AGENTS.md → CLAUDE.md (no flatten) |
Zero scripting; you already do it | @-references stay broken in non-Claude tools; no help for Kimi/Cursor global |
Tools where the file is already self-contained |
Per-tool instructions[] arrays (OpenCode, MiMo only) |
No flattening; explicit, glob/URL support; native | Only OpenCode + MiMo have it; doesn't help Codex/Kimi/Cursor/Antigravity | OpenCode/MiMo if you prefer config over symlinks |
project_doc_fallback_filenames (Codex) |
Lets Codex pick up a shared custom filename anywhere | Codex-only; still no reference resolution | Registering a shared filename for Codex |
Make CLAUDE.md itself self-contained (drop the references) |
Simplest mental model; every tool gets the full content | Loses modularity; bigger single file; 32 KiB caps (Codex/Kimi) bite | Small/medium instruction sets |
Watch the 32 KiB cap on Codex and Kimi when flattening — keep the combined file under it, or split content so the per-project
AGENTS.mdcarries only what each repo needs.
- "Where does Kimi look?" Project tree only —
AGENTS.md/.kimi/AGENTS.md/agents.mdfrom repo root down to cwd. No global instructions file exists (only~/.kimi/config.toml, which can't point to one). A global~/.claude/CLAUDE.mdis never read by Kimi. Fix: put the (flattened)AGENTS.mdin each repo. (Global skills in~/.kimi/skills/and~/.claude/skills/are read.) - "Why isn't my symlink perfect?" Because (a) the referenced files aren't resolved by non-Claude tools (only Claude Code does
@-imports), and (b) two tools (Kimi, Cursor CLI) have no global slot at all. Flattening + per-project symlinks fixes both. - "Free wins?" OpenCode and MiMo already fall back to
~/.claude/CLAUDE.mdglobally; Cursor's CLI reads a projectCLAUDE.md. So those need the least work.
- OpenAI Codex — AGENTS.md guide · issue #17401 · issue #3413
- Kimi CLI — config files · soul/agent.py · AGENTS.md · skills
- MiMo Code — repo · config files · rules
- Cursor — Rules · CLI · forum: global rules w/ CLI
- Antigravity — deep-dive · hands-on guide · Gemini CLI → Antigravity transition
- OpenCode — Rules · Config · DeepWiki config system
- AGENTS.md open standard — agents.md
Compiled by SonPH's WC Coordinator agent via 6 parallel research sub-agents, 23 Jun 2026.