One gateway for 7 coding agents: Pi, OpenCode, T3 Code

Launch7 min read

Thank you to the teams who build these apps: Anthropic for Claude Code and Claude Desktop, OpenAI for Codex and the ChatGPT desktop app, pingdotgg for T3 Code, the OpenCode team, and earendil-works for Pi. Thank you also to the community that asked for each one. Today Context Mode connects 7 apps: Claude Code, Claude Desktop, Codex, Codex Desktop, T3 Code, OpenCode and Pi. You install each app the way its makers say. Then one command, npx @context-mode/cli, connects the ones you pick. One console shows all of them, and one memory store serves all of them. You keep your app, your model and your own key or login.

TL;DR

Which coding agents work with Context Mode?

This post answers one question: which coding agents can use one gateway, and how do you connect them? Until now, Context Mode connected Claude Code and Codex. Now it connects 7 apps:

Context Mode is a gateway between your coding agent and the model provider, Anthropic or OpenAI. Each app keeps its own login, its own model and its own config file. Setup changes only its own keys: the address the app sends requests to, the device-key header, and a few app settings it names in the diff. There is no plugin, no wrapper and no fork.

Pick your app: install, connect, restart

Pick an app to see its makers' install step, then the Context Mode command, then what to keep in mind. Claude Code and Codex share one tab.

App
# install Claude Code / Codex the way their makers' docs say (see the table below)
# then use them with their own logins:
$ npx @context-mode/cli setup --agent claude
$ npx @context-mode/cli setup --agent codex
# or both at once:
$ npx @context-mode/cli setup --agent all

Claude Code: quit it and run claude again. Codex: start a new session. A shell-only OPENAI_API_KEY is not sent; Codex sends only the key in its own login.

# Claude Desktop's own way: Help → Troubleshooting → Enable Developer Mode,
# then Developer → Configure Third-Party Inference… → Connection → Apply Changes
# or let the CLI write the same entry (named contextmode):
$ npx @context-mode/cli setup --agent claude-desktop

Quit with Cmd+Q, not only close the window, then open it again. Which login the Chat tab may use: not verified.

# the ChatGPT app reads the Codex CLI's ~/.codex/config.toml
# sign in to Codex the usual way, then:
$ npx @context-mode/cli setup --agent codex-desktop

One write covers the Codex CLI and the app. Quit with Cmd+Q and open it again. If a [profiles.*] picks another provider, that profile wins while it is active, and setup names it.

$ brew install --cask t3-code
# or the CLI/server: curl -fsSL https://t3.codes/install.sh | sh
# Settings → Providers: keep CODEX_HOME at ~/.codex, no Shadow home path
$ npx @context-mode/cli setup --agent t3code

It prints the T3 Code step first, then writes the Claude Code file and the Codex file, once each. Quit T3 Code fully and open it again.

$ curl -fsSL https://opencode.ai/install | bash
# or: npm install -g opencode-ai, or: brew install anomalyco/tap/opencode
$ opencode auth login   # pick Anthropic, add your API key
$ npx @context-mode/cli setup --agent opencode

Needs your own Anthropic API key. Quit OpenCode and run it again. Verified on opencode-ai 1.19.4; OpenCode 2.x is not verified.

$ npm install -g @earendil-works/pi-coding-agent
# or: curl -fsSL https://pi.dev/install.sh | sh
# in Pi, /login with your Anthropic or OpenAI API key
$ npx @context-mode/cli setup --agent pi

Needs your own API key. A Claude subscription (Pro/Max) cannot be used in Pi: this is Anthropic's rule. Use an Anthropic API key, or turn on extra usage at claude.ai/settings/usage. If Pi is signed in with a subscription, setup leaves Anthropic alone, says so, and sets only OpenAI. Quit Pi and run it again.

How to install each app, then connect it

Order matters for us: the app's own install first, then Context Mode. Every command below is the one its makers or our CLI give. Context Mode needs Node 20.12 or later.

