Where Are the Codex Plugin Command Files Located? (+ Full File Structure)
All Codex plugin command files are stored in the plugins/codex/commands/ directory as Markdown files with YAML front-matter that defines command metadata and execution logic.
The openai/codex-plugin-cc repository implements its user-facing slash-commands as plain Markdown files rather than compiled code. This architectural decision places Codex plugin command files in a single, version-controlled directory where Claude can discover and execute them at runtime.
Command File Location in the Repository
According to the source code in openai/codex-plugin-cc, every command definition resides in:
plugins/codex/commands/
This path serves as the single source of truth for all available /codex:<command> invocations. When the plugin initializes, the runtime scans this directory, parses each .md file, and registers the command with Claude's slash-command system.
Structure of Command Files
Each file in plugins/codex/commands/ is a self-contained command definition that combines metadata with execution instructions.
Front-Matter Metadata
The runtime (plugins/codex/scripts/lib/codex.mjs) expects each command file to contain a YAML front-matter block specifying:
- Description: Human-readable purpose
- Allowed tools: Capabilities the command can invoke
- Arguments: CLI-style parameters accepted by the command
Available Commands
The repository ships with eight built-in Codex plugin command files:
| Command | Purpose | Source Path |
|---|---|---|
review.md |
Run a Codex code review against local Git state | plugins/codex/commands/review.md |
adversarial-review.md |
Execute aggressive edge-case probing | plugins/codex/commands/adversarial-review.md |
setup.md |
Initialize the Codex companion environment | plugins/codex/commands/setup.md |
status.md |
Display background review job status | plugins/codex/commands/status.md |
transfer.md |
Move a running review to another session | plugins/codex/commands/transfer.md |
result.md |
Retrieve final results of completed reviews | plugins/codex/commands/result.md |
cancel.md |
Terminate running background reviews | plugins/codex/commands/cancel.md |
rescue.md |
Trigger rescue agent for failed reviews | plugins/codex/commands/rescue.md |
How the Runtime Loads Commands
The plugin's runtime loader at plugins/codex/scripts/lib/codex.mjs implements the discovery mechanism. It reads the front-matter from each Markdown file in plugins/codex/commands/ and registers deterministic entry points.
When a user triggers /codex:review, the runtime:
- Locates
plugins/codex/commands/review.md - Parses the metadata and argument schema
- Invokes the companion script at
plugins/codex/scripts/codex-companion.mjswith the extracted parameters
Practical Examples
You can programmatically inspect the Codex plugin command files to verify available commands:
import fs from "fs";
import path from "path";
const commandsDir = path.join(__dirname, "plugins", "codex", "commands");
const commandFiles = fs.readdirSync(commandsDir).filter(f => f.endsWith(".md"));
console.log("Available Codex commands:", commandFiles);
To trigger a command from within a Claude conversation, use the slash-command syntax:
/codex:review --wait --base main
This invocation reads plugins/codex/commands/review.md, validates the --wait and --base arguments against the front-matter schema, and executes the "Foreground flow" logic defined in that file.
Summary
- Primary location: All command files live in
plugins/codex/commands/ - File format: Markdown with YAML front-matter defining metadata and execution flow
- Key files:
review.md,setup.md,status.md,transfer.md,result.md,cancel.md,rescue.md, andadversarial-review.md - Runtime integration:
plugins/codex/scripts/lib/codex.mjsparses and registers commands;plugins/codex/scripts/codex-companion.mjsexecutes them - Pattern: Commands are exposed via
/codex:<command>slash-commands in Claude
Frequently Asked Questions
What format are Codex plugin command files?
The command files are plain Markdown with YAML front-matter blocks. This format allows easy editing and version control while containing structured metadata (description, allowed tools, arguments) that the runtime at plugins/codex/scripts/lib/codex.mjs parses to register slash-commands.
How do I add a new command to the Codex plugin?
Create a new .md file in plugins/codex/commands/ containing a YAML front-matter block with description, tools, and argument definitions, followed by the execution logic or flow description. The runtime automatically discovers new files on the next plugin initialization.
Where is the runtime that executes these commands?
The runtime loader is implemented in plugins/codex/scripts/lib/codex.mjs, which handles parsing and registration. The actual execution is performed by plugins/codex/scripts/codex-companion.mjs, the companion script that carries out the actions described by each command file.
Can I modify existing commands without rebuilding the plugin?
Yes. Because Codex plugin command files are plain Markdown rather than compiled binaries, you can edit the files in plugins/codex/commands/ directly. Changes take effect immediately when the plugin reloads or when the next slash-command is invoked, assuming the front-matter remains valid.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →