How to Use Agent Skills with Codex CLI [Setup to Execution]
Agent Skills work not only with Claude Code but also with OpenAI Codex CLI.
This article explains how to install and use skills with Codex CLI. We'll also compare with Claude Code, helpful if you want to use both tools.
What is Codex CLI
Codex CLI is OpenAI's terminal-based AI coding agent. As of January 2026, it supports the GPT-5.2-Codex model with enhanced long-horizon task handling and security features.
Installation
npm install -g @openai/codex-cli
You'll need to configure your OpenAI API key on first launch.
Skill Placement
Skill placement in Codex CLI is similar to Claude Code.
Project-Specific
your-project/
└── .codex/
└── skills/
└── my-skill/
└── SKILL.md
Global
~/.codex/
└── skills/
└── my-skill/
└── SKILL.md
Installing Skills
Using the Built-in Installer
Codex CLI has a built-in skill installer:
/skills
This command lets you search and install available skills.
Manual Installation
- Download SKILL.md from GitHub
- Copy to the placement location above
mkdir -p ~/.codex/skills/code-review
cp SKILL.md ~/.codex/skills/code-review/
Invoking Skills
Call with $skill-name
In Codex CLI, use the $ prefix to invoke skills:
$code-review
This is equivalent to /code-review in Claude Code.
Natural Language Invocation
Like Claude Code, natural language requests auto-apply relevant skills:
Review the code in this PR
Differences from Claude Code
| Item | Claude Code | Codex CLI |
|---|---|---|
| Invocation | /skill-name | $skill-name |
| Config Directory | .claude/ | .codex/ |
| Model | Claude Opus 4.5 | GPT-5.2-Codex |
| Subagents | ✓ | - |
| Skill Installer | /install-skill | /skills (built-in) |
Compatibility
The basic SKILL.md format is shared, so the same skill works in both tools. However, note:
- scripts/ execution: May behave differently
- Tool-specific features: Claude Code subagents won't work
Leveraging GPT-5.2-Codex
The January 2026 update brought GPT-5.2-Codex support to Codex CLI. Here's how to leverage this model's strengths with skills.
Large-Scale Refactoring
GPT-5.2-Codex has enhanced context compaction, excelling at large codebase work.
$refactor-codebase
Long refactoring tasks can run without losing context.
Security Reviews
Enhanced security features make it a good match for vulnerability detection skills.
$security-audit
Common Issues
Skill Not Recognized
- Verify directory is
.codex/skills/ - Verify SKILL.md frontmatter is correct
$ Command Not Working
If skill name contains hyphens, you may need quotes:
$"code-review"
Tips for Using Both Tools
Share the Same Skill
Use symbolic links to share skills between both tools:
# Place skill for Claude Code
mkdir -p ~/.claude/skills/code-review
cp SKILL.md ~/.claude/skills/code-review/
# Symlink for Codex CLI
mkdir -p ~/.codex/skills
ln -s ~/.claude/skills/code-review ~/.codex/skills/code-review
When to Use Which
- Claude Code: Highest SWE-bench accuracy. General coding tasks
- Codex CLI: Long-horizon tasks, security analysis
Try both and choose based on the task.
Summary
Agent Skills work with Codex CLI too.
- Invoke with
$skill-name - Place in
~/.codex/skills/ - Basic format shared with Claude Code
Browse the Skills list and try skills with Codex CLI.
Related Articles
- How to Set Up Skills in Claude Code - Claude Code setup
- How to Use Skills with Cursor - For IDE users
- How to Use Skills with GitHub Copilot - For VS Code users
- AI Coding Tools Comparison 2026 - Understand tool differences