An instruction for an agent can go in a skill, a subagent, a plugin, or a file the agent loads into
every session, such as CLAUDE.md, AGENTS.md, or a Cursor rule. The format decides when the agent
reads the instruction and which clients read it at all. This article compares the formats through
one task: the release notes instruction from the
Buyer Release Notes sample ZIP file, written once
in each format and run on the sample’s examples/release.json.
On Nov 27, 2026, we ran the copies in Claude Code 2.1.325, Codex 0.171.0, and the Cursor CLI
2026.11.22 on macOS 27.2.1, and recorded what each client loaded, when it loaded it, and what it
returned. Every copy tells the agent to end its reply with a line that names the copy, such as
Instruction source: skill, so each answer shows which copy the agent followed.
What did the test cover? gives the conditions.
A file the client always loads reaches the agent at the start of every session, while a skill or a subagent loads its instructions only when a request matches it or names it. Each check started a new session in a test folder with the sample input and the copy under test, and the task checks sent this request:
Draft buyer-facing release notes from examples/release.json.In the tables, “followed” means the reply used the instruction’s three sections, Buyer Actions, Changes, and Review Notes, and ended with that copy’s line. “Followed by subagent” means the subagent’s answer did, whatever the main reply then did with it. A “plain draft” is release notes under other headings, such as “Before you upgrade” and “What’s new”, which every client wrote when the folder held no instruction. “On a match” means the release-notes request matched the copy’s description.
Claude Code 2.1.325, with claude-sonnet-5-5 at medium effort:
/context, sent as the only message of a new session, showed what each copy put in the session
before any work. In one reading per copy, it listed the skill and the subagent by name, at about 60
and 61 tokens, the plugin’s skill at about 70 tokens, and CLAUDE.md or AGENTS.md as a memory
file of 1.1k tokens. Those are /context’s estimates for these copies, not a cost to expect in
another project. Claude Code’s skills documentation says the listing holds each skill’s name and
description, and that the full skill loads only when it’s used.
How to keep an agent skill’s context footprint and token cost predictable
measures what a skill adds at startup and when it’s invoked. The session’s events showed when the
rest loaded: a Skill tool call for the skill and the plugin’s skill, and an Agent tool call that
handed the task to the subagent. Claude Code never loaded the Cursor rule, and in a session with its
file search tools added, it didn’t look for one.
Codex 0.171.0, with gpt-6.2-sol, which Codex’s text output named as its default model, at medium
reasoning effort in its read-only sandbox:
codex debug prompt-input renders, as JSON, the prompt input that Codex’s model sees at the start
of a session, without calling the model. It showed AGENTS.md in full and the skill in
.agents/skills/ as a name, description, and file path, and nothing from CLAUDE.md, the Cursor
rule, or the skill in .claude/skills/. Codex followed those three anyway: in a folder that held
only the input and the instruction, its JSON output shows it listing the files, opening the
instruction, and using it. The first AGENTS.md failed, as
Why did the same instruction fail in one client? explains.
Codex ignores a project’s .codex/ folder unless it trusts the project, as
Codex’s configuration documentation (opens in a new tab)
says, and our sessions skipped the user’s configuration file, where Codex keeps each project’s trust
setting. In an untrusted folder, Codex printed “Untrusted project-local configuration is disabled”
and read the agent file as an ordinary file. We then marked the folder as trusted for each session
with Codex’s -c option, and Codex’s subagent tool listed the agent with its description. The plain
request to draft release notes still didn’t reach the subagent. Codex’s start context told it not to
start one unless the user, an AGENTS.md file, or a skill asked for one, and
Codex’s subagent documentation (opens in a new tab) says
the same. When the request named it, Codex started the subagent:
Use the release-notes-writer subagent to draft buyer-facing release notes from examples/release.json.The saved session shows that the subagent found no file-reading tool, exchanged messages with the
main session, which had read the input, and then answered in the instruction’s format, ending with
Instruction source: subagent. Codex’s reply to the request was a shorter draft without the
sections.
The Cursor CLI 2026.11.22, with Composer 2.5 in ask mode unless a row names agent mode:
Cursor CLI 2026.11.22 listed no command that prints a session’s start context, so a probe stood in:
a session that forbade tools and asked for the instruction’s last line. It returned the line for
both versions of AGENTS.md, for CLAUDE.md, and for the always-applied rule, and “not in context”
for the skills, the subagent, and the rule with a description. Cursor’s JSON output showed the rest:
when the request matched, Cursor opened the skill or rule file at its path without searching for it
first.
In ask mode, Cursor treated the subagent’s name as a skill, tried to open a skill file of that name
under ~/.cursor, found none, and wrote a plain draft. In agent mode, it found the subagent file
with a search and followed it without delegating. It delegated through its task tool only when the
request named the subagent, for the file in .cursor/agents/ and for the same file in
.claude/agents/, and its reply kept the subagent’s last line.
The plain request didn’t trigger delegation in either mode in Cursor CLI 2026.11.22. For current
Grok Build clients, see
Grok Build Terminal UI subagents (opens in a new tab) and
Grok Build Agents Window subagents (opens in a new tab).
Write AGENTS.md when the project will be opened in more than one client: Claude Code, Codex, and
Cursor all loaded it at the start of a session, and Codex didn’t load CLAUDE.md. By default,
Claude Code reads AGENTS.md only when the working folder and the folders above it have no
CLAUDE.md. With both files in the test folder, Claude Code loaded CLAUDE.md alone, and Codex
loaded AGENTS.md alone; we didn’t test Cursor with both.
Claude Code’s memory documentation (opens in a new tab) describes
that rule, the setting that loads both files, and 2.1.277 as the first version that reads
AGENTS.md.
In our tests, Claude Code and Cursor loaded CLAUDE.md, and its presence hid AGENTS.md from
Claude Code.
Codex followed a CLAUDE.md only after it listed the test folder and opened the file, in a folder
with nothing else to read, so that result doesn’t show Codex reading one in a larger project.
Codex’s AGENTS.md guide (opens in a new tab) describes a
setting in the user’s Codex configuration that adds other filenames to the instruction files Codex
looks for; we ran Codex without that configuration and didn’t test the setting. Claude Code’s
documentation also shows a CLAUDE.md that imports AGENTS.md, which we didn’t test either.
The Grok Build Terminal UI project rules (opens in a new tab)
document how Grok loads AGENTS.md and CLAUDE.md from the directory tree. Run grok inspect to
list the rules it found.
The AGENTS.md site (opens in a new tab) describes the format. To write and package an AGENTS.md
for code you sell, follow
AGENTS.md template and example for code you sell, whose record also
checked a CLAUDE.md that imports AGENTS.md.
Use a skill when the instruction should shape the reply itself: in Claude Code, the skill’s draft reached the reply with every section and its last line, while the subagent’s draft came back as a report that the main conversation restated. The restated reply dropped the last line and added: “I didn’t open the JSON myself, so I haven’t checked its summary against the source records.” The main conversation saw the report, not the file.
Until used, the two added about the same to a session: one /context reading estimated about 60
tokens for the skill’s listing and 61 for the subagent’s. They differ in when they run and in what
reaches you. Claude Code delegated the plain request to the subagent. Codex and Cursor delegated
only when the request named the subagent, and Codex replied with a shorter draft of its own instead
of the subagent’s formatted one. A skill was followed in all three clients, so for a task with one
expected output, such as release notes, the skill kept the reply closest to the instruction.
A subagent suits work whose steps you don’t need to see, because it runs in a separate conversation and returns only its report. Claude Code’s subagent documentation (opens in a new tab) covers what a subagent’s file can set, such as its tools and its model, and Claude Code’s skills documentation (opens in a new tab) owns the skill format. SKILL.md format and a working example reads the skill’s own file.
A skill is enough for one instruction: the same skill inside a Claude Code plugin loaded and ran as it did on its own, with the plugin’s name added to its name. The test plugin held a manifest and the skill:
Loaded for one session with Claude Code’s --plugin-dir option, the skill appeared as
release-notes-kit:buyer-release-notes, at about 70 tokens in /context. The plain request loaded
it through a Skill tool call, and the reply followed it. claude plugin validate release-notes-kit
passed with one warning, that the manifest names no author. It also reported that the folder had no
README.md, no license, and no icon, in checks that don’t change its result.
Use a plugin when several parts, such as skills, subagents, and hooks, have to install together. We tested plugins in Claude Code only. Claude Code’s plugin overview (opens in a new tab) and Claude Code’s plugin creation guide (opens in a new tab) own the format. To package several skills as a plugin for sale, follow How to package and sell a Claude Code plugin.
Write a skill when the instruction has to work outside Cursor: Cursor followed the rule and the
skill, but Claude Code never loaded the rule, and Codex used it only after finding the file in a
search. Inside Cursor, the two rule types matched the two loading patterns. A rule with
alwaysApply: true loaded at the start, like AGENTS.md. A rule with a description and
alwaysApply: false stayed out until the request matched, and then Cursor opened it as it opened a
skill. Cursor read the skill from .agents/skills/ and from .claude/skills/.
The Grok Build Agents Window rules (opens in a new tab) and
Grok Build Agents Window skills (opens in a new tab) describe the
desktop formats. The
Grok Build Terminal UI project rules (opens in a new tab) explain
why a Cursor .mdc rule doesn’t load in the terminal. Put shared instructions in AGENTS.md, or
install a task as a
Grok Build Terminal UI skill (opens in a new tab).
Its wording assumed one kind of tool: it told the agent to read the input only with “the client’s file-reading tool” and never through a shell command, and Codex, which reads files through shell commands, ran no command and asked for the JSON to be pasted, in both runs of that check. This was the instruction’s original limit:
The reworded limit names the result instead of one client’s tool:
With the reworded AGENTS.md, Codex read the input with one cat command and followed the
instruction, and Claude Code and Cursor followed it too. In Codex’s main session, only the
always-loaded file stopped Codex, and it was the only copy whose limit Codex had before it read the
input. As a skill in .agents/skills/, the original wording came in the same command that read the
input. As a skill in .claude/skills/, as CLAUDE.md, or as a rule, it came after. The Codex
subagent, whose instructions arrived before any read, also searched its tools for a file reader and
found none; it drafted only after the main session, which had read the input, sent it a message.
Write a limit as the result you want, such as reading only the named file, so that it holds in a
client with other tools.
The same skill file worked in all three clients, and so did AGENTS.md once its wording no longer
named one client’s tool. The other formats each worked in fewer:
- Skill: the same
SKILL.mdran in all three, from different folders. Claude Code listed.claude/skills/and not.agents/skills/. Codex listed.agents/skills/and not.claude/skills/. Cursor read both. A skill meant for all three goes to.claude/skills/for Claude Code and.agents/skills/for Codex. Install for several clients in one project shows the tested layout and where to install the skill in Grok Build. AGENTS.md: loaded at the start in all three when it was the only instruction file. With aCLAUDE.mdbeside it, Claude Code loaded only theCLAUDE.md, and Codex still loadedAGENTS.md.CLAUDE.md: loaded at the start in Claude Code and Cursor, not in Codex.- Subagent: Claude Code and Cursor ran the same Markdown file, and Cursor also ran it from
.claude/agents/. Codex needs its own TOML file in.codex/agents/and a trusted project. - Cursor rule: loaded by Cursor only. Codex followed it after finding the file, and Claude Code didn’t.
- Plugin: tested in Claude Code only.
Codex’s skills documentation (opens in a new tab), Codex’s subagent documentation (opens in a new tab), and Grok Build Terminal UI subagents (opens in a new tab) own those clients’ folders and file formats.
We recorded these results on Nov 27, 2026, on macOS 27.2.1: 50 sessions with a model, plus 20
commands that listed what a session starts with. Six more sessions that didn’t test what they were
meant to, such as two that read a copy outside the test folder, aren’t counted. Each check ran once,
except the Codex check of the first AGENTS.md, which ran twice with the same result. Each check
ran in a test folder, outside any repository, that held the sample input and the copies under test,
with the plugin in a folder beside it. A script wrote every copy from the text of the sample’s
SKILL.md, with its scope paragraph reworded to fit any format and a last line that names the copy.
The reworded AGENTS.md uses the
file-reading limit that worked in Codex. No log shows the text of the
CLAUDE.md, first AGENTS.md, and subagent copies that Claude Code used, or of the AGENTS.md in
the first run of that Codex check, so their text rests on that script; the second run used the copy
with the original file-reading limit.
- Claude Code 2.1.325 ran through
claude -pwithclaude-sonnet-5-5at medium effort, the Read, Skill, and Agent tools (Agent so that it could delegate), the project’s own settings, no MCP servers, and no saved session. - Codex 0.171.0 ran through
codex execat medium reasoning effort, in the read-only sandbox, without the user’s configuration file, and without a saved session. Its JSON output doesn’t name the model. The checks that set none used Codex’s default, which its text output named asgpt-6.2-solin the two checks that used that output, one within a minute of the first such check and the other as the last; we take the rest to have used the same model. The two trusted-folder checks and the second run of the firstAGENTS.mdcheck setgpt-6.2-solwith-m. The two checks in a trusted folder kept their sessions, because in a session started with--ephemeral, Codex couldn’t start a subagent: it logged that no saved session was found. The start-context listings rancodex debug prompt-inputwith an empty Codex home folder, which keeps the user’s configuration file out as the sessions did. - The Cursor CLI 2026.11.22 ran through
cursor-agent -pwith Composer 2.5, in ask mode except in the agent mode checks. The check with no instruction added “Use only the files in this folder.” to the request, because without it, Cursor searched the folders above the test folder and used another copy of the skill that it found there.
The skills that came with each client and account were listed too, and none of them ran. We didn’t
test plugins in Codex or Cursor, Cursor with both AGENTS.md and CLAUDE.md, Cursor rules scoped
by file patterns or applied by mention, instruction files in subfolders or in a home folder, a
CLAUDE.md that imports AGENTS.md, interactive sessions, other models, or other operating
systems. A single run shows what happened once, not how often it happens.
A skill folder packages cleanly, on its own or inside a plugin: it’s self-contained, it adds only
its listing to a session until a request needs it, and the same file worked in all three clients.
An always-loaded file belongs to the project where it lives. Claude Code loaded CLAUDE.md or
AGENTS.md at the start of every session, whatever the request (1.1k tokens in one /context
reading of these copies), and by default, when a buyer’s project already has a CLAUDE.md, Claude
Code doesn’t read an AGENTS.md added to it. Instructions that every session in one project needs,
such as that project’s conventions, go in its AGENTS.md or CLAUDE.md, and an instruction for one
task goes in a skill.
A subagent file needs one version in Markdown for Claude Code and Cursor and another in TOML for Codex, and Codex and Cursor delegated to it only when the request named it.
If you make skills, How to sell Claude skills packages the sample skill with its README and test record. Your buyers follow How to install a skill in Claude Code, Codex, or Grok Build to put a skill where their client reads it.