Multi-agent AI debate orchestrator — spawns Claude, Gemini, Codex (etc.) CLI agents in tmux panes and runs structured debates, with a web UI and archive browser.
Project description
aidebate
Multi-agent AI debate orchestrator. Spins up Claude Code, Gemini CLI, Codex CLI (and anything else with an interactive REPL) inside tmux panes, runs a structured debate between them, and serves a live web UI plus an archive browser.
Why
You have subscriptions to several AI coding assistants and occasionally want to pit them against each other — or let them cross-examine each other — on a concrete question ("Rust vs Go for this CLI", "Which of these 5 libraries should we pick?", "Is this migration worth it?"). Doing this manually is tedious; aidebate wires it up end to end:
- Each agent is a long-lived REPL in its own tmux pane (so you can watch them think live, or just see the final verdict).
- The orchestrator coordinates turns via flag files — agents never step on each other's keystrokes.
- A moderator agent runs the same way, reads everyone's answers at the end, and writes a verdict.
- Everything is persisted to disk as rendered Markdown, so every debate leaves a permanent, browsable transcript.
Install
You need tmux, Python 3.10+, and at least one authenticated AI CLI:
- Claude Code — run
claudeonce and log in. - Gemini CLI — run
geminionce and sign in. - Codex CLI — run
codex login.
Then:
# One-shot (npx-style) with uv:
uvx aidebate serve
# Or persistent install:
pipx install aidebate
debate serve
Or develop from source:
git clone https://github.com/orlenko/aidebate && cd aidebate
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/debate --help
Quickstart
Web UI (recommended)
debate serve # http://127.0.0.1:8765
Fill in the form — topic, moderator engine, and one row per debater (role + engine + stance). Click Start. The tiled tmux session spins up in the background and every pane streams into the browser. When it finishes, the verdict renders as proper Markdown and every run joins the "Prior debates" list for future reference.
Command line
debate run \
--topic "Should we migrate from Framework A to Framework B?" \
--side pro@claude:"Argue for migrating." \
--side con@gemini:"Argue for staying." \
--side auditor@codex:"Neutral cost analysis — no advocacy." \
--moderator claude \
--watch
--watch pops open an iTerm2/Terminal window already attached to the debate's tmux session so you can follow along. Without it, use the printed tmux attach -t debate-<timestamp> command.
Other subcommands
| Command | What it does |
|---|---|
debate ls |
List prior session IDs. |
debate attach <id> |
Print the tmux attach command for a session. |
debate kill-all |
Kill every tmux session whose name starts with debate-. |
debate smoke |
Walking-skeleton test: one agent, one turn, no moderator. |
What gets saved
Each run writes to ~/.aidebate/sessions/<id>/. Override with AIDEBATE_HOME=<dir> or --sessions-dir <dir> on any subcommand. (We deliberately avoid macOS's ~/Library/Application Support/ path — the space breaks too many of the ad-hoc shell commands that AI agents emit mid-debate.)
~/.aidebate/sessions/2026-04-14-120000/
├── session.json # manifest: topic, sides, moderator, status, timings
├── chat.jsonl # group chat log (one JSON object per line)
├── verdict.md # moderator's final ruling
├── agents/
│ ├── pro/ # each agent's cwd
│ ├── con/
│ └── moderator/
├── phase-1-opening/
│ ├── pro.prompt.md
│ ├── pro.answer.md
│ ├── pro.done
│ └── …
├── phase-2-rebuttal/
└── phase-3-verdict/
How it works
Agents coordinate via flag files, not terminal scraping:
- Orchestrator writes
phase-N/<role>.prompt.md. - It tells the agent (via tmux
send-keys) to read that file and follow it. - The prompt instructs the agent to write its response to
<role>.answer.mdand thentouch '<role>.done'. - Orchestrator polls for the
.doneflag; when every agent's.donelands, the phase is complete.
The debate runs in three phases:
Phase 1: Opening — each debater writes their position (parallel)
Phase 2: Rebuttal — each debater attacks every opponent's opening (parallel)
Phase 3: Verdict — moderator reads all answers + chat, renders ruling
startup_keys in the adapter config auto-dismiss "trust this folder?" dialogs for each CLI. permission_prompts handle anything else interactive.
Adapters
Adding a new AI CLI is a YAML file under src/aidebate/adapters/:
# src/aidebate/adapters/mynewcli.yaml
name: mynewcli
cmd: "mynewcli --yolo --workspace {session_root}"
submit_key: "Enter"
submit_delay: 0.8
permission_prompts:
- { match: "Trust this", respond: "" } # empty respond → just press Enter
- { match: "\\[y/N\\]", respond: "y" }
answer_instruction: |
When you have finished this task, write your full response to:
{answer_path}
Then run:
touch '{done_path}'
startup_keys:
- { delay: 3.0, key: "Enter" } # dismiss startup dialogs
The adapter's cmd can reference {session_root} and {agent_cwd}, substituted at spawn time.
Development
.venv/bin/pytest # run the test suite
.venv/bin/ruff check src tests # lint
The tests don't require tmux or any AI CLI — they cover adapter loading, side parsing, prompt building, and the FastAPI endpoints that read session state from disk. For end-to-end runs you need the real thing.
License
Apache-2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aidebate-0.2.1.tar.gz.
File metadata
- Download URL: aidebate-0.2.1.tar.gz
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d09eec265d47506b811a36e82a51a6d7bd1b7f97e3769da58cb5b2b3a759f57
|
|
| MD5 |
21728091cae0a064d1ff511ab0131aad
|
|
| BLAKE2b-256 |
5e653feaf0a512714bbd1ccde300cd942e009a1aeb65e69e8b5af28bd467f581
|
Provenance
The following attestation bundles were made for aidebate-0.2.1.tar.gz:
Publisher:
release.yml on orlenko/aidebate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aidebate-0.2.1.tar.gz -
Subject digest:
9d09eec265d47506b811a36e82a51a6d7bd1b7f97e3769da58cb5b2b3a759f57 - Sigstore transparency entry: 1297875511
- Sigstore integration time:
-
Permalink:
orlenko/aidebate@58f10bffe6a2e6ebb807507ad339c5f9e90bf0d7 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/orlenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58f10bffe6a2e6ebb807507ad339c5f9e90bf0d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aidebate-0.2.1-py3-none-any.whl.
File metadata
- Download URL: aidebate-0.2.1-py3-none-any.whl
- Upload date:
- Size: 42.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c800b3d781c8fd40f400d447270792cd4a7ef882151e3eaddf41db10de577c
|
|
| MD5 |
6f24da587ba9a0b7c5ca1ef3af487d16
|
|
| BLAKE2b-256 |
9029a88ec1b50b006f12c40f128bd1ec488ad2e404d6871d2da363616acf2f15
|
Provenance
The following attestation bundles were made for aidebate-0.2.1-py3-none-any.whl:
Publisher:
release.yml on orlenko/aidebate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aidebate-0.2.1-py3-none-any.whl -
Subject digest:
23c800b3d781c8fd40f400d447270792cd4a7ef882151e3eaddf41db10de577c - Sigstore transparency entry: 1297875594
- Sigstore integration time:
-
Permalink:
orlenko/aidebate@58f10bffe6a2e6ebb807507ad339c5f9e90bf0d7 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/orlenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58f10bffe6a2e6ebb807507ad339c5f9e90bf0d7 -
Trigger Event:
push
-
Statement type: