How openai/codex-plugin-cc works
This is a Claude Code plugin that delegates reviews and coding tasks to Codex. The principal workflow is: a Claude user invokes a slash command, the companion resolves review or task context, optionally records a background job, sends work through the Codex app-server runtime, persists status/results, and renders output back to Claude. Distinct stages include command dispatch, target preparation, execution, job lifecycle, and result presentation. The graph also includes session transfer and the optional stop-time review gate. Some command wiring is inferred from the README and tree; unsampled implementation links are omitted.
Main entry points: codex-companion.mjs Companion CLI · app-server.mjs App Server Client · state.mjs Job State Store · transfer.md Transfer Command
Components 21
Command Interfaces
- Review Command
plugins/codex/commands/review.md - Adversarial Review
plugins/codex/commands/adversarial-review.md - Rescue Command
plugins/codex/commands/rescue.md - Transfer Command
plugins/codex/commands/transfer.md - Status Command
plugins/codex/commands/status.md - Result Command
plugins/codex/commands/result.md - Cancel Command
plugins/codex/commands/cancel.md - Setup Command
plugins/codex/commands/setup.md
Task Orchestration
- Companion CLI
plugins/codex/scripts/codex-companion.mjs - Git Context
plugins/codex/scripts/lib/git.mjs - Job Control
plugins/codex/scripts/lib/job-control.mjs - Result Rendering
plugins/codex/scripts/lib/render.mjs
Codex Runtime
- App Server Client
plugins/codex/scripts/lib/app-server.mjs - Runtime Broker
plugins/codex/scripts/app-server-broker.mjs - Codex App Server
State And Hooks
- Job State Store
plugins/codex/scripts/lib/state.mjs - Session Transfer
plugins/codex/scripts/lib/claude-session-transfer.mjs - Session Lifecycle
plugins/codex/scripts/session-lifecycle-hook.mjs - Stop Review Gate
plugins/codex/scripts/stop-review-gate-hook.mjs
Other components
- Claude User
- Claude Filesystem
Connections 33
- Claude User → Review Command: invokes
- Claude User → Adversarial Review: invokes
- Claude User → Rescue Command: invokes
- Claude User → Transfer Command: invokes
- Claude User → Status Command: invokes
- Claude User → Result Command: invokes
- Claude User → Cancel Command: invokes
- Claude User → Setup Command: invokes
- Review Command → Companion CLI: dispatches
- Adversarial Review → Companion CLI: dispatches
- Rescue Command → Companion CLI: dispatches
- Transfer Command → Companion CLI: dispatches
- Status Command → Companion CLI: dispatches
- Result Command → Companion CLI: dispatches
- Cancel Command → Companion CLI: dispatches
- Setup Command → Companion CLI: dispatches
- Companion CLI → Git Context: resolves targets
- Companion CLI → Job Control: manages jobs
- Companion CLI → App Server Client: runs turns
- Companion CLI → Result Rendering: renders output
- Job Control → Job State Store: reads jobs
- Job Control → App Server Client: checks runtime
- App Server Client → Runtime Broker: uses broker
- App Server Client → Codex App Server: sends requests
- Runtime Broker → Codex App Server: proxies requests
- Companion CLI → Job State Store: writes jobs
- Session Transfer → Claude Filesystem: reads transcript
- Transfer Command → Session Transfer: imports session
- Session Lifecycle → Job State Store: cleans jobs
- Session Lifecycle → Runtime Broker: shuts down
- Stop Review Gate → Job State Store: checks jobs
- Stop Review Gate → Companion CLI: runs review
- Companion CLI → Claude User: returns results