AppNative installContext Mode commandWhat you need
Claude CodeAnthropic's install (macOS, Linux, WSL): curl -fsSL https://claude.ai/install.sh | bash (setup page). Its settings reference names the keys setup writes.npx @context-mode/cli setup --agent claudeA Claude login (subscription or API key). Restart Claude Code.
Claude DesktopDownload it from claude.com/download. Then Help → Troubleshooting → Enable Developer Mode, then Developer → Configure Third-Party Inference… → Connection → Apply Changes (in-app configuration)npx @context-mode/cli setup --agent claude-desktopQuit with Cmd+Q and open it again.
CodexOpenAI's install: npm install -g @openai/codex or brew install --cask codex (Codex README). Its config reference names the provider table setup writes.npx @context-mode/cli setup --agent codexA Codex login: ChatGPT, or an API key stored with codex login. Start a new session.
Codex DesktopThe ChatGPT app with Codex. Download it from OpenAI's ChatGPT desktop app page. It reads ~/.codex/config.toml.npx @context-mode/cli setup --agent codex-desktopSame login as Codex. Quit with Cmd+Q and open it again.
T3 Codebrew install --cask t3-code, or curl -fsSL https://t3.codes/install.sh | sh. Windows: winget install T3Tools.T3Code (install docs)npx @context-mode/cli setup --agent t3codeThe Claude Code and/or Codex you have, with their logins. Quit T3 Code fully and open it again.
OpenCodecurl -fsSL https://opencode.ai/install | bash, or npm install -g opencode-ai, or brew install anomalyco/tap/opencode (docs)npx @context-mode/cli setup --agent opencodeYour own Anthropic API key, with opencode auth login or ANTHROPIC_API_KEY.
Pinpm install -g @earendil-works/pi-coding-agent, or curl -fsSL https://pi.dev/install.sh | sh (earendil-works/pi)npx @context-mode/cli setup --agent piYour own Anthropic or OpenAI API key, with Pi's /login or ANTHROPIC_API_KEY / OPENAI_API_KEY.

Two gaps, said plainly. This post gives no install command for Claude Code or Codex, and no download link for Claude Desktop or the ChatGPT app: use the ones their makers give. Windows users of T3 Code can also run scoop install extras/t3code or irm https://t3.codes/install.ps1 | iex.

How to connect all your coding agents in one command

Run the CLI with no arguments. It signs you in when this terminal has no device key yet. Then it lists the 7 apps, with the ones it finds here checked. Space toggles an app, Enter confirms, Ctrl+C stops with nothing written.

$ npx @context-mode/cli
# signs you in in the browser if this terminal has no device key
Which apps should use context-mode? (space to toggle, enter to confirm)
# the 7 apps, each marked found or not found; found ones checked
Claude Code  connected (workspace …)
Codex        connected (workspace …)
OpenCode     connected (workspace …)
Pi           connected (workspace …)
Console: https://console.contextmode.ai
Ready

Next:
  1. Restart your agents:
       Claude Code: quit it and run `claude` again (a running session keeps the old settings).
       Codex: start a new session (`codex`).
       OpenCode: quit it and run `opencode` again (it reads its config at start).
       Pi: quit it and run `pi` again (it reads models.json at start).
  2. Ask it anything. Now and then a line that starts with "⚡ context-mode" shows under the answer.
  3. Check it worked: your request shows on https://console.contextmode.ai within a minute.
  Not there, or an error in the agent? Run: npx @context-mode/cli doctor

The CLI's after-setup text still says "⚡ context-mode". The line itself now starts with "⏺ contextmode ·". Before it prints Ready, the CLI sends each app one check request through the gateway (marked x-cm-dry-run: 1). The gateway answers it itself, so it costs nothing and is not counted. If a check fails, the CLI says that app will not go through Context Mode yet.

One detail: --agent all covers Claude Code and Codex only. T3 Code, OpenCode and Pi come from the list above, or from --agent t3code, --agent opencode and --agent pi.

Check, fix and undo

$ npx @context-mode/cli status
Gateway: https://gateway.contextmode.ai
Console: https://console.contextmode.ai
# who is signed in, the workspace, this device, then one line per agent

$ npx @context-mode/cli doctor
# checks the gateway answers, the device key is valid, and each installed agent is set up

