Skip to main content

Corpus Callosum

TL;DR

Corpus Callosum pairs your AI coding agent with a second AI that reviews its work. You keep working in Claude Code, Codex CLI, or Antigravity. The reviewer runs in the background and can flag a problem before your agent finishes, such as a test that’s still failing.

For a design decision or a tricky bug, you can ask both agents the same question. Each gives an answer before seeing the other’s. Corpus Callosum shows where they disagree and suggests a check you can run to settle it.

If you already use two live agents in the same repository, they can share project rules, hand off work, and warn each other before editing a file the other has claimed.

Quickstart

You’ll need Python 3.11+ and a reviewer. This example uses a signed-in Codex CLI. You can also use Claude Code, Antigravity, a model API, or local Ollama. Reviewer configuration

1. Install Corpus Callosum

Install globally with uv or pipx without cloning the repository:

# From PyPI
uv tool install corpus-callosum-ai

# Or directly from the v0.4.1 GitHub Release wheel
uv tool install https://github.com/EmanueleMeazzo/corpus-callosum/releases/download/v0.4.1/corpus_callosum_ai-0.4.1-py3-none-any.whl

(Prefer pip? Run pip install corpus-callosum-ai inside a virtual environment, or clone the repo and run uv sync --extra dev for local development.)

Initialize configuration and verify your setup:

callosum config init
callosum doctor

config init creates ~/.callosum/config.toml. In its [right_backend] section, change provider = "mock" to provider = "codex_cli" to use your Codex login. The mock provider gives canned responses for offline testing.

2. Connect your coding agent

Run these commands inside the repository you want to work in (/path/to/your/repo). Choose --target codex, claude, or antigravity to match the agent you’ll use interactively. On platforms without Go installed, callosum install automatically downloads and SHA-256-verifies the matching native callosum-hook release binary (reusing a runnable cached binary or falling back to the built-in Python shim when offline).

callosum install --target codex --workspace /path/to/your/repo
callosum daemon start --background --workspace /path/to/your/repo
callosum daemon status --workspace /path/to/your/repo

3. Try an independent review

Open your coding agent in the target repository. For Claude Code, use the claude --plugin-dir command printed by the installer. For example, ask it the following question.

Use callosum_split_think to review this design decision. Our service runs on one machine and serves two clients. Should we keep session storage in SQLite or move it to Redis?

The result includes each disagreement, a proposed check, and a recommended next step. To follow the review in another terminal, open the Live EEG Monitor.

Why Corpus Callosum?

Standard multi-agent debate frameworks routinely perform worse than a single strong model. In one study of five debate methods across nine benchmarks, the extra computation produced no reliable advantage over single-agent methods. Zhang et al., 2025

A reviewer who sees a convincing fix first can end up polishing it while missing the underlying bug. That tendency to go along with another agent’s answer is called sycophancy. Corpus Callosum gives the reviewer the original problem first. The agents compare answers afterward, and you get a recommendation you can test without reading a debate transcript.

The project takes its name from the bundle of nerve fibers connecting the brain’s two hemispheres. In the software, left is the agent you work with and right is the reviewer. Protocol design

The main agent (amber) and reviewer (cyan) are connected by a narrow bridge.

Operating modes

Mode How it works
shadow You work with one agent. A second model reviews edits and command failures in the background.
paired Two live agents register as left and right in the same repository. They can share rules, claim files, and ask for independent reviews.
hybrid (default) The background reviewer runs until a live agent registers as right in that workspace.

Pair two live agents

Install both plugins in the same repository and assign one agent to each role. These commands pair Antigravity with Codex.

callosum install --target antigravity --hemisphere left --workspace /path/to/your/repo
callosum install --target codex --hemisphere right --workspace /path/to/your/repo

Launch both agents in that directory. They use the repository path to find the same session. Once registered, each can use callosum_claim_focus to tell the other which files it is editing.

Configure the reviewer

Set [right_backend] in ~/.callosum/config.toml to choose the reviewer. For standalone callosum think questions, configure [left_backend] as well, or pass your own first answer with --thesis.

Reviewer provider What you need
Codex CLI, Claude Code, or Antigravity codex_cli, claude_cli, or agy_cli The matching CLI installed and signed in
OpenAI, Anthropic, or Gemini openai, anthropic, or gemini The provider’s API key in OPENAI_API_KEY, ANTHROPIC_API_KEY, or GEMINI_API_KEY
Local Ollama ollama A running Ollama server with the selected model installed
OpenAI-compatible endpoint openai_compatible The endpoint’s base_url, model name, and credentials if required
Offline testing mock No account or model download

For example, this configuration connects the reviewer to a local Ollama model.

[right_backend]
provider = "ollama"
model = "qwen2.5-coder:14b"
base_url = "http://127.0.0.1:11434/v1"

