C.W.K.
Stream
Lesson 02 of 05 · published

CLAUDE.md / AGENTS.md / GEMINI.md — One Pattern, Three Names

~14 min · context-files, cross-tool, memory

Level 0🌱 Novice
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

The naming is the only difference

CLAUDE.md, AGENTS.md, GEMINI.md — three names, one pattern. Each is a markdown file the agent reads at session start. Each supports the same hierarchy (global → project → nested). Each merges files closer-to-CWD on top of files closer-to-root. The differences are at the margins (override files, fallback names, max bytes), not in the core idea.

The cross-tool reality: most teams use multiple CLIs. The pragmatic move is to pick one canonical file (often AGENTS.md, since Codex demands it and Gemini falls back to it) and configure the others to use the same file. Codex naturally reads AGENTS.md; Gemini reads it via contextFileName fallback; Claude Code can be told to read it via a symlink or a small CLAUDE.md that imports the AGENTS.md content.

Code

One AGENTS.md, three CLIs·bash
# Repo root has the canonical AGENTS.md
# Codex reads it natively. Configure the others:

# Gemini — fallback config
mkdir -p ~/.gemini
cat > ~/.gemini/settings.json <<'EOF'
{ "contextFileName": ["GEMINI.md", "AGENTS.md"] }
EOF

# Claude Code — symlink (or a tiny CLAUDE.md that says "see AGENTS.md")
ln -s AGENTS.md CLAUDE.md
# (Or write CLAUDE.md as 'See AGENTS.md for canonical project rules.')

# Now all three CLIs share the same project memory.
Override-file pattern across tools·text
# Sprint-bound rules go in override files:

~/.codex/AGENTS.override.md      ← Codex temporary global override
.claude/CLAUDE.local.md          ← Claude Code local (gitignored)
~/.gemini/GEMINI.local.md        ← Gemini local (gitignored)

# Each CLI's override mechanism is slightly different but they
# all serve the same purpose: time-bounded rules that don't
# pollute the canonical files.

External links

Exercise

In a real repo, consolidate to one canonical context file (AGENTS.md is the practical choice). Configure your other CLIs to read it. Run a session in each — verify identical context loads. Capture the diff in your notes.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.