Put a checklist you keep pasting into chat in a SKILL.md file, and Claude Code, OpenCode and Codex can all use it. Agent Skills work well for jobs you repeat, such as reviewing a Docker Compose file before you deploy.
Keep the skill in .agents/skills for Codex and OpenCode. Add a symlink for each skill in .claude/skills so Claude Code can find it too. Keep the shared file to the standard fields unless you need a feature specific to one tool.
What an agent skill is
A skill is a directory that contains, at minimum, a SKILL.md file. The file starts with YAML frontmatter (a name and a description) followed by plain Markdown instructions. Anything else in the folder is optional: a scripts/ folder for code the agent can run, a references/ folder for longer documentation and an assets/ folder for templates or data files.

The format started at Anthropic and is now published as an open standard at agentskills.io. Claude Code says its skills follow that standard and add extra features on top. OpenAI’s Codex documentation says Codex skills build on the same open standard, and OpenCode reads the same folder layout and accepts the standard’s portability fields. That shared base is why one skill folder can serve all three tools.
A skill is not a plugin or an MCP server. It does not add new tools by itself. It gives the agent instructions and files, and the agent uses the tools it already has (reading files, running shell commands) to follow them. That makes skills cheap to write: if you can describe a procedure in Markdown, you can turn it into a skill.
How Agent Skills load: names first, instructions later
Agents first see the skill’s name and description. They read the instructions when the skill is called and open supporting files as needed.
- Metadata (about 100 tokens per skill): the
nameanddescriptionof every available skill load at startup, so the agent knows what exists. - Instructions (under 5,000 tokens recommended): the full
SKILL.mdbody loads only when the agent decides the skill matches the task, or when you call it by name. - Resources (as needed): files in
scripts/,references/orassets/load only when the instructions point the agent at them.

This is why the description matters more than anything else in the file. It is the only part the agent sees before it decides whether to open the skill. A vague description such as “Helps with PDFs” rarely triggers; one that says what the skill does and when to use it, with the words people actually type, does.
Each tool also caps how much room the skill list can take. Claude Code sizes its skill listing at 1% of the model’s context window and cuts each entry’s description (plus the optional when_to_use text) at 1,536 characters. Codex keeps its initial list to at most 2% of the context window, or 8,000 characters when it does not know the window size, and shortens descriptions first when many skills are installed. OpenCode lists the ID, name and description of each permitted skill at every model step. In all three, put the key use case at the start of the description so it survives any trimming.
Where Claude Code, OpenCode and Codex look for skills
Codex and OpenCode both read .agents/skills, the closest thing to a neutral location. Claude Code reads .claude/skills, and OpenCode reads that too for compatibility. Claude Code’s skills documentation does not list .agents/skills as a location, so Claude Code needs a little help to share a folder.
| Scope | Claude Code | OpenCode | Codex CLI |
|---|---|---|---|
| Project | .claude/skills/<name>/SKILL.md, from the start folder up to the repository root | .opencode/skills, plus .claude/skills and .agents/skills, from the current folder up to the project root | .agents/skills in every folder from the current working directory up to the repository root |
| Personal or global | ~/.claude/skills/<name>/SKILL.md | ~/.config/opencode/skills, plus ~/.claude/skills and ~/.agents/skills | $HOME/.agents/skills |
| Machine-wide | Enterprise skills in the managed settings directory | Extra folders or HTTP catalogs listed in the skills array of opencode.json | /etc/codex/skills (admin scope) |
| Built in | Bundled skills such as /code-review, /debug and /loop | Built-in skills | skill-creator and skill-installer |
| Nested folders | Skills in a subfolder’s .claude/skills load once Claude reads or edits a file there | Included at every level between the current folder and the project root | Every .agents/skills between the working directory and the repository root |
| Symlinked skill folders | Supported; a skill reached through several links loads once | Not covered in the skills docs | Supported; Codex follows the symlink target |

