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.

The Coding Agent skill is OpenClaw's orchestration layer for delegating programming tasks to external AI coding tools — Codex CLI, Claude Code, Pi, and OpenCode. Instead of writing code directly, OpenClaw spawns these specialized agents in background processes, monitors their progress, and reports results. This is where OpenClaw becomes a true engineering manager. Give it a feature request, and it creates a worktree, launches Codex with the right flags, monitors output, and reports back when the PR is ready. Need to review 5 PRs in parallel? It spawns 5 Codex processes, each in its own worktree, and collates the reviews. The skill handles the critical nuances of each agent: Codex and Pi need PTY mode (they're interactive terminal apps), while Claude Code works best with `--print --permission-mode bypassPermissions` (no PTY needed). It knows that Codex requires a git repository, that `--full-auto` is for building and vanilla mode for reviewing, and that you should never launch agents in the OpenClaw workspace directory. For background tasks, the skill uses exec with `background:true` and monitors progress via `process:log`. It can send input to agents that ask questions, kill stuck sessions, and auto-notify via wake events when tasks complete. The parallel worktree pattern enables fixing multiple issues simultaneously without branch conflicts. This skill is the difference between 'AI that writes code' and 'AI that manages a development workflow.' It handles the plumbing so you can focus on what to build, not how to invoke the right CLI flags. Best suited for: developers using OpenClaw as a coding orchestrator, teams reviewing PRs at scale, anyone building features via AI agents, solo founders managing multiple codebases.

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:list

Installation

# Requires claude, codex, opencode, or pi CLI

Source: bundled