From claudex
Use when a task involves heavy codebase exploration, drafting code or refactors, hunting edge cases, or getting an independent second-opinion review — and you want to conserve Claude/Anthropic tokens by delegating to the OpenAI Codex sub-agent. Also use when the user mentions Codex, delegating to save tokens, or cross-checking work with a second model.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claudex:codexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The `codex` MCP server runs **OpenAI Codex (GPT-5.x at xhigh reasoning)** as a sub-agent. Codex reads files and reasons inside **its own** context and returns only the result, so the heavy reading/drafting runs on OpenAI's quota instead of Anthropic tokens. **Claude stays the supervisor and makes the final call.**
The codex MCP server runs OpenAI Codex (GPT-5.x at xhigh reasoning) as a sub-agent. Codex reads files and reasons inside its own context and returns only the result, so the heavy reading/drafting runs on OpenAI's quota instead of Anthropic tokens. Claude stays the supervisor and makes the final call.
Core principle: delegate the token-heavy work, keep the judgment. Quality is protected by review, not by doing everything yourself.
| Need | Action |
|---|---|
| In-session delegation | Call the codex MCP tool (mcp__plugin_claudex_codex__codex) with a focused prompt |
| Deterministic CLI fallback | codex exec -C <code-dir> -s read-only --skip-git-repo-check "<task>" |
| Codex must write a patch | Use a writable sandbox, scoped to the code dir, no secrets in scope |
| Discover the exact MCP tool | /mcp, or ToolSearch for "codex" |
Scope first, then phrase a focused request — vague tasks make Codex guess:
Task: <one concrete goal>
Files in scope: <explicit paths or the diff> # never secrets/.env/keys; never a whole dataset dir
Constraints: read-only unless a patch is required; do not read beyond the listed paths
Deliver: <review findings | a patch | edge cases>, concise, with file:line references
Map it to a call:
codex tool with cwd=<code-dir>, sandbox=read-only (use workspace-write only for patches), and the prompt above.codex exec -C <code-dir> -s read-only --skip-git-repo-check "<prompt>".env, private keys, credentials, tokens, SSH/cloud auth to Codex.-C.codex exec).The user picks the Claude↔Codex split with /claudex:mode (solo | balanced | codex | max, default balanced). A UserPromptSubmit hook injects the active mode each turn — honor it: solo = do it yourself; codex/max = delegate drafting/reading/generation to Codex, you orchestrate and judge.
~/.codex/config.toml).-C <code-dir> (slow, leaks context, may touch secrets).npx claudepluginhub security-engineer/claudex --plugin claudexCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.