All documentation pages

How AgentDuo works

AgentDuo is a relay. It starts Codex and Claude Code as processes in your workspace, gives each the right prompt for its role, checks what comes back, and passes it on. These are the pieces it works with.

On this page

Two agents, run as CLIs

Each agent is the CLI you installed: codex (run as codex exec) and claude (run as claude -p). AgentDuo does not talk to a model API itself, holds no credentials, and adds nothing to the agents’ own tools.

For each call AgentDuo passes only the flags its protocol needs: streaming JSON events, the output schema of the role (--output-schema for Codex, --json-schema for Claude), and the prompt on standard input. Your configured args and role_args come along. Everything else (model defaults, permissions, sandboxes, MCP servers) is each CLI’s own configuration.

Roles

The four roles of a pipeline run
RoleConfig keyDefaultAnswers with
Planner (and plan sign-off)agents.plannerCodexa plan; later an approval of the final plan
Plan criticagents.plan_reviewerClaude Codea critique: approved, or issues by severity
Implementeragents.implementerClaude Codean implementation report: completed or blocked
Code revieweragents.code_reviewerCodexa review: approved, or findings by severity

Each answer is JSON that must match a strict schema (the repository’s packages/engine/schemas/ folder). A call that fails, or whose answer does not match, is tried again with the reason, up to limits.max_retries more times (1 by default).

The workspace

The workspace is the folder AgentDuo runs in: the folder you started duo in (or --dir), the project you opened in the desktop app, or the VS Code folder. With no folder, the desktop app and the extension use your home folder.

  • Both agents run there.
  • .agentduo/ lives there: the project configuration and, by default, the runs folder.
  • Only changes inside it go to the reviewer. A change elsewhere in the same repository produces a warning, with its path relative to the workspace.

Conversations and pipeline runs

There are two kinds of work, and they are kept apart:

Conversation and run compared
ConversationPipeline run
Started bya message, a question to an agent, /discuss/pipeline <task> or duo "<task>"
Answersplain text, shown wholeJSON per role, validated
Needs Gitnoyes: it snapshots and diffs the workspace
Saved in<runs>/conversations/<id>/<runs>/<run-id>/
Stopped with Escthe answer ends; nothing of it is keptthe step ends; the run can be resumed

A pipeline run started from a conversation is told what was said before the task, and what the conversation’s earlier pipeline tasks did. Conversations and The pipeline go into each.

The pipeline at a glance

Plan and agree

  1. PlanCodex
  2. CritiqueClaude Code
  3. FinalizeCodex

changes requested: back to Plan

the final plan goes to the implementer

Build and review

  1. ImplementClaude Code
  2. Verifyyour gates
  3. ReviewCodex

findings: back to Implement

Approved, no blocking finding, required gates pass: done. You review and commit.

The pipeline with its default roles. Each agent's role can be changed in the configuration.
  • Codex
  • Claude Code
  • your commands (optional)

A run reaches DONE when the reviewer approves, no blocking finding is left, and every required gate passes. When a limit is reached, an agent fails or blocks, or a critical finding appears, it stops in HUMAN_REVIEW and asks you. Decisions, stop and resume.

Snapshots and the diff

Before the first implementation round, AgentDuo records the state of the workspace as a Git snapshot, and records another after each round. Snapshots are commit objects kept under refs/agentduo/<run-id>/; they use a temporary index, so your branch, your index and your staged changes are left alone. The reviewer gets the diff between the baseline and the latest snapshot, up to limits.max_diff_chars characters. Changes you made before the run are part of the baseline, so they are not in the diff.

Run data, attachments and .claude/settings.local.json are excluded from every snapshot. Nothing is ever committed to your branch or pushed.

AgentDuo enforces nothing

AgentDuo has no permission system of its own and blocks nothing. What an agent may do is decided by its CLI’s settings; what it should do, by your prompt and your repository’s AGENTS.md or CLAUDE.md.

What AgentDuo does is report. Files changed by a planning or reviewing agent, and files changed outside the workspace, produce a warning on screen and in the run’s report; tool calls Claude was denied are listed. Permissions.