Settings load in the following order. Later values override earlier ones.

  1. Built-in defaults
  2. ~/.callosum/config.toml or the file named by CALLOSUM_CONFIG
  3. The target repository’s .callosum.toml
  4. Environment variables such as CALLOSUM_MODE, CALLOSUM_HOST, CALLOSUM_PORT, CALLOSUM_RIGHT_PROVIDER, and CALLOSUM_RIGHT_MODEL

Run callosum config show --workspace /path/to/your/repo to inspect the effective settings. The Corpus Callosum checkout has its own configuration for hybrid mode, with Antigravity on the left and Codex on the right. Repository configuration

Plugin installation

Each plugin gives the agent access to Callosum tools through the Model Context Protocol (MCP). It also installs hooks that report tool activity and deliver reviewer feedback. Use --target all to install for all three agents, or --global for a user-wide installation.

Agent Workspace installation
Antigravity .agents/plugins/corpus-callosum/
Claude Code .claude/plugins/corpus-callosum/. The installer prints the launch command. Add --http-hooks during installation to let Claude Code contact the daemon directly.
Codex CLI .codex/plugins/corpus-callosum/. The installer adds an MCP entry to .codex/config.toml and writes .codex/hooks.json.

The installer prints any remaining setup steps for your agent. Portable plugin bundles

Independent review with split_think

  1. Answer separately. Both agents get the question, context, and project rules. If the main agent supplied a proposed answer, the reviewer cannot see it. When two live agents participate, the daemon holds the first submission until both have answered.
  2. Compare the answers. For each disagreement, the reviewer identifies the assumption at stake and suggests the cheapest way to check it. That might be one test, a file to inspect, or a small experiment.
  3. Choose a next step. The main agent receives the comparison and a recommended action. The result also includes sycophancy_risk, a 0–1 score based on features such as wording overlap, missing evidence, and whether the comparison found disagreements.

Two agents answer separately, compare their answers, and produce one recommendation.

You can try the same workflow from the command line. This example supplies the first answer, so only the reviewer needs a configured model.

callosum think "Should we move session storage from SQLite to Redis?" --context "One machine serves two clients." --thesis "Keep SQLite until we measure write contention." --workspace /path/to/your/repo

An example from this project. During the v0.1 review, Antigravity proposed sending short Git diffs to the reviewer. Codex independently flagged a timing problem. A failed test could trigger a background review, pass on the next run, and still produce a warning from the old run. Callosum now checks that a finding is current before delivering it. Passing lint leaves an unrelated test failure open. The review also led to fixes that keep the first answer private, let an interrupted request resume, and let an agent finish while a review is still running. Regression tests

Excitatory–Inhibitory Callosal Gate

AKA When the reviewer can interrupt.

The gate decides what happens to a reviewer’s finding. It weighs the reported importance and confidence, accounts for supporting evidence such as a failing test, and uses two configurable thresholds.

Finding at the default thresholds What your agent sees
Score below 0.45 The monitor records the finding. The agent carries on.
Score of at least 0.45 The agent gets a non-blocking note, unless the finding qualifies to block an action.
A request to block (inhibit) scores at least 0.72 It can block a matching tool call or ask the agent to keep working when it tries to finish.

By default, the gate suppresses duplicate messages for 120 seconds and can block completion once per turn. Dismissing a finding raises the threshold for similar findings in that session. A passing check clears the old warning, so a later regression can surface again. Gate implementation

The gate filters low-scoring findings, delivers notes, and can block an action on a strong warning.

Live EEG Monitor

Run callosum monitor to see what the reviewer is checking, which findings pass the gate, and when both agents finish an independent review. The monitor groups repeated edits so you can follow the sequence of events. Try the offline demo with callosum monitor --demo.

Animated recording of the Corpus Callosum Live EEG Monitor demo showing both hemispheres, animated callosal signals, active review tracking, alerts, and the live activity log.
Recorded from callosum monitor --demo — showing live activity flow, background review, blocking alert, test-driven resolution, and blind second-opinion synthesis.

Architecture

A local daemon listens on 127.0.0.1:7337 by default. The coding agent’s hooks send it short reports about edits and commands. The daemon stores session state in SQLite, schedules reviews in the background, and streams events to the monitor.

flowchart LR
    A["Coding agent"] <-->|"Tool events and feedback"| H["Agent hooks"]
    H <--> D["Local daemon"]
    A <-->|"Review requests and file claims"| MCP["MCP server"]
    MCP <--> D
    D <-->|"Review context and findings"| R["Background reviewer or live peer"]
    D --> M["Live EEG Monitor"]
  • Hooks and timeouts. callosum install compiles the small Go hook executable when Go is available, downloads the SHA-256-verified binary from GitHub Releases when installed from a package, and reuses a runnable cached binary or falls back to Python if offline. If the daemon times out or is offline, the hooks let the agent continue. By default, the stop hook checks only completed reviews.
  • Reviewer permissions. Background CLI reviewers run in read-only or plan mode. Child processes carry CALLOSUM_INTERNAL=1 so their own hooks skip review and avoid a loop.
  • What agents share. Each reviewer message has room for a 240-character summary, 600 characters of detail, and six evidence references. A workspace that changes the API endpoint needs explicit trust to use inherited credentials. Protocol specification · JSON schemas

