Codex skills: where they live, how they load, and how to write one
Does Codex have skills? Yes: a Codex skill is a folder with a SKILL.md file that packages instructions, resources and optional scripts for a recurring task, and Codex loads it when your request matches. Skills follow the open agent skills standard, so the same folder can serve other clients too. This post covers the format, where Codex loads skills from, the context budget that decides what the model sees, and a worked example.
What a skill is
A skill is a directory; the only required file is SKILL.md with name and description in its frontmatter:
my-skill/
├── SKILL.md # required: instructions + metadata
├── scripts/ # optional: executable code
├── references/ # optional: documentation
└── assets/ # optional: templates, resources
Skills use progressive disclosure: Codex starts with each skill's name and description — plus its file path — and reads the full SKILL.md only when it decides to use the skill. That initial list has a budget: at most 2% of the model's context window, or 8,000 characters when the window size is unknown. With many skills installed, Codex shortens descriptions first and may omit skills from the list with a warning. The skills.max_context_tokens setting raises the budget, up to 10,000 tokens; it applies to the list only, not to the full instructions of a selected skill.
The practical consequence: the description is the part that always competes for attention. Front-load the trigger words and the scope, because a shortened description still has to match your request.
Where Codex loads skills from
The Codex skills folder locations form a ladder, per the skills documentation:
| Scope | Location | Use |
|---|---|---|
| Repository | .agents/skills in every directory from the working directory up to the repository root |
Skills checked in with the code, per module or for everyone |
| User | ~/.agents/skills |
Personal skills that apply in any repository |
| Admin | /etc/codex/skills |
Machine-wide defaults and automation |
Two skills with the same name are not merged; both can appear in the selectors. Restart Codex after changing skill configuration.
The user-level folder is worth a second look: ~/.agents/skills is the shared location that Codex, OpenCode, pi and octomind all read, so one skill installed there serves every client that reads the standard.
Invoking a skill
Two ways, both documented:
- Explicit: run
/skillsin the Codex CLI or IDE extension to list them, or type$to mention a skill directly in your prompt. This is the reliable way to use a Codex CLI skill you know you want. - Implicit: Codex selects a skill when your task matches its
description. No command needed — and no guarantee, which is why the description matters.
There is also a built-in creator: invoke $skill-creator and it asks what the skill does, when it should trigger, and whether it needs scripts. Instruction-only is the default.
A worked example
A skill for the task every repository repeats — repairing a failing test run. Create .agents/skills/fix-ci/SKILL.md in the repository:
---
name: fix-ci
description: Repair a failing test or CI run. Use when tests fail after a change, or when asked to fix the build. Not for writing new tests.
---
1. Run the failing suite and read the full error output.
2. Name the failing assertion and the code path it exercises.
3. Make the smallest change that fixes the cause, not the symptom.
4. Re-run the suite. If it still fails, report what remains instead of editing the test to pass.
That is a complete, installable skill — no scripts, no manifest. The documented best practices apply: one job per skill, instructions over scripts unless you need deterministic behavior, imperative steps with explicit inputs and outputs, and a description tested against the prompts you expect to trigger it. To distribute a skill beyond your own machine, package it as a plugin through the directory Codex shares with ChatGPT.
Skills are advice, not enforcement
A skill tells the agent how to work; nothing in the format makes it obey. Step 4 above — "report what remains instead of editing the test to pass" — is exactly the kind of rule a model can skip under pressure to finish. The decay is measured: in our Codex benchmark, rules from an earlier session were broken 49 times in 128 requests across five projects, and 3 times with Besydr.
Besydr (say: besider) is a program that runs beside a coding agent and learns from its sessions, and it meets skills where they live. It can compile grounded lessons from your corrections into candidate skills, runs each in a trial before keeping it, and writes a kept skill that applies everywhere to ~/.agents/skills/<name>/SKILL.md — the same shared folder Codex reads, so the client loads it like any skill you installed yourself. Skills in a trial are never written there; they reach only the sessions where they apply, so the trial's control group stays clean. The learning documentation describes the states and the trial. Alongside the advice, Besydr checks proposed tool calls against your stated rules and can deny a conflicting call — the check a skill file cannot perform. The local program is free with octomind and needs a licence with Codex after a trial.
Sources and method
- Format, progressive disclosure, budget, locations, invocation and best practices: the Codex skills page, read 2026-11-30.
- The fix-ci skill is an example written for this post from the documented format, not a tested configuration.
- The 49-to-3 number: our Codex benchmark, five projects, two models, repeated runs.
- Besydr's generated skills and the shared folder: the learning documentation.
- This post was drafted with AI assistance from these sources.