Claude Code and Codex Collaborative Development Guidelines

# Why does it have to be this way?

In a nutshell: * * Let the expensive models work, let the cheap models work, and the bills don't explode. * *

Claude is good at understanding requirements, architectural planning, complex reasoning, but the price is also there - with it to write a lot of code, Token burns fast.Codex The code is powerful, fast, and the key is that the price is much cheaper.

So the most reasonable pairing is:

      • Claude is responsible for planning * *: understanding your needs, disassembling tasks, making architectural decisions, figuring out what to do
    • *Codex Execute * *: write code, fix bugs, run tests by /codex:rescue taking over specific coding tasks
    • *Codex Responsible for review * *: act as /codex:review a second pair of eyes by doing a code review for Claude's code

The core logic of this collocation is that Claude's token is only spent on "thinking clearly", and the specific coding and review are handed over to the cheaper oneCodex. Significantly reduces overall overhead for Claude Code people who use it intensely every day.

> This guide assumes that you have completed the Codex installation configuration for Claude Code and.If not, please refer to:
> - Claude Code Configuration: [yycodeQuick Start Guide] (DragonCode Quick Start Guide.md)
> -ConfigurationCodex: [yycode× Codex Quick Start Guide] (CodexDragonCode-Quick Start Guide.md)


# 1. Installing the Codex Plugin

After both sides are matched, a plug-in can be installed Claude Code in the string:

/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup

Automatically /codex:setup detects Codex if it is installed and certified. If prompted not to log in, run !codex login to complete authentication.

After the installation /codex is complete, enter to see the new slash command.


# 2. Core Commands

There are three types of capabilities in this plugin: * * Review * *, * * Delegate Tasks * *, and * * Task Management * *.

# # Censorship class (read-only, no code changes)

Command Role
/codex:review
/codex:adversarial-review Adversarial review - not just checking code, but actively questioning your design decisions

`` `bash

Review unsubmitted changes

/codex: review

Review the differences between the current branch and main

/codex: review --base main

Runs in the background without blocking the current conversation

/codex: review --background

AdversarialCensorship, Specify Direction of Focus

/codex: adversarial-review --background checks for race conditions, questioning cache policy selection


# # # Delegation class (delegates tasks to Codex execution)

| Command | Role |
| --- | --- |
 `/codex:rescue` | | Delegate a specific task Codex to actually modifyCodex the code |

This is the core command to achieve Claude Planning,Codex Execution. You can turn Claude's planned tasks Codex into reality one by one:

`` `bash
# LetCodex's check for bugs
/codex: rescue investigate why the tests started failing

# Let Codex go fix bugs
/codex: rescue fix the failing test with the smallest safe patch

# Let Codex go to implement a function
/codex: rescue Implement form validation logic for user registration

# Background execution, suitable for time-consuming tasks
/codex: rescue --background refactor database connection pool

# Specify a cheaper model to save even more
/codex: rescue --model gpt-5.4-mini write a set of unit test overrides utils.ts
/codex: rescue --model spark Quickly fix this lint error

# Proceed to the last task
/codex: rescue --resume Apply last fix

> 💡 * * Money-saving tips * *:--model gpt-5.4-mini Or --model spark you can perform simple tasks with cheaper and faster models.

# # Task management class

Command Role
/codex:status
/codex:result Get the results of a completed task with a session ID that can be continued Codex in
/codex:cancel Cancel a running background task

# 3. Recommended Workflow: Claude Planning,Codex Execution

# # Daily Development Process

你提需求 → Claude 分析拆解 → /codex:rescue 逐个执行 → /codex:review 审查 → 提交
      • Describe your needs in natural language * * so Claude understands what you want
      • Claude does the planning * *: disassemble the task, determine the implementation plan, sort out the order - this is what Claude is best at
      • /codex:rescue Give specific coding tasks to Codex* *: Claude plans to "do A, B, C three things", you use rescue Codex to write one by one
      • Code completion run review * *:/codex:review --background, let's Codex do an independent code review
  1. Submit after fixing according to the review