The v0.3 release added native hooks (about 15 ms median for tool and prompt hooks against a live local daemon in the project’s Windows measurement), tied each submitted answer to its session and participant, and added retries for interrupted reviews. It also handles partial test runs, so passing one test cannot clear a failure in another. v0.3 regression tests

MCP tool reference

The MCP server uses the local daemon when available and can use an embedded SQLite database when the daemon is offline.

Tool What it does
callosum_status Show the mode, backends, registered agents, reviews, and pending messages.
callosum_register Register a live agent as left or right.
callosum_set_invariants Set or append project rules both agents should follow.
callosum_claim_focus Claim the files you are editing and check for overlap.
callosum_split_think Ask for independent answers and compare them. Use async_mode=True for a slow model or submission_id to retry the same request.
callosum_get_escrow Check a review’s status and fetch its completed comparison.
callosum_send_impulse Send the other agent a note, a request to block an action, a file claim, or a handoff.
callosum_read_impulses Read pending messages for your agent, optionally filtered by conversation.
callosum_dismiss_impulse Dismiss a message and raise the threshold for similar findings.
callosum_verify Ask the background reviewer to check recent activity against project rules.

CLI reference

Run these commands directly after installing (or prefix with uv run inside a source checkout). Use --help on any command for its options.

Command Purpose
callosum doctor Check the daemon, configuration, available CLIs, and API key availability.
callosum config init / show Create a starter configuration or inspect the settings in use.
callosum daemon start / status / stop Start, check, or stop the daemon. Use start --background to detach it.
callosum install --target codex Install the plugin for the selected coding agent.
callosum mcp Start the MCP server. Available transports are stdio and streamable-http.
callosum monitor Open the Live EEG Monitor. Use --session-id to filter the stream or --demo to explore it offline.
callosum status Show the current workspace session.
callosum think "question" Run an independent review. Use --verbose to see both answers or --async to return early when the daemon is running.
callosum schemas export Export the protocol’s JSON schemas.

Anti-sycophancy benchmark

The benchmark compares two ways of reviewing a flawed proposal. In one, the reviewer reads the proposal first. In the other, the reviewer forms an independent answer with split_think. It checks for keywords related to three known problems involving signing-key rotation, SQLite write locks, and payment webhook retries. Benchmark code and scenarios

# Check that the benchmark runs offline
uv run python evals/benchmark_anti_sycophancy.py --provider mock

# Run it with a live reviewer
uv run python evals/benchmark_anti_sycophancy.py --provider codex_cli --model gpt-6.2-astra

Development

git clone https://github.com/EmanueleMeazzo/corpus-callosum.git
cd corpus-callosum
uv sync --extra dev
uv run ruff check src tests evals
uv run pytest -v

Python source · Native Go hook · Test suite

Metadata

Release files for corpus-callosum-ai 0.4.1

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

Source distribution (sdist)

Source distribution for corpus-callosum-ai 0.4.1
File Size Uploaded Provenance Actions
corpus_callosum_ai-0.4.1.tar.gz 142.4 kB With provenance Details for corpus_callosum_ai-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for corpus-callosum-ai 0.4.1
File Interpreter ABI Platform Actions
corpus_callosum_ai-0.4.1-py3-none-any.whl Python 3 none any Details for corpus_callosum_ai-0.4.1-py3-none-any.whl

Total release size: 248.8 kB

Release files / corpus_callosum_ai-0.4.1.tar.gz

Download URL corpus_callosum_ai-0.4.1.tar.gz
Size 142.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d5c665213228daa61407e7c3c149f2f4d78b957b94f4b7423221e09337afaba5
BLAKE2b-256 checksum
How to use checksums
904cb12e2f170eea7f50e928ec1b4462293e83029a08d4f2cf1d41101d4def2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / corpus_callosum_ai-0.4.1-py3-none-any.whl

Download URL corpus_callosum_ai-0.4.1-py3-none-any.whl
Size 106.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c27f77b368a2da901e2828bdd2f5c3f8c3559dec30fcb1ac698cf07eb3829f2
BLAKE2b-256 checksum
How to use checksums
4772f60cbee554ab6bfca4e1d0d5c3a4b79380c291d0754b16b3b477ba6a02b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for corpus-callosum-ai 0.4.1

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 corpus_callosum_ai-0.4.1.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 Nov 29, 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.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

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