How to Use the Codex Plugin in Claude Code for Code Reviews and Task Delegation
Introduction
Are you looking to streamline your code review process or delegate tasks more efficiently while using Claude Code? The Codex plugin is designed to integrate seamlessly into your existing workflow, allowing you to perform code reviews, challenge design decisions, and handle complex tasks directly within Claude Code. This guide will walk you through the installation, usage, and common questions based on official documentation, making it easy for anyone with a technical background to get started.
The Codex plugin simplifies your development workflow by eliminating the need to switch between tools. Whether you’re a beginner or an experienced developer, this article provides practical steps to leverage the plugin’s features. We’ll cover everything from installation to advanced usage, ensuring you can quickly adopt this tool to enhance your productivity.
Installation Guide
Installing the Codex plugin is straightforward, but you need to meet specific requirements first. You’ll need a ChatGPT subscription (including the free tier) or an OpenAI API key, as well as Node.js version 18.18 or later. The plugin will use your Codex usage limits, so ensure your account is active.
Step-by-Step Installation
Follow these steps to install the plugin in Claude Code:
-
Add the Marketplace and Install the Plugin
Run the following commands in Claude Code:/plugin marketplace add openai/codex-plugin-cc /plugin install codex@openai-codexAfter installation, reload the plugins:
/reload-plugins -
Run the Setup Command
Execute the setup command to check if Codex is ready:/codex:setupThis command verifies Codex installation. If Codex is missing and npm is available, it may offer to install it for you. Alternatively, you can install Codex manually:
npm install -g @openai/codexIf Codex is installed but not logged in, run:
!codex login -
Verify the Installation
After logging in, test the plugin with a simple command:/codex:review --background /codex:status /codex:resultThis starts a background review task and checks its status and results. If everything works, the plugin is successfully installed.
Feature Overview
The Codex plugin provides several commands for code review and task management. Below, we explain each command’s functionality, use cases, and examples in detail.
/codex:review – Standard Code Review
This command runs a normal Codex code review, similar to executing /review directly in Codex. It offers read-only review without modifying your code.
Use Cases:
-
Review uncommitted changes in your current work. -
Compare your branch against a base branch like main.
Command Examples:
-
/codex:review: Reviews the current work. -
/codex:review --base main: Reviews changes compared to themainbranch. -
/codex:review --background: Runs the review in the background, ideal for multi-file changes that may take time.
Note: This command is read-only and does not perform any changes. When run in the background, use /codex:status to check progress or /codex:cancel to stop the task.
/codex:adversarial-review – Challenge-Oriented Review
This command runs a steerable review that questions your implementation and design. It helps pressure-test assumptions, trade-offs, and failure modes to identify safer or simpler alternatives.
Use Cases:
-
Challenge the direction of your code before shipping, not just the details. -
Focus on design choices, hidden assumptions, and alternative approaches. -
Test specific risk areas like authentication, data loss, rollback, race conditions, or reliability.
Command Examples:
-
/codex:adversarial-review: Runs a basic adversarial review. -
/codex:adversarial-review --base main challenge whether this was the right caching and retry design: Reviews caching and retry designs. -
/codex:adversarial-review --background look for race conditions and question the chosen approach: Searches for race conditions in the background.
Note: This command is also read-only and does not fix code. It supports flags like --base, --wait, and --background, and you can add focus text after the flags.
/codex:rescue – Delegate Tasks to Codex
This command delegates tasks to Codex through the codex:codex-rescue subagent. You can ask Codex to investigate bugs, try fixes, continue previous tasks, or use smaller models for faster or cheaper processing.
Use Cases:
-
Investigate why tests are failing. -
Attempt to fix a failing test. -
Continue a previous Codex task. -
Use a smaller model for a quick pass.
Command Examples:
-
/codex:rescue investigate why the tests started failing: Investigates test failures. -
/codex:rescue fix the failing test with the smallest safe patch: Fixes a failing test. -
/codex:rescue --resume apply the top fix from the last run: Continues the latest task. -
/codex:rescue --model gpt-5.4-mini --effort medium investigate the flaky integration test: Uses a specific model to investigate flaky tests. -
/codex:rescue --background investigate the regression: Investigates regressions in the background.
Note: Tasks may take a long time, so running them in the background is recommended. If you don’t specify --model or --effort, Codex uses defaults. Saying “spark” maps to the gpt-5.3-codex-spark model.
/codex:status – Check Task Status
This command shows running and recent Codex jobs for the current repository.
Use Cases:
-
Check progress on background work. -
See the latest completed job. -
Confirm if a task is still running.
Command Examples:
-
/codex:status: Views all task statuses. -
/codex:status task-abc123: Views the status of a specific task.
/codex:result – View Task Results
This command displays the final stored output for a finished job. If available, it includes the Codex session ID, allowing you to reopen the run directly in Codex using codex resume <session-id>.
Use Cases:
-
View output from completed tasks. -
Get a session ID to continue tasks in Codex.
Command Examples:
-
/codex:result: Views the latest task results. -
/codex:result task-abc123: Views results for a specific task.
/codex:cancel – Cancel Tasks
This command cancels an active background Codex job.
Use Cases:
-
Stop unnecessary background tasks.
Command Examples:
-
/codex:cancel: Cancels the latest task. -
/codex:cancel task-abc123: Cancels a specific task.
/codex:setup – Setup and Configuration
This command checks if Codex is installed and authenticated. If Codex is missing and npm is available, it can offer to install it. You can also use it to manage the optional review gate.
Enabling the Review Gate:
-
/codex:setup --enable-review-gate: Enables the review gate. -
/codex:setup --disable-review-gate: Disables the review gate.
The review gate runs a targeted Codex review based on Claude’s response, blocking stops if issues are found. However, this can create long loops and drain usage limits quickly, so only enable it when actively monitoring your session.
Usage Examples
Here are practical examples of how to use these commands in typical workflows.
Example 1: Pre-Release Review
Before releasing code, perform a standard review:
/codex:review
This reviews your current work and provides code quality feedback. For large changes, run it in the background:
/codex:review --background
/codex:status
/codex:result
Example 2: Delegating Problems to Codex
When you encounter an issue, delegate it to Codex for investigation:
/codex:rescue investigate why the build is failing in CI
Codex will attempt to find the cause of the build failure. For complex tasks, run in the background:
/codex:rescue --background investigate the flaky test
/codex:status
/codex:result
Example 3: Challenging Design Decisions
If you have doubts about a design, use an adversarial review:
/codex:adversarial-review --base main challenge whether this was the right caching and retry design
This helps pressure-test your design choices and identify potential issues.
Integration and Configuration
The Codex plugin works through your local Codex CLI and app server. It uses the global codex binary and applies the same configuration as direct Codex usage.
Common Configurations
You can define default models and reasoning efforts in user-level or project-level config.toml files. For example, add the following to .codex/config.toml at your project root:
model = "gpt-5.4-mini"
model_reasoning_effort = "xhigh"
Configuration loads in this order:
-
User-level config: ~/.codex/config.toml -
Project-level overrides: .codex/config.toml(only when the project is trusted)
For more options, refer to the Codex documentation.
Moving Work to Codex
After delegating tasks or running the review gate, you can continue work directly in Codex. Use codex resume with the session ID from /codex:result or /codex:status, or select it from the list.
FAQ
Here are answers to common questions based on the official documentation.
Do I need a separate Codex account for this plugin?
If you’re already signed into Codex on your machine, that account should work immediately. The plugin uses your local Codex CLI authentication. If you only use Claude Code and haven’t used Codex, you’ll need to sign in with a ChatGPT account or API key. Run /codex:setup to check status, and use !codex login if needed.
Does the plugin use a separate Codex runtime?
No, the plugin delegates through your local Codex CLI and app server. This means it uses the same Codex installation, authentication state, repository checkout, and machine-local environment.
Will it use the same Codex config I already have?
Yes, if you already use Codex, the plugin picks up the same configuration, including model and reasoning effort settings.
Can I keep using my current API key or base URL setup?
Yes, because the plugin uses your local Codex CLI, your existing sign-in method and config still apply. To point the OpenAI provider at a different endpoint, set openai_base_url in your Codex config.
How can I avoid background tasks consuming too many usage limits?
Monitor task progress using /codex:status, and cancel tasks when no longer needed. The review gate can increase usage, so only enable it when necessary.
What models does the plugin support?
The plugin supports Codex default models. You can also specify models via the --model flag, such as gpt-5.4-mini or spark (which maps to gpt-5.3-codex-spark).
Conclusion
The Codex plugin integrates code review and task delegation seamlessly into Claude Code, helping you manage your development workflow efficiently. By following the installation steps and using the commands outlined, you can handle everything from code reviews to error investigations without leaving your familiar environment.
Remember, the installation and usage steps are based on official documentation—ensure your environment meets the requirements. If you encounter issues, refer to the FAQ or run /codex:setup for checks. This plugin aims to simplify your work, not add complexity, so start with simple commands and gradually explore more features.
With this guide, you should be able to get started with the Codex plugin and leverage its value in your daily development. If you have more questions, try these commands in Claude Code or consult the official documentation for updates.

