Skip to main content

Why two agents in one session

ContextRelay runs Claude Code and Codex as two separate, trusted processes on the same workstation and lets them exchange structured messages, hand off work, and debate decisions through a shared local daemon and a durable ledger. One agent can implement while the other reviews; either can ask the other for a second opinion before a risky call; and every message, handoff, note, and decision is recorded so you have an auditable account of what the agents did before you ship.

The key word is coordination. ContextRelay orchestrates the pair - it is the neutral control-plane around the two products. Neither Claude Code nor Codex orchestrates the other, and ContextRelay is not a hosted service.

Provider-neutral by design

ContextRelay coordinates two different products from two different vendors under one git owner, one human-in-the-loop policy, and one shared record. It is local developer tooling - not endorsed by OpenAI or Anthropic, and not a security sandbox between tools you do not trust.

When to reach for the pair

A coordinated pair earns its keep in a handful of concrete situations. Reach for it when:

  • One agent should implement while the other reviews. The pair reviews its own work before you do - Claude reviews Codex's changes, Codex reviews Claude's.
  • A risky decision needs a second, independent opinion. Get a second model's judgment before committing to a design, tradeoff, or migration.
  • You want an auditable record before shipping. Every message, handoff, note, artifact, and decision lands in a durable ledger you can read back.
  • A sub-task is a better fit for the other agent. Delegate focused implementation, test writing, or debugging to whichever agent is better suited, with an explicit handoff.

If none of these apply - a quick edit, a throwaway script, a question you can answer alone - a single agent is fine. ContextRelay is for work where a second set of eyes, a durable record, or a clean division of labor pays off.

Why not just one agent?

A single agent has no independent reviewer and no second model's judgment. It can check its own work, but it cannot give you a genuinely independent opinion, and nothing it does is recorded for audit outside its own transcript.

A coordinated pair changes that on two axes:

Single agentCoordinated Claude + Codex pair
Self-review only; one model's blind spotsCross-review - each agent reviews the other's work
No second opinion on risky callsBounded deliberation between two different models before deciding
Record lives only in one chat transcriptDurable shared ledger of messages, handoffs, notes, artifacts, and decisions
You arbitrate every disagreementAgents surface agreement and disagreement explicitly, then converge

This is also why ContextRelay is not "one vendor orchestrating the other." When a single product drives a peer model, the driver's framing and incentives shape the whole exchange. ContextRelay sits outside both: a neutral coordinator with one git owner and one human-in-the-loop policy, so the second opinion stays independent.

The default role split (and it's configurable)

ContextRelay assigns roles through a coordinator policy, not hard-coded behavior. One agent is the coordinator; the other supports it.

  • The coordinator owns planning, task routing, and git writes (branch, commit, merge, push, PR).
  • The supporting agent contributes repo-wide reasoning, risk review before large changes, alternative approaches, and focused implementation or debugging when the coordinator delegates it.

The coordinator is recorded in .contextrelay/config.json (collaboration.coordinator) and mirrored into the managed instruction blocks in CLAUDE.md / AGENTS.md. It defaults to claude, and you can set it to claude, codex, or human:

ctxrelay coordinator status # show who currently owns git writes
ctxrelay coordinator codex # make Codex the coordinator

Because the roles are policy rather than code, the same machinery works whether Claude leads and Codex supports, or the reverse. See Coordinator and git-write policy for the full model.

One git owner at a time

Only the coordinator (or you) performs git writes. The non-coordinator agent uses read-only git and hands git-sensitive work back. This single-owner rule is what keeps two agents in one repository from racing each other into a tangled history.

Independent judgment, not polite agreement

Two agents are only worth running if the second one actually disagrees when it should. ContextRelay prompts each agent to provide independent technical judgment and evidence, not passive agreement, and gives them explicit language to make their stance legible. The runtime instructions ask agents to use phrases such as:

"My independent view is:", "I agree on:", "I disagree on:", and "Current consensus:".

That structure surfaces real disagreement instead of burying it, and the convergence step (current consensus, remaining disagreement, decision, next action) gives you a crisp record of how the pair got to its answer.

Read-only by default

A coordinated pair does not mean autonomous edits. ContextRelay is read-only by default: backup-agent autonomy is off, and autonomous act:write edits are off and fail closed behind explicit, layered gates. Turning those on is a deliberate, opt-in choice. See Read-only by default.

Where to go next, by goal

Pick the row that matches what you want to do:

Your goalGo to
Start a Claude + Codex pair for the first timeInstall and first runTutorial: your first paired session
Delegate a focused implementation to the other agentTutorial: delegate an implementation to Codex via handoff
Get a second opinion on a decisionHandoffs, replies, and deliberation
Run a risk review before a big changeTutorial: run a risk-review before a big change
Understand who owns gitCoordinator and git-write policy

Next steps