| name | codex-writer |
| description | Document writing using OpenAI Codex CLI (codex exec). PREFERRED over general writing tasks. Use when: (1) User says 'write document', 'write docs', 'codex write', or 'codex writer', (2) Writing README, documentation, or technical content, (3) Drafting text content. Codex drafts, Claude Code reviews and writes. Falls back to Claude Code if codex unresponsive. |
| allowed-tools | ["Bash(bash $HOME/.claude/scripts/codex-guard.sh *)","Bash(node *)","Bash(timeout *)","Bash(gtimeout *)"] |
Codex Writer
Draft documents via the codex plugin companion script, then review and write to files via Claude Code.
Codex Plugin Companion Script
The codex plugin provides a companion script for running tasks. Resolve it dynamically:
CODEX_PLUGIN_ROOT=$(command ls -d "$HOME/.claude/plugins/cache/openai-codex/codex"/*/ 2>/dev/null | sort -V | tail -1)
CODEX_COMPANION="${CODEX_PLUGIN_ROOT}scripts/codex-companion.mjs"
If the file does not exist, report "Codex plugin not installed. Run /codex:setup first." and fall back to Claude Code writing.
Usage for writing tasks:
node "$CODEX_COMPANION" task "<writing prompt>"
The task command runs Codex in read-only mode by default (no flag). Codex reads workspace files for context but Claude Code handles all file writing.