Skip to main content

AI Debate Tool

AI-to-AI debate orchestration for better decision-making.

CI PyPI version License: MIT Python 3.10+


What is this?

AI Debate Tool orchestrates debates between multiple AI perspectives (Claude + Codex) to help make better decisions on complex code changes, architectural decisions, and implementation plans.

Key Features:

  • Dual-AI debates - Get diverse perspectives from Claude and Codex
  • Consensus scoring - 0-100 score indicating agreement level
  • Fast execution - 10-18 seconds per debate
  • Pattern learning - Improves recommendations over time
  • Zero API costs - Uses Codex CLI (no ongoing fees)

Installation

pip install ai-debate-tool

Requirements

  • Python 3.10+
  • Codex CLI installed and authenticated

Quick Start

CLI Usage

# Run a debate on a plan file
ai-debate run "Review this refactoring plan" --file plans/refactor.md

# Check if a change needs debate (complexity scoring)
ai-debate check "Add caching layer" --files cache.py db.py

# View debate history
ai-debate history --limit 5

# Initialize configuration
ai-debate config --init

Python API

import asyncio
from ai_debate_tool import get_orchestrator

async def main():
    # Create orchestrator
    Orchestrator = get_orchestrator()
    orchestrator = Orchestrator(enable_cache=True, enable_intelligence=True)

    # Run a debate
    result = await orchestrator.run_debate(
        request="Review this refactoring plan",
        file_path="plans/refactor.md",
        focus_areas=["architecture", "testing"]
    )

    # Check results
    print(f"Consensus: {result['debate_result']['consensus_score']}/100")
    print(f"Recommendation: {result['debate_result']['recommendation']}")

asyncio.run(main())

Check If Debate Is Needed

from ai_debate_tool import check_debate_required

result = check_debate_required(
    request="Refactor authentication module",
    file_paths=["auth/views.py", "auth/models.py"]
)

if result["required"]:
    print(f"Debate recommended (complexity: {result['complexity_score']})")
else:
    print("Simple change, proceed without debate")

CLI Reference

ai-debate run

Run a debate on a topic/file.

ai-debate run <topic> --file <path> [options]

Options:
  -f, --file PATH      Path to file to debate (required)
  -F, --focus TEXT     Focus areas (can specify multiple)
  -t, --target INT     Target consensus score (default: 75)
  -o, --output PATH    Save results to JSON file
  -v, --verbose        Verbose output

Examples:

# Basic debate
ai-debate run "Review this API design" --file api_spec.md

# With focus areas
ai-debate run "Check security implications" --file auth.py -F security -F validation

# Save results
ai-debate run "Architecture review" --file design.md -o results.json -v

ai-debate check

Check if a change requires debate (complexity scoring).

ai-debate check <request> [options]

Options:
  -f, --files TEXT     Files to check (can specify multiple)
  -t, --threshold INT  Complexity threshold (default: 40)
  --json               Output as JSON

Examples:

ai-debate check "Add user authentication" --files auth.py models.py
ai-debate check "Fix typo in README" --threshold 20

ai-debate history

View debate history.

ai-debate history [options]

Options:
  -n, --limit INT  Number of entries (default: 10)
  --stats          Show statistics only
  --json           Output as JSON

ai-debate config

Manage configuration.

ai-debate config [options]

Options:
  --init   Initialize configuration file
  --show   Show current configuration
  --path   Show config file path

ai-debate server

Start the MCP server for Claude Desktop integration.

ai-debate server [options]

Options:
  -v, --verbose  Verbose output

MCP Server Integration

The AI Debate Tool includes an MCP server for Claude Desktop integration.

Quick Setup

  1. Add to Claude Desktop settings (~/.claude/settings.json):
{
  "mcpServers": {
    "ai-debate-tool": {
      "command": "ai-debate",
      "args": ["server"]
    }
  }
}
  1. Restart Claude Desktop

Available MCP Tools

