OpenAI Codex Sub Agents
Use OpenAI Codex CLI for coding tasks. Triggers: codex, code review, fix CI, refactor code, implement feature, coding agent, gpt-5-codex. Enables Clawdbot to delegate coding work to Codex CLI as a sub
Use OpenAI Codex CLI for coding tasks. Triggers: codex, code review, fix CI, refactor code, implement feature, coding agent, gpt-5-codex. Enables Clawdbot to delegate coding work to Codex CLI as a sub
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Use OpenAI Codex CLI (
codex) for coding tasks including code review, refactoring, bug fixes, CI repairs, and feature implementation. Codex CLI runs locally on your machine with full filesystem access.
Codex CLI requires ChatGPT Plus/Pro/Business/Enterprise subscription.
# Install npm i -g @openai/codexAuthenticate (opens browser for OAuth)
codex login
Or use API key
printenv OPENAI_API_KEY | codex login --with-api-key
Verify auth
codex login status
codex # Launch interactive terminal UI codex "explain this codebase" # Start with a prompt codex --cd ~/projects/myapp # Set working directory
codex exec "fix the CI failure" # Run and exit codex exec --full-auto "add input validation" # Auto-approve workspace writes codex exec --json "list all API endpoints" # JSON output for parsing codex exec -i screenshot.png "match this design" # With image input
codex resume # Pick from recent sessions codex resume --last # Continue most recent codex resume <SESSION_ID> # Resume specific session
| Command | Purpose |
|---|---|
| Switch model (gpt-5-codex, gpt-5) |
| Set approval mode (Auto, Read Only, Full Access) |
| Code review against branch, uncommitted changes, or specific commit |
| Show Git diff including untracked files |
| Summarize conversation to free context |
| Generate AGENTS.md scaffold |
| Show session config and token usage |
| Revert most recent turn |
| Start fresh conversation |
| List configured MCP tools |
| Attach file to conversation |
| Mode | Behavior |
|---|---|
| Auto (default) | Read/edit/run commands in workspace; asks for outside access |
| Read Only | Browse files only; requires approval for changes |
| Full Access | Full machine access including network (use sparingly) |
| Flag | Purpose |
|---|---|
| Override model (gpt-5-codex, gpt-5) |
| Set working directory |
| Add additional writable roots |
| Attach image(s) to prompt |
| Workspace write + approve on failure |
| read-only, workspace-write, danger-full-access |
| Output newline-delimited JSON |
| Enable web search tool |
Call Codex from Clawdbot's exec tool for coding tasks:
# In Clawdbot session exec codex exec --full-auto --cd ~/projects/medreport "fix the TypeScript errors in src/components"
Spawn a coding subagent that uses Codex:
// In agents.defaults or per-agent config { agents: { list: [ { id: "coder", workspace: "~/clawd-coder", model: "openai-codex/gpt-5.2", // Uses Codex auth tools: { allow: ["exec", "read", "write", "edit", "apply_patch", "process"] } } ] } }
Configure Codex as a text-only fallback:
{ agents: { defaults: { cliBackends: { "codex-cli": { command: "codex", args: ["exec", "--full-auto"], output: "text", sessionArg: null // Codex manages its own sessions } } } } }
Run Codex as an MCP server for other agents:
codex mcp-server # Exposes Codex tools via stdio MCP
Use your ChatGPT Pro subscription via the
openai-codex provider:
{ agents: { defaults: { model: { primary: "openai-codex/gpt-5.2" }, models: { "openai-codex/gpt-5.2": { alias: "Codex" }, "anthropic/claude-opus-4-5": { alias: "Opus" } } } } }
Auth syncs automatically from
~/.codex/auth.json to Clawdbot's auth profiles.
# Interactive review codex /review # Choose: branch, uncommitted, or specific commitNon-interactive
codex exec "review the changes in this PR against main branch"
# Work across monorepo packages codex --cd apps/frontend --add-dir ../backend --add-dir ../sharedOr in TUI
codex --cd ~/projects/myapp --add-dir ~/projects/shared-lib
Create reusable prompts in
~/.codex/prompts/:
<!-- ~/.codex/prompts/pr.md --> --- description: Prepare and open a draft PR argument-hint: [BRANCH=<name>] [TITLE="<title>"] ---Create branchif specified. Stage and commit changes with a clear message. Open a draft PR with title $TITLE or auto-generate one.dev/$BRANCH
Invoke:
/prompts:pr BRANCH=feature-auth TITLE="Add OAuth flow"
Add MCP servers to extend Codex:
# Add stdio server codex mcp add github -- npx @anthropic/mcp-server-githubAdd HTTP server
codex mcp add docs --url https://mcp.deepwiki.com/mcp
List configured
codex mcp list
Enable in
~/.codex/config.toml:
[features] web_search_request = true[sandbox_workspace_write] network_access = true
Then Codex can search for current docs, APIs, etc.
/init to create AGENTS.md with repo-specific instructions/review before commits for AI code review/approvals appropriately — Auto for trusted repos, Read Only for exploration--add-dir for monorepos instead of danger-full-accesscodex exec --full-auto "The CI is failing on the lint step. Fix all ESLint errors."
codex exec --cd src/components "Refactor UserProfile.tsx to use React Query instead of useEffect for data fetching"
codex exec -i spec.png --cd ~/projects/app "Implement this feature based on the design spec"
codex exec "Review the diff between main and feature/auth branch. Focus on security issues."
| Issue | Solution |
|---|---|
| Auth fails | Run then |
| Commands blocked | Check , may need |
| Out of context | Use to summarize |
| Wrong directory | Use flag or check |
| Model unavailable | Verify subscription tier supports model |
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.