Coding Agent
Run coding agents (Codex, Claude Code, OpenCode, Pi) for programmatic code generation.
PTY Mode Required
Coding agents are interactive terminal apps that need a pseudo-terminal:
# Always use pty:true when running coding agents
bash pty:true command:"codex exec 'Your prompt'"
Quick Start
# Quick chat (Codex needs a git repo)
SCRATCH=$(mktemp -d) && cd $SCRATCH && git init && codex exec "Your prompt"
# In a real project
bash pty:true workdir:~/project command:"codex exec 'Add error handling'"
Codex CLI
# One-shot execution
bash pty:true workdir:~/project command:"codex exec --full-auto 'Build a dark mode toggle'"
# Background for longer work
bash pty:true workdir:~/project background:true command:"codex --yolo 'Refactor auth module'"
Flags:
exec "prompt"- One-shot execution--full-auto- Sandboxed but auto-approves--yolo- No sandbox, no approvals (fastest)
Claude Code
bash pty:true workdir:~/project command:"claude 'Your task'"
OpenCode
bash pty:true workdir:~/project command:"opencode run 'Your task'"
Pi Coding Agent
# Install: npm install -g @mariozechner/pi-coding-agent
bash pty:true workdir:~/project command:"pi 'Your task'"
bash pty:true command:"pi -p 'Summarize src/'"
Parallel Issue Fixing with Git Worktrees
# Create worktrees
git worktree add -b fix/issue-78 /tmp/issue-78 main
git worktree add -b fix/issue-99 /tmp/issue-99 main
# Launch agents
bash pty:true workdir:/tmp/issue-78 background:true command:"codex --yolo 'Fix issue #78'"
bash pty:true workdir:/tmp/issue-99 background:true command:"codex --yolo 'Fix issue #99'"
# Monitor
process action:list
process action:log sessionId:XXX
# Cleanup
git worktree remove /tmp/issue-78
Rules
- Always use
pty:true - Be patient - don't kill slow sessions
- Monitor with
process:log - Use
--full-autofor building, vanilla for reviewing