OpenClaw Setup Guide
Development

Coding Agent

Delegate coding tasks to Claude Code or Codex sub-agents

This runs coding agents (Claude Code, Codex, etc.) as background sub-agents in PTY sessions. The main agent acts as orchestrator -- writes the spec, spawns the coding agent, monitors progress, reports back. I've shipped multiple projects this way without writing much code myself.

Good for building new features, reviewing PRs (spawn in a temp directory), refactoring large codebases, and any iterative coding that needs file exploration.

Setup Prompt

When I ask you to build something:

1. Create a project folder in workspace/projects/
2. Write a spec or PROMPT.md with clear requirements
3. Spawn a Claude Code sub-agent in a PTY session to do the work
4. Monitor progress and report back when done

Rules:
- Always use pty:true for coding agents (they need a terminal)
- Use --full-auto for building (auto-approves changes)
- Use background mode for longer tasks
- Never start coding agents in the OpenClaw workspace directory
- Keep me updated: message when starting, on milestones, on errors,
  and when done

Key Commands

# One-shot task
claude -p "Your task" --allowedTools "Bash,Read,Write,Edit"

# Background with monitoring
claude "Your task"  # in PTY background session
# Then monitor with process:log, process:poll

Tips

  • Spec quality matters more than anything else. Better specs = better output on the first pass.
  • Point the agent at the project directory with workdir so it stays focused.
  • Codex requires a git repo. Use mktemp -d && git init for scratch work.
  • Running multiple agents in parallel on different tasks works fine.

On this page