{"slug": "codex-skills-where-they-live-how-they-load-and-how-to-write-one", "title": "Codex skills: where they live, how they load, and how to write one", "summary": "OpenAI's Codex loads skills from a folder containing a required SKILL.md file with name and description frontmatter, following the open agent skills standard so the same folder works in other clients, according to OpenAI's Codex skills documentation. Codex reads only each skill's name, description and file path up front, capped at 2% of the model's context window or 8,000 characters when the window size is unknown, and the skills.max_context_tokens setting can raise that budget to 10,000 tokens. Skills load from .agents/skills in every directory up to the repository root, from ~/.agents/skills for user-level skills shared by Codex, OpenCode, pi and octomind, and from /etc/codex/skills for machine-wide defaults, with same-named skills not merged and a restart required after configuration changes.", "body_md": "# Codex skills: where they live, how they load, and how to write one\n\nDoes 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](https://developers.openai.com/codex/skills), 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.\n\n## What a skill is\n\nA skill is a directory; the only required file is `SKILL.md` with `name` and `description` in its frontmatter:\n\n```\nmy-skill/\n├── SKILL.md      # required: instructions + metadata\n├── scripts/      # optional: executable code\n├── references/   # optional: documentation\n└── assets/       # optional: templates, resources\n```\n\nSkills 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.\n\nThe 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.\n\n## Where Codex loads skills from\n\nThe Codex skills folder locations form a ladder, per the [skills documentation](https://developers.openai.com/codex/skills):\n\n| Scope | Location | Use | \n|---|---|---|\n| 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 | \n| User | `~/.agents/skills` | Personal skills that apply in any repository | \n| Admin | `/etc/codex/skills` | Machine-wide defaults and automation | \n\nTwo skills with the same `name` are not merged; both can appear in the selectors. Restart Codex after changing skill configuration.\n\nThe 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.\n\n## Invoking a skill\n\nTwo ways, both documented:\n\n- **Explicit** : run`/skills` in 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.\n- **Implicit** : Codex selects a skill when your task matches its`description` . No command needed — and no guarantee, which is why the description matters.\n\nThere 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.\n\n## A worked example\n\nA skill for the task every repository repeats — repairing a failing test run. Create `.agents/skills/fix-ci/SKILL.md` in the repository:\n\n```\n---\nname: fix-ci\ndescription: 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.\n---\n\n1. Run the failing suite and read the full error output.\n2. Name the failing assertion and the code path it exercises.\n3. Make the smallest change that fixes the cause, not the symptom.\n4. Re-run the suite. If it still fails, report what remains instead of editing the test to pass.\n```\n\nThat 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.\n\n## Skills are advice, not enforcement\n\nA 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](https://besydr.com/blog/codex-benchmark-with-and-without-besydr), rules from an earlier session were broken 49 times in 128 requests across five projects, and 3 times with Besydr.\n\nBesydr (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](https://besydr.com/docs/learning) 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](https://besydr.com/pricing) with Codex after a trial.\n\n## Sources and method\n\n- Format, progressive disclosure, budget, locations, invocation and best practices: the [Codex skills page](https://developers.openai.com/codex/skills) , read 2026-11-30.\n- The fix-ci skill is an example written for this post from the documented format, not a tested configuration.\n- The 49-to-3 number: [our Codex benchmark](https://besydr.com/blog/codex-benchmark-with-and-without-besydr) , five projects, two models, repeated runs.\n- Besydr's generated skills and the shared folder: the [learning documentation](https://besydr.com/docs/learning) .\n- This post was drafted with AI assistance from these sources.", "url": "https://wpnews.pro/news/codex-skills-where-they-live-how-they-load-and-how-to-write-one", "canonical_source": "https://besydr.com/blog/codex-skills-guide", "published_at": "2026-12-05 15:42:55.255139+00:00", "updated_at": "2026-12-05 15:42:57.791564+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "agent-protocols"], "entities": ["OpenAI", "Codex", "OpenCode", "pi", "octomind"], "also_reported_by": [], "takeaway": "Keep each skill's description front-loaded with trigger words and scope, because Codex budgets the skill list at 2% of the context window (8,000 characters if unknown) and shortens descriptions first when many skills are installed.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/codex-skills-where-they-live-how-they-load-and-how-to-write-one", "markdown": "https://wpnews.pro/news/codex-skills-where-they-live-how-they-load-and-how-to-write-one.md", "text": "https://wpnews.pro/news/codex-skills-where-they-live-how-they-load-and-how-to-write-one.txt", "jsonld": "https://wpnews.pro/news/codex-skills-where-they-live-how-they-load-and-how-to-write-one.jsonld"}}