codex-plugin-cc
Otheropenai/codex-plugin-cc
Plugin to use Codex from Claude Code for code review and task delegation.
Overview
A plugin for Claude Code that integrates OpenAI's Codex, enabling code reviews, task delegation, and background jobs via slash commands. Supports review, adversarial review, transfer, and rescue workflows.
README Preview
# Codex plugin for Claude Code\n\nUse Codex from inside Claude Code for code reviews or to delegate tasks to Codex.\n\nThis plugin is for Claude Code users who want an easy way to start using Codex from the workflow\nthey already have.\n\n\n\n## What You Get\n\n- `/codex:review` for a normal read-only Codex review\n- `/codex:adversarial-review` for a steerable challenge review\n- `/codex:rescue`, `/codex:transfer`, `/codex:status`, `/codex:result`, and `/codex:cancel` to delegate work, hand off sessions, and manage background jobs\n\n## Requirements\n\n- **ChatGPT subscription (incl. Free) or OpenAI API key.**\n - Usage will contribute to your Codex usage limits. [Learn more](https://developers.openai.com/codex/pricing).\n- **Node.js 18.18 or later**\n\n## Install\n\nAdd the marketplace in Claude Code:\n\n```bash\n/plugin marketplace add openai/codex-plugin-cc\n```\n\nInstall the plugin:\n\n```bash\n/plugin install codex@openai-codex\n```\n\nReload plugins:\n\n```bash\n/reload-plugins\n```\n\nThen run:\n\n```bash\n/codex:setup\n```\n\n`/codex:setup` will tell you whether Codex is ready. If Codex is missing and npm is available, it can offer to install Codex for you.\n\nIf you prefer to install Codex yourself, use:\n\n```bash\nnpm install -g @openai/codex\n```\n\nIf Codex is installed but not logged in yet, run:\n\n```bash\n!codex login\n```\n\nAfter install, you should see:\n\n- the slash commands listed below\n- the `codex:codex-rescue` subagent in `/agents`\n\nOne simple first run is:\n\n```bash\n/codex:review --background\n/codex:status\n/codex:result\n```\n\n## Usage\n\n### `/codex:review`\n\nRuns a normal Codex review on your current work. It gives you the same quality of code review as running `/review` inside Codex directly.\n\n> [!NOTE]\n> Code review especially for multi-file changes might take a while. It's generally recommended to run it in the background.\n\nUse it when you want:\n\n- a review of your current uncommitted changes\n- a review of your bran
FAQ (5)
TroubleshootingHow do I fix Codex review/adversarial-review HTTP 400: 'gpt-5.6-sol model requires a newer version of Codex'?
This happens when the Codex desktop app writes model = "gpt-5.6-sol" to the shared ~/.codex/config.toml, but the npm CLI (@openai/codex up to 0.145.0) cannot use that model. The review and adversarial-review paths inherit this default and fail, even though normal task turns may work.
Workarounds:
1. Use a model supported by the npm CLI for the review call, for example:
node scripts/codex-companion.mjs review --wait --scope working-tree --model gpt-5.5
2. If you are editing a plugin command template, put --model gpt-5.5 inside the quoted arguments blob:
review "$ARGUMENTS --model gpt-5.5"Passing it as a separate argument can cause
normalizeArgv to treat the blob as focus text.
3. Or change the shared default in ~/.codex/config.toml:
model = "gpt-5.5"
Upgrading from npm CLI 0.142.1 to 0.145.0 does not fix this because no released npm CLI currently accepts gpt-5.6-sol.
TroubleshootingHow to fix taskkill "Invalid argument/option - 'C:/Program Files/Git/PID'" when running codex-companion cancel in Git Bash?
Git Bash/MSYS converts the /PID argument into a Windows path. Replace the Windows fallback with PowerShell: powershell.exe -NoProfile -Command "Stop-Process -Id <pid> -Force". As a temporary manual workaround, run this from PowerShell. If keeping taskkill, either prefix it with MSYS_NO_PATHCONV=1 or escape the flag with a double slash: MSYS_NO_PATHCONV=1 taskkill /PID <pid> /T /F or taskkill //PID <pid> //T //F.
TroubleshootingHow to fix '/codex:transfer' reporting "did not record an imported thread" on Windows even though the thread is created?
This is a false post-import lookup failure on Windows. The import succeeds, but the plugin fails to match the ledger record because the ledger stores the path with the \\?\ extended-length prefix while Node's realpathSync() does not, and the live Claude transcript changes after import, causing the content hash check to fail. Immediate workaround: open %USERPROFILE%\.codex\external_agent_session_imports.json, find the newest record with a valid imported_thread_id, then run codex resume <imported_thread_id>. Permanent fix: in scripts/lib/codex.mjs, update importedThreadIdForSource() to normalize both paths by stripping \\?\, converting / to \ and lowercasing on Windows, then match records by normalized source_path and a non-empty imported_thread_id. Treat content_sha256 as a preference: use the newest exact-hash match if present, otherwise fall back to the newest import for that source path instead of returning null. Affected verified setup: codex@openai-codex v1.0.6, Codex CLI 0.144.2, Node v24.15.0, Windows 11.
TroubleshootingHow to fix "EPERM: operation not permitted, unlink broker.pid" on Windows when running Codex background tasks?
Upgrade codex-plugin-cc to v1.3.0 or later. This release makes broker pid/log file deletion best-effort, so Windows EPERM errors from locked or concurrently deleted files no longer abort broker teardown and fail the job. If you cannot upgrade immediately, patch plugins/codex/scripts/lib/broker-lifecycle.mjs by wrapping both unguarded fs.unlinkSync(pidFile) and fs.unlinkSync(logFile) calls in try/catch, ignoring EPERM and ENOENT (or all cleanup errors, matching the other guarded teardown steps). Restart the Codex task after upgrading or patching.
TroubleshootingWhy does `codex-companion cancel` fail with `taskkill exit=1` in Git Bash on Windows?
Git Bash/MSYS converts taskkill flags such as /PID, /T, and /F into Windows paths when the command is launched through $SHELL, so taskkill receives invalid arguments.
**Preferred fix:** spawn taskkill.exe directly without a shell in scripts/lib/process.mjs when terminating a process tree:
spawnSync('taskkill.exe', ['/PID', String(pid), '/T', '/F'], {
shell: false,
windowsHide: true,
});
Alternatively, change the Windows shell option to always use cmd.exe instead of process.env.SHELL:
shell: process.platform === 'win32' ? true : false
**Immediate workaround:** run the cancel command with SHELL removed:
env -u SHELL node codex-companion.mjs cancel <jobId> --json
If spawning codex-companion from another Node process, delete SHELL from the child environment on Windows:
const env = { ...process.env };
if (process.platform === 'win32') delete env.SHELL;
For localized Windows versions, also handle taskkill exit code 128 as “process not found” instead of relying only on English error-message regexes.