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.

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.1.tar.gz (518.1 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.1-py3-none-any.whl (129.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tandem_cli-0.5.1.tar.gz
  • Upload date:
  • Size: 518.1 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.1.tar.gz
Algorithm Hash digest
SHA256 5fe9b26eb8126a32e02b64f2d39df32b5567f545695dc164762063d1a70ed7a3
MD5 f2abb0693e7dca1fe52380ca3c8b7f16
BLAKE2b-256 503f934b70d5f7e157f1832dda907ae0510a5763ef9e6c55c3b614016efab8c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tandem_cli-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 129.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d65765734183c5d1020c0b49da920cb5e819e73bc0b8e077b9e7aad821e7a5c3
MD5 8af20a194e7ab9eba7380984d49eb571
BLAKE2b-256 58df17435e42dfae3dfe55fce10f8b8a54603f7b7377bb7e7e53c6112dd66fc7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.2

2 files

This release

0.5.1 This release

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