Skip to main content

mainai

A CLI that figures out which coding agent (Claude Code, Codex, Grok, ...) last did real work in a project folder, and hands off cleanly to the one you pick next.

The problem

Working the same project folders with several coding agents means that coming back months later, it's unclear which agent did the most recent real work, and what the other agents did in the meantime.

What it does

$ mainai .
Found 6 sessions in ~/Dropbox/inflammatix/projects/endotypes
  codex   2026-09-25  "fix the endotype clustering..."   <- latest work
  claude  2026-09-18  "add the GSE cohort loader..."
  ...
Continue with: Codex (its edits match the current files)
Wrote HANDOFF.md (summaries of the 4 Claude sessions)
Launching: codex "Read HANDOFF.md, then continue where we left off."
  1. Reads every agent's stored conversations, keeps the ones for the current folder.
  2. Decides which agent to continue with, based on which session's edits match the files actually on disk (not just the newest timestamp).
  3. Summarizes the relevant parts of the other agents' sessions into HANDOFF.md.
  4. Starts the chosen agent, pointed at HANDOFF.md.

mainai with no arguments prints help and does nothing, so a stray bare invocation never spends LLM usage. Flags: --list (sessions + pick only, no LLM, no write), --agent NAME (override the pick), --no-launch (write HANDOFF.md but don't start the agent).

See mainai.md for the full design notes (reader architecture, per-agent log formats, picker logic, summarizer, scope/build order).

Status

Not yet built. Design only.

Development

uv-managed project.

uv sync
uv run mainai --list .

Metadata

Release files for mainai 0.1.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 mainai 0.1.0
File Size Uploaded
mainai-0.1.0.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mainai 0.1.0
File Interpreter ABI Platform
mainai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / mainai-0.1.0.tar.gz

Download URL mainai-0.1.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0f378842ae4bf16775088c6b0a85ac70d71c11a0c718e7e3dc6f3bf59246805c
BLAKE2b-256 checksum
How to use checksums
fd953a14f947e66ea0de0cf5b0ed4497e6a89f85f8426df8cac6513d0653801e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release files / mainai-0.1.0-py3-none-any.whl

Download URL mainai-0.1.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5335f1a9773479dd1306202dcb0d7b8dbb1cba85e0c0c1e2e6d8607ef87ad99
BLAKE2b-256 checksum
How to use checksums
bdd2ec5c82a3752497f384da940392f74b5ddd140e68e71780038fdc38599c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release history Release notifications | RSS feed

0.2.2

2 release files

0.2.1

2 release files

This release

0.1.0 This release

2 release files

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