Skip to main content

🤝 tandem

One coding session. Multiple AI agents. Shared context.

Use Claude Code, OpenAI Codex CLI, and opencode in one continuous coding session. Work in their native interfaces, press Ctrl-] to move to the next CLI, and continue without copying prompts or rebuilding context by hand.

CI PyPI Python 3.11+ License: MIT

tandem demo — one session relayed across Claude Code, Codex and opencode

Quick start

You need Python 3.11+ and at least two supported CLIs installed and signed in: Claude Code, Codex CLI, or opencode.

uv tool install tandem-cli   # or: pip install tandem-cli
cd your-project
tandem

Work normally in the CLI that opens. Press Ctrl-] to continue the same session in the next CLI. If you press it while the model is working, tandem waits until the response finishes; press it again to cancel the switch.

Exit normally when you're done. Come back later with:

tandem resume      # resume the latest session in this directory
tandem sessions    # find recent sessions across directories

By default, tandem opens the first usable CLI in your configured order. Use tandem --active codex or tandem --active opencode to choose another.

What's new in 0.5

Rate-limit windows on the tab bar. Every slot now shows its account's rate limits — percent used per window, labeled by window length — so you can see which subscription has room before you press Ctrl-]. The active slot also carries the model's live context and the session's input↑ / output↓ token totals:

 claude ● 144k ctx · 7.6M↑ 312k↓ · 5h 4% 7d 41% │ codex ○ 7d 12% │ opencode ○   ^] flips

The figures come from the same account endpoints that claude's /usage and codex's /status call, using the credentials those CLIs already keep on disk, refreshed every minute and after each response. They are cosmetic by design: a failed fetch blanks the figure and never touches sync, and API-key logins and opencode show none. These polls are tandem's only network calls — set rate_limits = false under [frame] in ~/.tandem/config.toml to turn them off. See Configuration for the status bar's other settings.

0.5.1 keeps up with the current CLIs. claude 2.1.26x and codex 0.153 changed their session records, and codex now holds a writer lock on every open thread. On those versions 0.5.0 failed tandem doctor and every flip into claude on the new metadata records, warned that codex was out of range at each start, and could lose a claude → codex flip to already has an active writer. All three are fixed, and codex's list-shaped tool outputs now reach the other side as text with their exit codes intact.

0.5.2 stops claude complaining about synced turns. claude 2.1.261 restores a session's model on resume from its last assistant entry, and a claude session that had never run a turn of its own (claude → codex → opencode → claude) opened with Session model <synced> could not be restored … using fable instead. Synced entries now carry claude's own <synthetic> tag until claude has run, which its resume skips; the synced turns still render and still reach the model.

Why tandem?

  • Keep going when a model hits its limit. The tab bar shows each account's rate-limit windows; move to another CLI and continue with the same files and conversation history.
  • Bring different models to the same problem. Ask another CLI for a second opinion without copying a wall of context between terminals.
  • Keep the native tools you already use. Claude Code, Codex, and opencode retain their own interfaces, commands, keybindings, and MCP servers.
  • Work through a single-provider outage. If another configured CLI is available, switch and continue until the affected provider recovers.

Want GPT subagents inside Claude Code too? See the GPT subagents guide. For more use cases, see Why tandem?.

How it works

┌──────────────────────────────────────────────┐
│ Work normally in a native coding CLI         │
└──────────────────────┬───────────────────────┘
                       ▼
┌──────────────────────────────────────────────┐
│ tandem keeps the other sessions in sync      │
│ locally — without calling another model      │
└──────────────────────┬───────────────────────┘
                       ▼
┌──────────────────────────────────────────────┐
│ Press Ctrl-] and continue in the next CLI    │
└──────────────────────────────────────────────┘

Only the active model runs. tandem translates its growing conversation into the other CLIs' native session formats using local file access, so they are ready when you switch. Your session stays in the CLIs' own storage plus a small local database in ~/.tandem; tandem adds no cloud sync or telemetry (its only network calls are the optional rate-limit polls for the tab bar).

See How tandem works for transcript translation, switching, crash safety, compatibility, and data locations.

Everyday commands

Command What it does
tandem Start a new session
Ctrl-] Continue in the next CLI
tandem resume [id] Resume the latest or a specific session in this directory
tandem sessions [-n N] List recent sessions across directories
tandem run --on codex "…" Send one contextual prompt to another CLI (claude, codex, or opencode)

Learn more

  • Why tandem? — use cases, subscriptions, native tools, token visibility, and privacy
  • GPT subagents — plugin setup, worker models, routing, and sandboxing
  • Configuration — participants, startup arguments, the switch key, and the status bar
  • How tandem works — synchronization, switching, compatibility, and local data
  • Developing tandem — development setup and the harness adapter interface
  • Observed session formats — Claude Code, Codex, and opencode storage formats

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tandem_cli-0.5.2.tar.gz (519.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tandem_cli-0.5.2-py3-none-any.whl (130.2 kB view details)

Uploaded Python 3

File details

Details for the file tandem_cli-0.5.2.tar.gz.

File metadata

  • Download URL: tandem_cli-0.5.2.tar.gz
  • Upload date:
  • Size: 519.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tandem_cli-0.5.2.tar.gz
Algorithm Hash digest
SHA256 2b377058d7bbc4094da69911a29f710e3b3b00e9049ae9694194028b99679293
MD5 cf4cd273c60556c75f23bda8cf00edad
BLAKE2b-256 5b07eb87bedb7af7bf94ed1a6a56e6c431ff9aa4824215bf82e2a40da6717d30

See more details on using hashes here.

File details

Details for the file tandem_cli-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: tandem_cli-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 130.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tandem_cli-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a337df77bd757d58b85346b610bbf0a6a7a4fadc3122025d6d5ea554c30d0005
MD5 238ad0d70f2e35581f0d54010a0d6270
BLAKE2b-256 d6cd0c3bfe6c453afd625eb392ca61e11f01ab6824e6513333196f3a7596fa2d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.7

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.1

2 files

0.1.0

2 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