Tool Description
debate_check_complexity Check if change requires debate
debate_start_auto Start automated debate
debate_submit_codex_response Submit Codex response
debate_check_consensus Check consensus status
debate_get_decision_pack Get full decision pack

See docs/mcp-server.md for full documentation.


How It Works

1. INPUT
   └── Your request + file path + optional focus areas

2. PRE-DEBATE ANALYSIS
   ├── Pattern detection from history
   ├── Risk prediction
   └── Suggested focus areas

3. PARALLEL DEBATE
   ├── Claude perspective (via Codex CLI)
   └── Codex perspective (via Codex CLI)

4. CONSENSUS ANALYSIS
   └── Score agreement, identify disagreements

5. OUTPUT
   └── Consensus score + recommendations + insights

Consensus Scores

Score Interpretation Recommendation
90-100 Strong Agreement Proceed confidently
75-89 Good Agreement Proceed with minor review
60-74 Moderate Agreement Discuss key points first
40-59 Mixed Views Significant discussion needed
0-39 Strong Disagreement Major concerns to address

Configuration

Create a config file with ai-debate config --init:

{
  "enabled": true,
  "complexity_threshold": 40,
  "target_consensus": 75,
  "max_rounds": 5,
  "enable_cache": true,
  "enable_intelligence": true,
  "log_level": "INFO"
}

Or use environment variables:

  • ENABLE_AI_DEBATE - Enable/disable debates
  • DEBATE_COMPLEXITY_THRESHOLD - Minimum complexity for debate
  • DEBATE_TARGET_CONSENSUS - Target consensus score

VS Code Extensions

The AI Debate Tool includes VS Code extensions for automatic AI invocation.

Available Extensions

Extension Description
Copilot Bridge Exposes GitHub Copilot Language Model API
Codex Bridge Bridges OpenAI ChatGPT/Codex extension

Installation

cd vscode-extensions/copilot-bridge  # or codex-bridge
npm install
npm run compile
npm run package  # Creates .vsix file

Then install the .vsix file in VS Code: Extensions > ... > Install from VSIX

See vscode-extensions/README.md for full documentation.


Roadmap

  • v1.0.0: Core library + CLI
  • v1.1.0: MCP server integration
  • v1.2.0 (Current): VS Code extensions

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

# Clone the repo
git clone https://github.com/ai-debate-tool/ai-debate-tool.git
cd ai-debate-tool

# Install in development mode
pip install -e .[dev]

# Run tests
pytest --cov

# Format code
black src/

License

MIT License - see LICENSE for details.


Metadata

Release files for ai-debate-tool 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-debate-tool 1.2.0
File Size Uploaded Provenance Actions
ai_debate_tool-1.2.0.tar.gz 82.7 kB With provenance Details for ai_debate_tool-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-debate-tool 1.2.0
File Interpreter ABI Platform Actions
ai_debate_tool-1.2.0-py3-none-any.whl Python 3 none any Details for ai_debate_tool-1.2.0-py3-none-any.whl

Total release size: 185.8 kB

Release files / ai_debate_tool-1.2.0.tar.gz

Download URL ai_debate_tool-1.2.0.tar.gz
Size 82.7 kB
Tags Source
SHA-256 checksum
How to use checksums
be0dd8ede73f0e499b39796b6301da320b32f08fefdf2d5775f1b6ab485068e5
BLAKE2b-256 checksum
How to use checksums
90727f9749159ece7b8ac5b9a40bc8276494ead42947c2435b8b81ab68bfe251
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2026.

Transparency log

Release files / ai_debate_tool-1.2.0-py3-none-any.whl

Download URL ai_debate_tool-1.2.0-py3-none-any.whl
Size 103.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
918889eb5d59135b57813e1146d72e67ca0a8ac225d1f0907b8cf99e27282c80
BLAKE2b-256 checksum
How to use checksums
3c2c51166bc01ed2ca332c19e707d76409debd1541f6dc82f108b4e57bee9109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2026.

Transparency log

Security for ai-debate-tool 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_debate_tool-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page