# Where Are the Codex Plugin Command Files Located? (+ Full File Structure)

> Locate Codex plugin command files in the plugins codex commands directory. Discover their Markdown structure with YAML front-matter for metadata and execution.

- Repository: [OpenAI/codex-plugin-cc](https://github.com/openai/codex-plugin-cc)
- Tags: how-to-guide
- Published: 2026-07-03

---

**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`](https://github.com/openai/codex-plugin-cc/blob/main/review.md) | Run a Codex code review against local Git state | [`plugins/codex/commands/review.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/review.md) |
| [`adversarial-review.md`](https://github.com/openai/codex-plugin-cc/blob/main/adversarial-review.md) | Execute aggressive edge-case probing | [`plugins/codex/commands/adversarial-review.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/adversarial-review.md) |
| [`setup.md`](https://github.com/openai/codex-plugin-cc/blob/main/setup.md) | Initialize the Codex companion environment | [`plugins/codex/commands/setup.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/setup.md) |
| [`status.md`](https://github.com/openai/codex-plugin-cc/blob/main/status.md) | Display background review job status | [`plugins/codex/commands/status.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/status.md) |
| [`transfer.md`](https://github.com/openai/codex-plugin-cc/blob/main/transfer.md) | Move a running review to another session | [`plugins/codex/commands/transfer.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/transfer.md) |
| [`result.md`](https://github.com/openai/codex-plugin-cc/blob/main/result.md) | Retrieve final results of completed reviews | [`plugins/codex/commands/result.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/result.md) |
| [`cancel.md`](https://github.com/openai/codex-plugin-cc/blob/main/cancel.md) | Terminate running background reviews | [`plugins/codex/commands/cancel.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/cancel.md) |
| [`rescue.md`](https://github.com/openai/codex-plugin-cc/blob/main/rescue.md) | Trigger rescue agent for failed reviews | [`plugins/codex/commands/rescue.md`](https://github.com/openai/codex-plugin-cc/blob/main/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:
1. Locates [`plugins/codex/commands/review.md`](https://github.com/openai/codex-plugin-cc/blob/main/plugins/codex/commands/review.md)
2. Parses the metadata and argument schema
3. Invokes the companion script at `plugins/codex/scripts/codex-companion.mjs` with the extracted parameters

## Practical Examples

You can programmatically inspect the **Codex plugin command files** to verify available commands:

```javascript
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:

```markdown
/codex:review --wait --base main

```

This invocation reads [`plugins/codex/commands/review.md`](https://github.com/openai/codex-plugin-cc/blob/main/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`](https://github.com/openai/codex-plugin-cc/blob/main/review.md), [`setup.md`](https://github.com/openai/codex-plugin-cc/blob/main/setup.md), [`status.md`](https://github.com/openai/codex-plugin-cc/blob/main/status.md), [`transfer.md`](https://github.com/openai/codex-plugin-cc/blob/main/transfer.md), [`result.md`](https://github.com/openai/codex-plugin-cc/blob/main/result.md), [`cancel.md`](https://github.com/openai/codex-plugin-cc/blob/main/cancel.md), [`rescue.md`](https://github.com/openai/codex-plugin-cc/blob/main/rescue.md), and [`adversarial-review.md`](https://github.com/openai/codex-plugin-cc/blob/main/adversarial-review.md)
- **Runtime integration**: `plugins/codex/scripts/lib/codex.mjs` parses and registers commands; `plugins/codex/scripts/codex-companion.mjs` executes 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.