$ npx @context-mode/cli disconnect --agent pi
# removes what setup wrote; the file goes back as it was, backup first

What you get in each app

The gateway does not switch features on or off by app name. Each of the 7 apps sends a known client fingerprint, so each one gets Saving, Memory, Skills, Instructions, Recall, Search and Active Context on every request. Protect and Session resume differ by app (see the matrix). Pick a feature to see one example.

Feature
You, in Claude Code:
"run the tests and fix the failing one"
# the test run prints every result
# the model gets the failing test, its error and the summary line
# the passed results stay out of the context

Large tool output (logs, fetched pages, big files) stays out of the model's context. Works on every request in all 7 apps. Measured on Claude Code: see the benchmarks.

Monday, in Claude Code:
"We use pnpm in this repo, not npm."
Thursday, in Pi, same folder:
"Add the date library."
pnpm add ...

One memory store serves all your apps. Facts about you, your code and your task are kept for any app. Facts about how one app behaves stay with that app. Not measured live across apps yet.

You, in T3 Code:
"use release-notes for this sprint"
# the release-notes skill loads for this turn

Import skills once, for example from GitHub. They run from the gateway, so you install nothing on each machine. When a request fits a skill, it loads by itself.

// Console: Settings → Instructions
Keep answers short.
Never touch code or technical terms.

Write your rules once in the console. Every request from each connected app carries them, on every machine.

You, in Claude Desktop, late in a long session:
"what did we decide about the quota check this morning?"
# the agent reads the decision back from the archive

Long history goes to the archive, not lost. The agent reads older work back when it needs it. Measured on Claude Code; works on every request elsewhere.

$ git push origin main
# Claude Code, Codex: blocked by your rule
# Pi: recorded in Activity; blocking not verified
# Claude Desktop, Codex Desktop, T3 Code, OpenCode: not verified yet

Protect is enforced on Claude Code and Codex. Do not count on it to stop a command in the other apps yet.

The honest matrix

"Yes" means the gateway applies it to every request from that app. "Measured" means we ran the proof on that app. We give no saving number for an app we did not measure.

AppSaving, Skills, Instructions, RecallMemoryProtectSession resume
Claude CodeYes; Saving and Recall measuredYesEnforcedYes
Claude DesktopYesYes, stored as Claude Code; Chat tab scope not verifiedNot verifiedNo
CodexYes; Saving measured in partYesEnforcedYes
Codex DesktopYesYes, stored as CodexNot verifiedNot verified
T3 CodeYesYes, stored as Claude Code or CodexNot verifiedNo
OpenCodeYesYes, stored as OpenCodeNot verifiedNo
PiYesYes, stored as PiRecorded onlyNo

Read more: Saving, Memory, Skills, Instructions, Recall, Active Context, Search, Protect and Session resume.

One memory across Claude Code, Codex, OpenCode and Pi

Most people use more than one agent. Without a shared store, each one starts from zero, and you say "use pnpm" seven times. With Context Mode, a rule you give Claude Code on Monday comes back in Pi on Thursday, in the same project. This works by design: facts about you and your code are not tied to one app. We have not yet measured it live across apps.

Facts about you, your code and your task are stored for any app. Skill facts and facts about how one app behaves are stored with the app that captured them (claude-code, codex, opencode or pi), because a skill in one app can mean nothing in another.

Is setup safe for my config files?

Setup edits files you care about, so it follows the same rules for every app:

$ npx @context-mode/cli setup --agent opencode --dry-run   # show the changes, write nothing
$ npx @context-mode/cli setup --agent opencode --check     # exit 0 when configured, 2 when not
$ npx @context-mode/cli setup --agent opencode --yes       # write without asking

Say this plainly

Read the post for your app

Start now

Install your apps their own way, then run one command. Open the Console to see every app in one workspace.

npx @context-mode/cli

Context Mode is under the Elastic License 2.0 (ELv2).

Get started free

Your coding agent costs less and remembers your project.

Start free: 1,000 requests, every feature, no card. After you sign in, the console gives you one command to connect your coding agent.

Read the docs