luovicter-collab/openclaw-docs/codex-sub-agents
- community
Checking that the SKILL.md file is still in the repository.
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 subagent or direct tool.
Install
npx vskill@latest install luovicter-collab/openclaw-docs/codex-sub-agentsSKILL.md
OpenAI Codex CLI Skill
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.
When to Use
- User asks for code changes, refactoring, or implementation
- CI/build failures need fixing
- Code review before commit/push
- Large codebase exploration or explanation
- Tasks requiring file editing + command execution
- When GPT-5-Codex model strengths are needed (code generation, tool use)
Installation & Auth
Codex CLI requires ChatGPT Plus/Pro/Business/Enterprise subscription.
Core Commands
Interactive Mode (TUI)
Non-Interactive (Scripting)
Session Management
Slash Commands (In TUI)
| Command | Purpose | |
|---|---|---|
/model | Switch model (gpt-5-codex, gpt-5) | |
/approvals | Set approval mode (Auto, Read Only, Full Access) | |
/review | Code review against branch, uncommitted changes, or specific commit | |
/diff | Show Git diff including untracked files | |
/compact | Summarize conversation to free context | |
/init | Generate AGENTS.md scaffold | |
/status | Show session config and token usage | |
/undo | Revert most recent turn | |
/new | Start fresh conversation | |
/mcp | List configured MCP tools | |
/mention <path> | Attach file to conversation |
Approval Modes
| 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) |
Key Flags
| Flag | Purpose | |
|---|---|---|
--model, -m <model> | Override model (gpt-5-codex, gpt-5) | |
--cd, -C <path> | Set working directory | |
--add-dir <path> | Add additional writable roots | |
--image, -i <path> | Attach image(s) to prompt | |
--full-auto | Workspace write + approve on failure | |
--sandbox <mode> | read-only, workspace-write, danger-full-access | |
--json | Output newline-delimited JSON | |
--search | Enable web search tool |
OpenClaw 推荐用法
- Codex 无免费额度(需订阅/付费)。若用户明确「只用 Codex 免费额度」或不想消耗付费:
- 优先用 exec / process 完成代码或脚本任务,不要主动调用 Codex。
- 若用户仍要经 router:可设
CODEX_FREE_ONLY=1再运行 codex_router.py,此时脚本不会调用 Codex,仅输出建议。 - 复杂或不确定任务(且用户允许使用 Codex):
python3 ~/.openclaw/workspace/scripts/codex_router.py "任务描述" 或 exec python3 ~/.openclaw/workspace/scripts/codex_router.py "任务描述"
- 简单、目标明确的任务:
codex exec --full-auto --cd ~/.openclaw/workspace "任务描述"
- 仅查看将执行的命令(不消耗额度):
codex_router.py --dry-run "任务描述"
Workspace 为 OpenClaw 时 --cd 使用 ~/.openclaw/workspace(或 $OPENCLAW_WORKSPACE)。
Clawdbot Integration Patterns
Pattern 1: Direct exec Tool
Call Codex from Clawdbot's exec tool for coding tasks:
Pattern 2: Subagent Delegation
Spawn a coding subagent that uses Codex:
Pattern 3: CLI Backend Fallback
Configure Codex as a text-only fallback:
Pattern 4: MCP Server Mode
Run Codex as an MCP server for other agents:
Clawdbot Config: OpenAI Codex Provider
Use your ChatGPT Pro subscription via the openai-codex provider:
Auth syncs automatically from ~/.codex/auth.json to Clawdbot's auth profiles.
Code Review Workflow
Multi-Directory Projects
Custom Slash Commands
Create reusable prompts in ~/.codex/prompts/:
Invoke: /prompts:pr BRANCH=feature-auth TITLE="Add OAuth flow"
MCP Integration
Add MCP servers to extend Codex:
Web Search
Enable in ~/.codex/config.toml:
Then Codex can search for current docs, APIs, etc.
Best Practices
- Start with `/init` to create AGENTS.md with repo-specific instructions
- Use `/review` before commits for AI code review
- Set `/approvals` appropriately — Auto for trusted repos, Read Only for exploration
- Use `--add-dir` for monorepos instead of
danger-full-access - Resume sessions to maintain context across coding sessions
- Attach images for UI work, design specs, error screenshots
Example Workflows
Fix CI Failure
Refactor Component
Implement Feature from Spec
Code Review PR
Troubleshooting
| Issue | Solution | |
|---|---|---|
| Auth fails | Run codex logout then codex login | |
| Commands blocked | Check /approvals, may need --full-auto | |
| Out of context | Use /compact to summarize | |
| Wrong directory | Use --cd flag or check /status | |
| Model unavailable | Verify subscription tier supports model |
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/codex-sub-agents/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/luovicter-collab/openclaw-docs/codex-sub-agents)