When two skills share a name, the tools resolve it differently. In Claude Code, enterprise beats personal and personal beats project, so a deploy skill in ~/.claude/skills wins over the project’s deploy. OpenCode picks by ID, and the source registered later wins: project .opencode/skills beats the global OpenCode folder, which beats .agents/skills, which beats .claude/skills. Codex does not merge or override; if two skills share a name, both can show up in its skill selectors. The safe habit is simple: give every skill a unique name.
SKILL.md frontmatter: which fields each tool reads
The open standard defines six frontmatter fields. Only two are required by the spec: name (up to 64 characters, lowercase letters, numbers and single hyphens, matching the folder name) and description (up to 1,024 characters, saying what the skill does and when to use it). The other four are optional: license, compatibility (up to 500 characters of environment requirements), metadata (a map of your own keys and values) and allowed-tools, which the spec marks experimental.
| Field | Claude Code | OpenCode | Codex CLI |
|---|---|---|---|
name | Optional; sets the slash command, defaults to the folder name | Display label only; the skill ID comes from the file path | Required |
description | Recommended; falls back to the first line of the body | Needed for the model to discover the skill | Required; drives implicit invocation |
license, compatibility | Accepted, not acted on | Accepted, not interpreted | Not mentioned in the skills docs |
metadata | Free-form map for your own tooling | opencode/autoinvoke: false hides the skill from the model | Not mentioned; Codex uses agents/openai.yaml instead |
allowed-tools | Pre-approves listed tools for the turn that invokes the skill | Not mentioned in the skills docs | Not mentioned in the skills docs |
disable-model-invocation | Only you can invoke the skill | Same effect as opencode/autoinvoke: false | Use policy.allow_implicit_invocation: false in agents/openai.yaml |
| Claude-only extras | when_to_use, argument-hint, arguments, user-invocable, model, effort, context: fork, agent, hooks, paths, shell and more | Not supported | Not supported |
Claude Code ignores a field it does not recognise without an error, and if the YAML fails to parse it still loads the skill with no fields set, so /skill-name works but automatic matching does not. OpenCode does not enforce the naming pattern, the length limits or a match between name and the folder, but it recommends the same lowercase kebab-case IDs as the spec. If you want a skill that works everywhere, stick to the spec’s rules even where a tool would let you get away with less.
When a skill beats AGENTS.md, CLAUDE.md or a rule
Skills, instruction files and rules overlap, and it is easy to put things in the wrong place. Claude Code’s own guidance draws the line clearly: keep CLAUDE.md for facts the agent needs in every session, and move a multi-step procedure, or anything that only matters for one part of the codebase, into a skill or a path-scoped rule. The same thinking works for AGENTS.md in Codex and OpenCode.
- Use AGENTS.md or CLAUDE.md for short, always-true facts: build and test commands, folder layout, naming conventions, “never commit to main”. These load in every session, so every line costs context all the time.
- Use a skill for procedures and reference material you need sometimes: cutting a release, reviewing a Docker Compose file, writing a migration, a long API style guide. The body costs almost nothing until the task comes up.
- Use a path-scoped rule (Claude Code’s
.claude/rules/files with apathsfield) for guidance tied to certain files, such as conventions forsrc/api/**. Claude Code skills also accept apathsfield, but that is not portable. - Use a hook or a permission rule for anything that must happen every time. Claude Code’s docs are blunt here: if a rule must hold on every edit, put it in a hook, because a skill is guidance the model can drift away from.
If you keep pasting the same checklist into chat, move it into a skill and give it a description that says when to use it.
Step 1: Write your first skill
The example below is a skill for reviewing Docker Compose files before you deploy, the kind of check that is easy to forget on a home server. It uses only spec fields, so all three tools can read it. Create the folder in the shared .agents/skills location at the root of your project:
mkdir -p .agents/skills/compose-reviewThen save this as .agents/skills/compose-review/SKILL.md:
---
name: compose-review
description: Reviews Docker Compose files for risky settings before deploy. Use when the user asks to check, review or harden a docker-compose.yml or compose.yaml file, or before running docker compose up on a changed stack.
license: MIT
compatibility: Needs Docker with the compose plugin
---
# Compose review
1. Find the compose file the user means. If there are several, ask which one.
2. Check every service for:
- image tags that are missing or set to latest
- a restart policy
- ports published on all interfaces that only need to be local
- secrets written directly in the file instead of an env file
3. Report findings as a short list grouped by service, most serious first.
4. Suggest exact edits, but do not change the file unless the user asks.
A few things make this skill trigger reliably. The name matches the folder and follows the spec’s lowercase-and-hyphens rule. The description opens with what the skill does, then lists the phrases a person would actually type. The body uses short imperative steps with a clear output, which OpenAI’s Codex docs recommend. Keep the main file under 500 lines, the guideline in both the spec and Claude Code’s docs.
Codex also ships a guided route: type $skill-creator in Codex CLI and it asks what the skill does, when it should trigger and whether it needs scripts, then drafts the skill for you.
Step 2: Add a script and a reference file
Instructions are good for judgement. For checks that should give the same answer every time, a script is better, and long checklists belong in a reference file the agent only opens when needed. Lay out the folder like this:
compose-review/
SKILL.md
scripts/
validate.sh
references/
checklist.mdSave a small validator as scripts/validate.sh and make it executable with chmod +x:
#!/usr/bin/env bash
# Usage: validate.sh path/to/compose.yaml
set -euo pipefail
file="${1:-compose.yaml}"
docker compose -f "$file" config --quiet
echo "OK: $file parses"
grep -nE 'image: [^:]+$|:latest' "$file" && echo "WARN: unpinned image tags above" || true
Then tell the agent when to use each file. Add this to the end of SKILL.md:
## Bundled files
- Before reviewing, run scripts/validate.sh with the compose file path.
If it fails, show the error and stop.
- For the full hardening checklist, read references/checklist.md.The spec asks for paths relative to the skill folder and for references only one level deep, so avoid a reference file that points to another reference file. Each tool helps the agent find the folder: OpenCode passes the skill’s base directory and a sample of up to ten supporting file paths when it loads a skill, Codex includes each skill’s file path in its list, and Claude Code offers a ${CLAUDE_SKILL_DIR} variable (Claude Code only) that expands to the skill’s folder.
Claude Code also documents a few body features that other tools do not, such as !`command` lines that run a shell command and inline the output before Claude reads the skill, and $ARGUMENTS placeholders. They are handy in a Claude-only skill, but OpenCode and Codex do not document them, so keep them out of a skill you plan to share.
Step 3: Share one skills folder across all three tools
With the skill in .agents/skills, Codex and OpenCode already find it. Claude Code needs a pointer from .claude/skills. Its docs say a skill folder in the personal, project or enterprise location can be a symlink to a directory elsewhere on disk, and that Claude Code reads SKILL.md from the target and loads the skill only once. Link each skill from the project root:
mkdir -p .claude/skills
ln -s ../../.agents/skills/compose-review .claude/skills/compose-review
ls -l .claude/skillsThe link target is relative, so the repository still works after someone clones it to another path. Commit both the .agents/skills folder and the link. Do the same for personal skills that should follow you into every project:
mkdir -p ~/.agents/skills ~/.claude/skills
mv ~/my-skills/release-notes ~/.agents/skills/
ln -s ~/.agents/skills/release-notes ~/.claude/skills/release-notes
Codex reads .agents/skills and ~/.agents/skills directly. Claude Code reads the symlinks in .claude/skills and ~/.claude/skills. OpenCode reads both .agents/skills and .claude/skills, so it finds the same skill twice under the same ID; because .agents/skills is registered after .claude/skills, that copy wins, and since both point at the same files, nothing changes. Do not also put a copy in .opencode/skills unless you want OpenCode to use a different version, because that folder overrides both.
Other agents that follow the standard can often read the same folder. Command Code, for example, also discovers .agents/skills, as we covered in whether OpenCode skills work in Command Code. Linking whole skills directories instead of individual skill folders is not described in Claude Code’s docs, so link each skill folder on its own.
Step 4: Control when a skill runs
By default all three tools can pick a skill on their own when a request matches its description, and you can also call one by name. For anything with side effects, such as a deploy or a message to a team channel, you usually want the agent to wait for you.
- Claude Code: type
/compose-reviewto run it. Adddisable-model-invocation: trueto the frontmatter so only you can start it; the description then leaves Claude’s context entirely.user-invocable: falsedoes the opposite and hides it from the/menu. In permission rules,Skill(deploy *)in the deny list blocks a skill, and denyingSkillturns skills off altogether. - OpenCode: mention
@compose-reviewin your prompt to load it yourself. The model loads skills through askilltool using the exact ID.disable-model-invocation: trueworks here too, as doesmetadatawithopencode/autoinvoke: false; either keeps the skill out of the model’s list while leaving it loadable by ID. Permission rules with theskillaction can allow, ask or deny by ID pattern. - Codex CLI: run
/skillsor type$compose-reviewin your prompt. To stop implicit use, addagents/openai.yamlto the skill folder withpolicyset toallow_implicit_invocation: false. To switch a skill off without deleting it, add a[[skills.config]]entry withenabled = falsein~/.codex/config.toml.
Since disable-model-invocation is honoured by both Claude Code and OpenCode, put it in SKILL.md and add the small Codex file next to it for a manual-only skill that behaves the same in all three:
# .agents/skills/deploy/agents/openai.yaml
policy:
allow_implicit_invocation: falseThe Codex equivalent for turning a skill off looks like this. Use either a path or a name in each entry, not both; when several entries match, the last one wins:
[[skills.config]]
name = "compose-review"
enabled = falseStep 5: Check that each tool found the skill
Do not assume a skill loaded just because the file exists. Each tool has a quick check:
- Claude Code: ask “What skills are available?” or open the
/menu. Claude Code watches skill folders and picks up new or edited skills during a session; if one does not appear, run/reload-skills.claude plugin validate .claude/skillsflagsSKILL.mdfiles whose frontmatter does not parse, and/doctorestimates how much context the skill listing uses. - OpenCode: load the skill directly with
@compose-review. If it is missing, remember the ID comes from the folder path, not thenamefield, and is case-sensitive. - Codex CLI: run
/skillsto see the list. Codex detects skill changes automatically; if an update does not show, restart Codex. - Any tool: the reference validator from the Agent Skills project checks frontmatter and naming with
skills-ref validate ./compose-review.
Then test the trigger. Ask something that matches the description without naming the skill, such as “check my compose file before I deploy”, and confirm the agent reaches for it. If you are new to running these agents, our guides to Claude Code with Ollama and Codex CLI and OpenCode with Ollama cover installation and local models.
Claude Code vs OpenCode vs Codex: Agent Skills compared
| Claude Code | OpenCode | Codex CLI | |
|---|---|---|---|
| Shared folder it reads | .claude/skills (needs symlinks to share) | .agents/skills and .claude/skills | .agents/skills |
| Call a skill yourself | /skill-name | @skill-id | $skill-name or /skills |
| What names the skill | Frontmatter name or folder name | File path (ID); name is a label | Frontmatter name |
| Manual-only switch | disable-model-invocation: true | disable-model-invocation: true or opencode/autoinvoke: false | allow_implicit_invocation: false in agents/openai.yaml |
| Turn off without deleting | skillOverrides set to "off" in settings | Permission rule with deny | [[skills.config]] with enabled = false |
| Skill list budget | 1% of context window; 1,536 characters per entry | Not stated | 2% of context window or 8,000 characters; skills.max_context_tokens up to 10,000 tokens |
| Picks up edits live | Yes; /reload-skills as a fallback | Lists skills at each model step | Yes; restart if an update is missing |
| Extras beyond the spec | Arguments, shell injection, subagents, hooks, paths, per-skill model | HTTP skill catalogs, extra folders via skills config | agents/openai.yaml UI metadata and tool dependencies, plugins |
Once invoked, a skill’s content stays in the conversation, and Claude Code does not re-read the file on later turns. After the conversation is compacted, it re-attaches only the first 5,000 tokens of each recent skill, within a combined 25,000-token budget. Put the most important instructions near the top of SKILL.md.
Troubleshooting Agent Skills
| Problem | Likely cause | Fix |
|---|---|---|
| Skill never triggers on its own | Description is vague or missing trigger words | Rewrite the description to say what it does and when, with words users type; front-load the key use case |
Claude Code skill works with /name but never automatically | Frontmatter YAML failed to parse, so the skill loaded with no fields | Check that --- is the first line; run claude --debug or claude plugin validate .claude/skills |
| Codex and OpenCode see the skill, Claude Code does not | Skill lives only in .agents/skills | Add a symlink in .claude/skills for each skill folder |
| OpenCode cannot find a skill by name | OpenCode uses the path-derived ID, not name | Use the folder name, exactly as cased, with @ |
| OpenCode loads an old version | A later source defines the same ID, such as .opencode/skills | Remove the duplicate or rename one skill |
| Claude Code runs the wrong skill | A personal skill with the same name beats the project one | Rename one of them; names should be unique |
| Codex shows two entries with one name | Codex does not merge same-named skills | Rename or disable one with [[skills.config]] |
| Descriptions look cut off | Too many skills for the listing budget | Trim descriptions; in Claude Code raise skillListingBudgetFraction, in Codex set skills.max_context_tokens |
| Skill triggers too often | Description is too broad | Narrow the description or make the skill manual-only |
| Claude stops following a skill midway | Conversation was compacted, or the rule should be enforced | Invoke the skill again; move must-hold rules into a hook |
| Skill missing in Claude Code cloud sessions | Cloud and Cowork sessions do not read ~/.claude/skills | Commit the skill to the repository’s .claude/skills or enable it for your claude.ai account |
My take
I’d start with the checklist you use most often. A release checklist is a good fit because you can keep the steps and reference files together, then ask any of the three tools to use them.
Save the tool-specific tricks, like Claude Code’s shell injection or Codex’s agents/openai.yaml interface fields, for skills you only use in one agent. The portable core is plain Markdown and a good description, and that is what makes a skill worth sharing.
Frequently asked questions
Do I need different SKILL.md files for each tool?
No. A skill that uses only the spec fields (name, description and the optional license, compatibility, metadata and allowed-tools) loads in all three. Only tool-specific extras, such as Claude Code’s context: fork or Codex’s agents/openai.yaml, are ignored or unsupported elsewhere.
Are skills the same as Claude Code custom slash commands?
Claude Code has merged custom commands into skills. Files in .claude/commands/ still work, but a skill folder can also hold scripts and reference files. Moving .claude/commands/deploy.md to .claude/skills/deploy/SKILL.md keeps the /deploy command.
How many skills can I install?
There is no hard count in the docs, but each skill’s name and description use context on every turn. When the list overflows its budget, Claude Code drops descriptions for the skills you use least, and Codex shortens descriptions first and may leave some skills out with a warning. Keep the set focused and switch off skills you never use; Claude Code’s /skill-doctor reports which ones are never invoked.
Can a skill run scripts on my machine?
Yes, through the agent’s normal shell tool, so your usual permission prompts still apply. In Claude Code, allowed-tools can pre-approve specific commands for the turn that invokes the skill. Treat skills from other people like any script you download: read SKILL.md and everything in scripts/ before you install it.
Should skills go in Git?
Project skills, yes. Committing .agents/skills and the .claude/skills links means everyone on the repository, and each of their agents, gets the same procedures. Keep personal habits in ~/.agents/skills instead, and never put secrets or tokens in a skill file.
- SourceOpenCode Docs: Skills

