Instructions5 min readUpdated Dec 5, 2026

CLAUDE.md vs AGENTS.md: managing instruction files across coding agents

Claude Code reads CLAUDE.md while Codex, Cursor, OpenCode, DeepSeek and Pi default to AGENTS.md. Here is where every harness looks, how global and project files differ, and how to keep them lean.

Where each coding agent reads global instructions

An instruction file is standalone ambient guidance that a coding agent loads automatically at the start of every session. Unlike a skill, which is listed by its name and description until invoked, an instruction file is read in full before you type a prompt.

The catch for anyone using more than one coding agent is that filenames and directories diverge immediately. Claude Code expects CLAUDE.md inside its configuration directory, while Codex, Cursor, OpenCode, DeepSeek and Pi look for AGENTS.md in their own home directories.

Global instruction file paths across the six built-in harnesses
AgentGlobal instruction pathEnv overrideSpecial rules
Claude Code~/.claude/CLAUDE.mdCLAUDE_CONFIG_DIRReads CLAUDE.md at the config root.
Codex~/.codex/AGENTS.mdCODEX_HOMEAGENTS.override.md takes precedence when present and non-empty.
Cursor~/.cursor/AGENTS.mdNoneReads AGENTS.md in ~/.cursor.
OpenCode~/.config/opencode/AGENTS.mdOPENCODE_CONFIG_DIRFalls back to $XDG_CONFIG_HOME/opencode/AGENTS.md.
DeepSeek~/.dsh/AGENTS.mdDSH_HOMEConfigurable path; defaults to AGENTS.md under ~/.dsh.
Pi~/.pi/agent/AGENTS.mdPI_CODING_AGENT_DIRReads AGENTS.md first, then falls back to CLAUDE.md.

Global instructions vs repository instruction files

A common mistake is treating global instructions and repository instructions as the same thing. Your global file (~/.claude/CLAUDE.md or ~/.codex/AGENTS.md) belongs to you: it holds personal habits like how you prefer diffs summarised, which shell tools you keep installed, or how concise responses should be.

A project-level CLAUDE.md or AGENTS.md committed inside a Git repository belongs to the team. It documents build commands, architectural invariants, and repository conventions. Because it is versioned in Git and shared with everyone on the repo, a personal sync tool should never silently overwrite it or hijack its history.

In Kitling, only your user-level global instruction file is adopted as a Library Instruction. Committed project files stay owned by the repository; Kitling reads them only when mirroring a trusted project to your other agents and never silently overwrites your files.

Why instruction files should stay short

Because every token in CLAUDE.md or AGENTS.md loads at the start of every session, the entire file counts as idle cost. A 2,500-token global instruction file filled with deployment checklists, SQL style guides, and release scripts taxes quick questions that have nothing to do with deployments or SQL.

  • Keep global instructions to preferences that apply to nearly every session (communication style, safety habits, environment facts).
  • Move repeatable workflows — code review, database migrations, changelog writing, PR checklists — into Skills so only their short name and description load at session start.
  • Avoid duplicating the same long prose in both CLAUDE.md and AGENTS.md inside a repo; keep one canonical project file and reference or mirror it intentionally.

Keeping CLAUDE.md and AGENTS.md in sync without overwriting

Some teams symlink ~/.codex/AGENTS.md to ~/.claude/CLAUDE.md. That works until you want Codex's AGENTS.override.md behaviour, edit one copy while another tool writes to it, or need to roll back a bad change.

With Kitling, your global instruction lives once in the local Library on your Mac and delivers to each active agent's native path as an ordinary file. Every save creates an immutable Revision you can undo. If you edit the file directly inside a harness, Kitling saves differing edits in Version history rather than discarding them, and if you ever stop using Kitling, every plain file stays right where your agents expect it.

Write a skill once. Use it in every agent.

Open Kitling once and the skills you already have are in every agent you use.

Free and MIT licensed · No account · Works offline · Apple Silicon