The benefit of this process is that Claude's Token is only spent on planning and understanding, and a lot Codex of coding work goes inexpensively.

# # High Risk Change Process

Add one more layer of adversarial review when it comes to database migration, certification authorization, infrastructure changes:

Claude 规划 → /codex:rescue 执行 → /codex:review → 修复 → /codex:adversarial-review → 再修复 → 提交

Adversarial review will actively question your design - such as "Why choose this caching strategy", "Have you considered the rollback scheme", "Is there a race condition here?". This stress test is required for high-risk changes.

# # When Claude gets stuck

If Claude's repeated attempts at a task are not ideal, try Codex it instead:

/codex:rescue 用最小改动修复这个问题

The idea of changing the model often breaks the deadlock.


# 4. Run in the background (recommended)

Both review and rescue tasks recommend adding --backgroundwithout blocking the current conversation:

/codex:rescue --background 实现分页功能
# 继续和 Claude 聊别的事...
/codex:status          # 随时看进度
/codex:result          # 完成后取结果

> /codex:result returns a session ID that you can use codex resume <session-id> Codex in to continue the task.


# 5. Review access control (optional)

When turnedClaude Code on, a Codex review is automatically triggered before completing the task, and if a problem is found, the process is interrupted and fixed:

/codex:setup --enable-review-gate    # 开启
/codex:setup --disable-review-gate   # 关闭

> ⚠️ * * Note * *: Reviewing access gates will significantly increase token consumption and may result in a long loop Codex between Claude and. It is recommended to use it only in key projects, just run it manually for /codex:review daily development.


# 6. Codex Model Configuration

If you want to change the model or inference strength used by Codex default, you can do so in the configuration file.

User-level configuration:~/.codex/config.toml
Project-level configuration: under project root .codex/config.toml

model = "gpt-5.4-mini"
model_reasoning_effort = "high"

It can also be specified --effort temporarily via --model and on each call:

/codex:rescue --model spark --effort medium 快速修复 lint 错误

# 7. When not to use Codex

Claude is recommended throughout:

Scenario Reason
Deep Business Logic Refactoring Unable to Codex get the full context accumulated in Claude's conversation, the generated code may not be consistent with the project style
Tasks that require deep cross-file understanding Codex rescue runs independently and does not share Claude's conversation history
Tasks with very little code Only a few lines of code, no need to delegate, just make Claude write faster

# 8. Practical tips

      • Cheap models for simple tasks * *:--model spark suitable for repairing lint and writing boilerplate code that does not require deep reasoning
      • Review before adversarial-review * *: Don't come up and use adversarial review, first review the basic questions with ordinary review
      • Make the most of --resume * *:/codex:rescue --resume you can continue with your last Codex assignment without having to start from scratch
      • Focus on both sides of the dosage * *: Although it is more economical overall, remember to pay attention to the dosage of both Claude and OpenAI at the same time to avoid accidental overspending on one side
      • Skill Conflict Handling * *: If your custom Skill and Codex plugin have trigger word conflicts, add them in Skill Conflict priority: low

FAQ

    • Q: Don't see the /codex command after installing the plugin? * *
      A: Perform /reload-plugins a reload of the plugin.
    • Q:/codex:review Report an authentication error? * *
      A: The Codex certification described is not suitable.Refer to the [yycode× Codex Quick Start Guide]Codex (DragonCode-Quick Start Guide.md) to reconfigure or run login !codex login again.
    • Q: What's/codex:rescue the difference from having Claude write the code directly? * *
      A: rescue is to give the task to Codex independent execution, consuming OpenAI credits instead of Claude Token.Suitable for standardized coding tasks.But you can't Codex get the context of your conversation with Claude, so write the task description clearly.
    • Q: What if the review results contradict Claude's judgment? * *
      A: This is precisely the value of dual-model collaboration.When the two sides disagree, you as the developer make the final decision.
    • Q: How much can I save? * *
      A: It depends on how much coding work you hand overCodex.If you have a high proportion of code generation in your workflow (such as writing a lot of tests, writing CRUDs), you can rescue these and Claude's consumption can be greatly reduced.
Full page copied