Claude Code, Codex CLI, and Gemini CLI all have headless modes. They accept a prompt, do the work, and exit. No interactive terminal needed. Anthropic documents claude -p. OpenAI provides codex exec. Google builds Gemini CLI with a -p flag for non-interactive use. They're designed to be run by scripts, CI pipelines, and orchestration systems.
Your Zo is an orchestration system. It's an always-on cloud computer with a terminal, git, and 100+ tools. It can launch any of these coding agents, feed them a task, manage the git workflow around them, and deliver the results to you on Telegram, SMS, or email. The coding agent writes the code. Your Zo handles everything else.
The pattern
Every CLI coding agent follows the same pattern:
- You give it a prompt and a working directory
- It reads the codebase, writes code, runs commands
- It exits when the task is done
Your Zo wraps that pattern with everything the coding agent can't do on its own:
- Git orchestration. Create a branch or worktree, run the agent, commit, push, open a PR.
- Scheduling. Run the agent on a schedule: nightly test fixes, weekly dependency updates, morning code reviews.
- Delivery. Text you the PR link. Email the diff. Send a Telegram message with the summary.
- Tool access. Connect the agent to Zo's tools via MCP: web search, Gmail, Calendar, Drive, image generation, and more.
- Chaining. Run one agent, check the result, run another. Your Zo can launch Claude Code to write a feature, then launch Gemini CLI to review it.
The coding agent stays focused on code. Your Zo handles the orchestration, communication, and infrastructure around it.
Claude Code
Claude Code is pre-installed on every Zo. No setup required beyond authentication. It's the most capable of the three for complex, multi-file changes and has native MCP support for connecting to Zo's tools.
For the full setup guide — authentication options, interactive use, headless mode, worktree workflows, MCP integration, and troubleshooting — see How to Run Claude Code on Zo.
The short version for headless runs:
Run Claude Code headlessly with the prompt "Read the codebase in /home/workspace/my-project and fix any failing tests"
Your Zo launches claude -p, passes the prompt, and reports the results. For the worktree + PR workflow that creates an isolated branch, runs Claude Code, and opens a pull request, see the dedicated post.
Codex CLI
Codex CLI is OpenAI's open-source terminal coding agent. It reads your codebase, writes code, and runs commands. The codex exec subcommand runs it non-interactively — no TUI, just input and output.
Install it:
Open Zo's terminal:
npm install -g @openai/codexSave your OpenAI API key in Settings > Advanced as OPENAI_API_KEY.
Run it headlessly:
Run Codex CLI headlessly with the prompt "Refactor src/utils/parser.ts to use the new schema validation library" in /home/workspace/Code/myproject
Your Zo launches codex exec, passes the prompt, and reports the results.
Run it in a worktree with a PR:
Run Codex CLI in an isolated git worktree, then create a PR.
Task: Add unit tests for all exported functions in src/lib/ Repo: /home/workspace/Code/myproject
Instructions:
- Create a worktree from origin/main under /tmp/worktrees/
- Run
codex execwith my task in that directory - Commit, push, and open a PR
- Text me the PR link
Codex strengths: Codex CLI is open-source and uses OpenAI models. It's a good option if you prefer GPT-4o or o3 for code generation, or if you want to customize the agent's behavior by forking the repo. It also tends to be faster for smaller, focused changes.
Gemini CLI
Gemini CLI is Google's terminal-based AI coding tool. It supports non-interactive execution for scripted and automated workflows, and benefits from Gemini's large context window for working with bigger codebases.
Install it:
Open Zo's terminal:
npm install -g @google/gemini-cliSave your Google API key in Settings > Advanced as GEMINI_API_KEY.
Run it headlessly:
Run Gemini CLI headlessly with the prompt "Review the code in src/auth/ and suggest security improvements" in /home/workspace/Code/myproject
Run it in a worktree with a PR:
Run Gemini CLI in an isolated git worktree, then create a PR.
Task: Update all deprecated API calls to use the v2 endpoints Repo: /home/workspace/Code/myproject
Instructions:
- Create a worktree from origin/main under /tmp/worktrees/
- Run Gemini CLI non-interactively with my task
- Commit, push, and open a PR
- Email me the PR link with a summary of what changed
Gemini CLI strengths: The large context window (up to 1M tokens) makes Gemini CLI well-suited for tasks that require understanding a large codebase at once — reviewing architecture, finding patterns across many files, or migrating APIs with widespread usage. It's also a good choice for code review, where reading comprehension matters more than code generation.
Choosing the right agent for the task
Each agent has different strengths. Your Zo doesn't care which one it's running — they're all terminal programs — so you can pick the best tool for each job.
| Task | Best fit | Why |
|---|---|---|
| Complex multi-file feature | Claude Code | Best at multi-step reasoning and coordinated changes across files |
| Quick focused refactor | Codex CLI | Fast for small, targeted changes |
| Large codebase review | Gemini CLI | Large context window reads more code at once |
| Security audit | Gemini CLI or Claude Code | Both handle detailed analysis well |
| Test writing | Any | All three write tests effectively |
| Bug fix from error log | Claude Code | Strong at debugging and iterating until tests pass |
You're not locked into one agent. Try Claude Code this week. Try Codex next week. Run both on the same task and compare the PRs.
Chain agents together
Since your Zo orchestrates the process, it can chain multiple agents on the same task. Use one agent to write code and another to review it:
Run Claude Code in a worktree on myproject with the task: "Add a rate limiting middleware to src/api/server.ts with configurable limits per endpoint."
When it's done, run Gemini CLI in the same worktree with: "Review the changes. Check for edge cases, missing tests, and security issues. Write your review as a comment."
If both pass, open a PR with both the implementation and the review notes. Text me the link.
Use one agent to generate tests and another to review the fixes:
Every night at midnight, run Claude Code on myproject: "Run the full test suite. If any tests fail, fix them."
Then run Codex on the same worktree: "Review the test fixes for correctness. Revert any fix that changes test expectations rather than fixing the actual bug."
If there are changes after both passes, open a PR. Otherwise, text me "All tests passing."
Chaining works because your Zo controls the sequence. It launches agent A, waits for it to finish, checks the result, decides whether to launch agent B, and handles the git workflow around the whole thing. The agents don't need to know about each other.
Give coding agents access to Zo's tools
By connecting a coding agent to the Zo MCP server, it gains access to everything your Zo can do: web search, email, calendar, file management, image generation, and more.
This works with any agent that supports MCP. Claude Code has native MCP support. For agents that don't, your Zo can bridge the tools via mcporter.
With MCP connected, a coding agent can search documentation while it works, email you when a long task finishes, or pull context from your Google Drive — capabilities it wouldn't have on its own.
Schedule recurring coding tasks
The combination of headless mode + scheduling is where this gets powerful. Tasks that would require you to remember, open a terminal, and run a command can happen automatically:
Create a daily agent that runs Claude Code at 6am to check for failing tests in myproject. Text me if anything breaks.
Create a weekly agent that runs every Monday at 2am. Launch Codex on myproject: "Check for outdated dependencies. Update any that have non-breaking updates available." Open a PR with the changes.
Create a weekly agent on Fridays at 5pm. Run Gemini CLI on myproject: "Review all code changed this week. Summarize the changes, flag any potential issues, and rate the overall code quality." Email me the review.
Your Zo runs these on schedule, whether your laptop is open or not. You wake up to PRs, test results, and code reviews — done overnight by agents that never sleep.
Getting started
Start with Claude Code — it's already installed:
Run Claude Code headlessly on my project at /home/workspace/Code/myproject with the prompt "Read the codebase and summarize the architecture"
Once you see how it works, try scheduling it. Then install Codex or Gemini CLI and experiment with chaining. Your Zo runs them all the same way.
More tutorials
How to Run Claude Code on Zo
Run Claude Code on Zo Computer. It's already installed. Connect your API key, SSH in from your IDE, and start coding on a cloud machine with AI built in.
How to Run Hermes Agent on Zo
Run Hermes Agent on Zo Computer. Install the self-improving AI agent framework, connect it to Telegram or Discord, and bridge Zo's 50+ tools into Hermes.
How to Run OpenClaw on Zo
Run OpenClaw on Zo Computer. Install, configure Tailscale access, connect 50+ tools, and get your AI agent live on Telegram, Discord, or WhatsApp.
GitHub for Vibe Coders
A plain-English guide to GitHub for non-technical builders shipping AI projects. Ask your Zo to connect, commit, and roll back without learning Git.
How to Connect Your IDE to a Remote Server
Set up SSH access to your Zo Computer and connect VS Code, Cursor, or any IDE for remote development. Code on a powerful server from anywhere.
Personal AI Agents: What They Are, How They Work, and Why 2026 Is the Year They Get Real
A technical breakdown of personal AI agent architecture in 2026: the observe-plan-act loop, persistent memory, tool integration via MCP, and why infrastructure, not intelligence, is the bottleneck.