An agent skill is a folder with a SKILL.md file that tells an agent how to do one kind of task, loaded only when the task calls for it. The Agent Skills project describes the format as “a lightweight, open format for extending AI agent capabilities with specialized knowledge and workflows”. Anthropic originally developed the format and released it as an open standard. Claude Code follows the standard and Codex builds on it.

What a skill contains

The specification requires one file and suggests three folders for common kinds of supporting material.

skill-name/
  SKILL.md      required: metadata + instructions
  scripts/      optional: executable code
  references/   optional: documentation
  assets/       optional: templates, resources

SKILL.md starts with YAML frontmatter and then a Markdown body. The spec’s body rules are short: “There are no format restrictions”, with step-by-step instructions, examples and edge cases as the suggested sections.

FieldRequiredLimit from the spec
nameYesUp to 64 characters; lowercase letters, numbers and hyphens; no leading, trailing or doubled hyphens; must match the parent directory name
descriptionYes1 to 1024 characters; should say what the skill does and when to use it
licenseNoA license name or a bundled license file
compatibilityNo1 to 500 characters, if supplied, for environment requirements
metadataNoA map of string keys to string values
allowed-toolsNoSpace-separated pre-approved tools; the spec marks it experimental

Use words that identify when the skill applies. The specification’s PDF example names the operations the skill performs and the requests that should trigger it.

How an agent loads a skill

The spec describes progressive disclosure in three layers:

  1. Metadata, about 100 tokens per skill, is loaded at startup for every skill the tool lists.
  2. Instructions, recommended under 5000 tokens, load when the skill is activated.
  3. Scripts, references and assets load as needed, when required.

The spec recommends keeping the main SKILL.md under 500 lines and moving detail into separate files. Claude Code puts it this way: “a skill’s body loads only when it’s used, so long reference material costs almost nothing until you need it.” Some tools also budget the startup listing. By default Claude Code truncates the combined description and when_to_use text at 1,536 characters per skill, and Codex gives the initial skills list at most 2% of the context window, or 8,000 characters when the window is unknown. Both limits are configurable, so the safe habit is to put the key use case first in the description.

Where each tool looks for skills

ToolProject folderPersonal folder on the local machine
Claude Code.claude/skills/<name>/SKILL.md~/.claude/skills/<name>/SKILL.md
Codex.agents/skills in every directory from the working directory up to the repository root$HOME/.agents/skills

Claude Code also loads plugin and enterprise (managed settings) skills. Codex loads admin skills from /etc/codex/skills.

Claude Code adds invocation control and subagent execution. In the Codex CLI or IDE extension, type $ to mention a skill. Codex can also select a skill when the task matches its description.

Skills or AGENTS.md

Both are Markdown the agent reads, but they load at different times. AGENTS.md is a file of project instructions that tools such as Codex read before doing any work, so it suits short facts that apply to every task, such as build commands and code style. A skill suits a procedure or a body of reference that only some tasks need.

Claude Code describes the split as a reason to create a skill: you keep pasting the same checklist or multi-step procedure into chat, or “a section of CLAUDE.md has grown into a procedure rather than a fact”. For rules files in Cursor, see How to write Cursor rules.