Coding Agent
Delegate coding tasks to Codex, Claude Code, or Pi agents via background process. For building features, reviewing PRs, refactoring codebases, and iterative coding.
Tags: coding, development, agent, pr-review, refactoring
Category: Development
Use Cases
- Feature development: describe what to build, agent implements it
- PR review at scale: spawn parallel reviewers for multiple PRs
- Bug fixing: create worktrees per issue, agents fix in parallel
- Code refactoring: hand off large refactors to background agents
- Codebase exploration: agents read and summarize unfamiliar repos
- CI/CD integration: agents respond to issue labels or webhook triggers
Tips
- Use git worktrees for parallel issue fixing — each agent gets its own isolated copy
- Append wake triggers to prompts so OpenClaw gets notified immediately on completion
- Use --full-auto for building features, vanilla mode for code review
- Monitor with process:log, not process:poll — you'll see actual progress
- For PR reviews, clone to a temp directory — never review in the live project folder
- Codex responds well to detailed, structured prompts — invest time in the task description
- Use submit (not write) when an agent needs you to 'press Enter'
Known Issues & Gotchas
- Codex/Pi/OpenCode require pty:true — they're interactive terminal apps that break without a pseudo-terminal
- Claude Code must use --print --permission-mode bypassPermissions — NOT --dangerously-skip-permissions with PTY
- Codex refuses to run outside a git directory — use `mktemp -d && git init` for scratch work
- NEVER start coding agents in ~/.openclaw/ — they'll read your soul docs and get confused
- NEVER checkout branches in the live OpenClaw project directory
- Background sessions can be slow — don't kill them just because they're 'taking too long'
- Each agent has different strengths: Codex for auto-building, Claude Code for thoughtful refactoring
Alternatives
- GitHub Copilot Agent
- Cursor / Windsurf
- Aider
- SWE-Agent
Community Feedback
I automated the Claude Code and Codex workflow into a pipeline. Started preparing .md files using Claude Code, then letting Codex review them.
— Reddit r/ClaudeCode
Codex tends to reason a bit longer, but its visible tokens-per-second output feels faster. Claude Code tends to reason less, but its visible output is slower.
— Builder.io Blog
Codex's agentic capabilities make it a solid choice because of its ability to run long simulations in the background. Claude Code acts like a senior developer.
— Tom's Guide
With Codex, Claude, and Copilot in Agent HQ, you can move from idea to implementation using different agents for different steps.
— GitHub Blog
Configuration Examples
Quick Codex one-shot (with PTY)
# One-shot feature build
bash pty:true workdir:~/project command:"codex exec --full-auto 'Add dark mode toggle to the settings page'"Claude Code background task
# Background refactoring job
bash workdir:~/project background:true command:"claude --permission-mode bypassPermissions --print 'Refactor the auth module to use JWT tokens. When done, run: openclaw system event --text \"Done: Auth refactor complete\" --mode now'"Parallel PR reviews with worktrees
# Create worktrees
git worktree add -b review/pr-42 /tmp/pr-42 main
git worktree add -b review/pr-43 /tmp/pr-43 main
# Launch reviewers
bash pty:true workdir:/tmp/pr-42 background:true command:"codex exec 'Review PR #42'"
bash pty:true workdir:/tmp/pr-43 background:true command:"codex exec 'Review PR #43'"
# Monitor
process action:listInstallation
# Requires claude, codex, opencode, or pi CLISource: bundled