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

Metadata

Release files for tandem-cli 0.5.2

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

Source distribution (sdist)

Source distribution for tandem-cli 0.5.2
File Size Uploaded Provenance Actions
tandem_cli-0.5.2.tar.gz 519.4 kB Without provenance Details for tandem_cli-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tandem-cli 0.5.2
File Interpreter ABI Platform Actions
tandem_cli-0.5.2-py3-none-any.whl Python 3 none any Details for tandem_cli-0.5.2-py3-none-any.whl

Total release size: 649.6 kB

Release files / tandem_cli-0.5.2.tar.gz

Download URL tandem_cli-0.5.2.tar.gz
Size 519.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b377058d7bbc4094da69911a29f710e3b3b00e9049ae9694194028b99679293
BLAKE2b-256 checksum
How to use checksums
5b07eb87bedb7af7bf94ed1a6a56e6c431ff9aa4824215bf82e2a40da6717d30
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / tandem_cli-0.5.2-py3-none-any.whl

Download URL tandem_cli-0.5.2-py3-none-any.whl
Size 130.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a337df77bd757d58b85346b610bbf0a6a7a4fadc3122025d6d5ea554c30d0005
BLAKE2b-256 checksum
How to use checksums
d6cd0c3bfe6c453afd625eb392ca61e11f01ab6824e6513333196f3a7596fa2d
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for tandem-cli 0.5.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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