# Agent Setup This guide covers Claude client setup. For the Antigravity preview, use the [Pi/OpenCode setup guide](antigravity.md) and [support matrix](antigravity-support.md). [← Back to README](../README.md) Client configurations and existing verification notes. Examples use a local proxy with authentication disabled; replace placeholder keys with your `MERIDIAN_API_KEY` when enabled. Model lists are examples, not account entitlements: inspect `GET /v1/models` and match the client context window to the proxy's configured window. [OpenCode](#opencode) · [Crush](#crush) · [Droid](#droid-factory-ai) · [Cline](#cline) · [Aider](#aider) · [Codex](#codex-cli) · [OpenAI clients](#openai-compatible-tools-open-webui-continue-etc) · [Jcode](#jcode) · [Letta Code](#letta-code) · [Cherry Studio](#cherry-studio) · [ForgeCode](#forgecode) · [Pi](#pi) · [Prime Agent](#prime-agent) · [Claude Code](#claude-code) · [Polytoken](#polytoken) · [Hermes](#hermes-agent) Shell environment examples use POSIX syntax. In PowerShell, set variables with `$env:NAME = "value"` before launching the client. ### OpenCode ### OpenCode V1 **Step 1: Run `meridian setup` (required, one time)** ```bash meridian setup ``` When V1 and V2 are both installed, the default command keeps V1 selected. You can also select it explicitly: ```bash meridian setup --v1 ``` Setup adds the V1 Meridian plugin to the OpenCode global config (`~/.config/opencode/opencode.json`). It preserves unrelated plugin entries and all other settings. **Step 2: Start** ```bash ANTHROPIC_API_KEY=x ANTHROPIC_BASE_URL=http://127.0.0.1:3456 opencode ``` Or set these in your shell profile so they are always active: ```bash export ANTHROPIC_API_KEY=x export ANTHROPIC_BASE_URL=http://127.0.0.1:3456 ``` ### OpenCode V2 #### Host support policy Meridian qualifies Desktop/CLI **2.2.0** on Darwin arm64 with Opus 5.5, released CLI versions **2.0.16, 2.0.21 and 2.0.31**, and the earlier public `@opencode-ai/cli` betas `0.0.0-beta-18314`, `0.0.0-beta-18866`, and `0.0.0-beta-19271`. The 2.0.16 plugin API moved catalog editing into separate provider and model domains; the bundled plugin selects the matching host API at load time while keeping the beta path. The 2.2.0 qualification uses the app's actual bundled CLI, an independently installed V2 package, and real Opus 5.5 through the SDK. The earlier Opus 5 marker refusal remains a separate retained observation, not a claim of a fixed upstream classifier. Other platforms and unpinned priority failback are not certified by this run. See the [evidence and scope](maintenance/evidence/opencode-desktop-220-20261028/README.md). Because upstream V2 plugin interfaces, session headers, subagent tracking, and compaction hooks are under active iteration, Meridian enforces a strict fail-closed policy rather than permitting wildcard or unverified host versions. A V2 release is only added to `SUPPORTED_OPENCODE_V2_VERSIONS` after passing the matching headless package gate (`scripts/e2e-opencode-v2-package.mjs --live --extended` for the betas; `scripts/e2e-opencode-v2-stable-live.mjs` for stable versions). Across these gates, we verify: 1. **Plugin configuration & loading:** bundled and source plugin installation via `meridian setup --v2`. 2. **Session continuity & replay:** durable lineage across turns, restarts, and file store rehydration. 3. **Branching & undo:** tool execution, prefix rollback detection, and isolated fork histories. 4. **Subagent & agent isolation:** detached title/summary work, independent concurrent subagents, and compaction. 5. **Model discovery & effort variants:** `GET /v1/models` catalog synchronization, cold-start cache seeding, and cache invalidation. The stable gate exercises its real setup, title and generate jobs, resume, read-tool result, fork, compaction, and discovered effort variant. The beta gate additionally exercises undo, concurrent subagents, and cache invalidation; those checks have not yet been repeated on the released host. Unverified releases, phantom versions, and nightly/dev builds are rejected by `meridian setup --v2` with an informative message listing the verified releases. For a build that includes Desktop 2.2.0 support, select the app's bundled executable on macOS (older published Meridian builds reject this host): ```bash meridian setup --v2 --opencode-bin /Applications/OpenCode.app/Contents/Resources/opencode-cli ``` For the terminal client, select its executable: ```bash meridian setup --v2 --opencode-bin "$(command -v opencode)" ``` For an earlier beta, use its matching executable: ```bash npm install -g --prefix ~/.local @opencode-ai/cli@0.0.0-beta-19271 meridian setup --v2 --opencode-bin ~/.local/bin/opencode2 ``` If your binary is elsewhere, pass that path to `--opencode-bin`. V2 can self-update, so keep it pinned and launch it with automatic updates disabled while this compatibility target is current: ```bash export OPENCODE_DISABLE_AUTOUPDATE=1 ``` Configure V2's Anthropic provider to use Meridian. Keep the existing settings in `~/.config/opencode/opencode.json`; the important provider fields are: ```json { "$schema": "https://opencode.ai/config.json", "model": "anthropic/claude-opus-4-6", "agents": { "title": { "model": "anthropic/claude-haiku-5-5" } }, "providers": { "anthropic": { "settings": { "apiKey": "x", "baseURL": "http://127.0.0.1:3456/v1" }, "models": { "claude-opus-4-6": { "name": "Claude Opus 4.6" }, "claude-haiku-5-5": { "name": "Claude Haiku 5.5" } } } } } ``` Native V2 uses `providers` and `settings`, where V1 used `provider` and `options`. OpenCode 2.2 also normalizes supported V1 configuration; its plugin API is not backward-compatible, so a V1 Meridian plugin must still be replaced by setup. Verify the effective provider endpoint rather than assuming the plugin redirects requests: the plugin adds identity headers, not the base URL. Anything you put under `models` is your own override and wins over both the built-in catalog and Meridian's advertised models. Then use Desktop or start the selected terminal client (`opencode`, or `opencode2` for an earlier beta): ```bash OPENCODE_DISABLE_AUTOUPDATE=1 ~/.local/bin/opencode ``` The V2 plugin uses the native `model.request` and `http.request` hooks. It keeps primary and compaction requests attached to the correct OpenCode session, detaches concurrent hidden title/summary and transient generate requests, and gives each visible subagent its own trusted identity. Compaction keeps the conversation's model tier (`x-meridian-source: fork-compaction`), so a session on Opus or Fable `[1m]` that has grown past 200k tokens can still compact. Request bodies and model input are unchanged. The V2 plugin also reads `GET /v1/models` from the configured Meridian base URL and writes what it finds into V2's model catalog: the context window your subscription actually gets, and one model variant per effort level the proxy accepts. This corrects OpenCode's built-in models.dev entries where they differ from what Meridian serves, such as a 1M Sonnet 4.6 that Meridian deliberately serves at 200k. Select an effort with `provider/model#variant`, for example `anthropic/claude-opus-5#high`. Discovery never blocks startup: if Meridian is unreachable or answers with anything unexpected, and nothing has been discovered before, the catalog is left exactly as OpenCode built it. Discovery cannot run until OpenCode has finished assembling the catalog, so the first request against a freshly started server used to see only the built-in entries and reject a Meridian-only variant with `provider.no-route`. The plugin now caches each successful discovery in `~/.config/meridian/opencode-v2-catalog.json` and seeds the catalog from it before the first request, so a cold `anthropic/claude-haiku-5-5#xhigh` works. The cache is refreshed by every successful discovery and is ignored after seven days. **What this means if you change the provider.** While a cache is present, a freshly started server uses the last catalog Meridian served rather than OpenCode's built-in entries — including when Meridian is down. If you repoint the provider at something that is not Meridian, discovery notices that no Meridian base URL is configured, deletes the cache and rebuilds the catalog without it; the run after that is back to OpenCode's own entries. To clear it by hand, delete that file. The very first run after a brand-new install has no cache yet, so a Meridian-only variant still needs one prior request. For either generation, the plugin enables: - **Session tracking** — reliable conversation continuity across requests - **Safe hidden-agent concurrency** — title and summary work cannot advance the primary lineage - **Model defaults** — Opus requests 1M context; Sonnet 5+ has a native 1M window, while Sonnet 4.x uses 200k by default ([defaults and account eligibility](configuration.md#configuration)) - **Subagent model selection** — subagents use the 200k tier, preserving rate-limit budget If the plugin is missing, Meridian warns at request time. OpenCode 2.2 watches configuration and reloads plugins after setup; `/reload` forces a reload. Older clients may require a restart. #### oh-my-opencagent (OMO) > **OpenCode V1:** The integration below is validated on V1. Its plugin schema > has not been validated on the qualified V2 betas or released 2.0.16 host. [oh-my-opencagent](https://github.com/nicobailey/oh-my-opencagent) adds multi-agent orchestration on top of OpenCode. It works transparently through Meridian with no extra configuration — OMO uses the same OpenCode headers and tool format, so Meridian detects it automatically. Meridian parses OMO's Task tool descriptions to extract subagent names (explore, code-review, etc.) and builds SDK AgentDefinitions so Claude can route to the correct agent. Internal orchestration markers (``, `[SYSTEM DIRECTIVE: OH-MY-OPENCODE ...]`) are stripped automatically to prevent context leakage. OMO requires **passthrough mode** (the default for OpenCode) — subagent delegation flows through tool calls that must be forwarded back to the client. ### Crush Add a provider to `~/.config/crush/crush.json`: ```json { "providers": { "meridian": { "id": "meridian", "name": "Meridian", "type": "anthropic", "base_url": "http://127.0.0.1:3456", "api_key": "dummy", "models": [ { "id": "claude-fable-5-2", "name": "Claude Fable 5.2 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-fable-5-1", "name": "Claude Fable 5.1 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-fable-5", "name": "Claude Fable 5 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-opus-5", "name": "Claude Opus 5 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-opus-4-8", "name": "Claude Opus 4.8 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-opus-4-7", "name": "Claude Opus 4.7 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6", "context_window": 200000, "default_max_tokens": 64000, "can_reason": true, "supports_attachments": true }, { "id": "claude-opus-4-6", "name": "Claude Opus 4.6 (1M)", "context_window": 1000000, "default_max_tokens": 32768, "can_reason": true, "supports_attachments": true }, { "id": "claude-haiku-5-5", "name": "Claude Haiku 5.5", "context_window": 1000000, "default_max_tokens": 16384, "can_reason": true, "supports_attachments": true } ] } } } ``` ```bash crush run --model meridian/claude-sonnet-4-6 "refactor this function" crush --model meridian/claude-opus-4-6 # interactive TUI ``` Crush is automatically detected from its `Charm-Crush/` User-Agent — no plugin needed. ### Droid (Factory AI) Add Meridian as a custom model provider in `~/.factory/settings.json`: ```json { "customModels": [ { "model": "claude-fable-5-2", "name": "Fable 5.2 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-fable-5-1", "name": "Fable 5.1 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-fable-5", "name": "Fable 5 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-opus-5", "name": "Opus 5 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-opus-4-8", "name": "Opus 4.8 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-opus-4-7", "name": "Opus 4.7 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-sonnet-4-6", "name": "Sonnet 4.6 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-opus-4-6", "name": "Opus 4.6 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" }, { "model": "claude-haiku-5-5", "name": "Haiku 5.5 (Meridian)", "provider": "anthropic", "baseUrl": "http://127.0.0.1:3456", "apiKey": "x" } ] } ``` Then pick any `custom:claude-*` model in the Droid TUI. No plugin needed — Droid is automatically detected. ### Cline **1. Authenticate:** ```bash cline auth --provider anthropic --apikey "dummy" --modelid "claude-sonnet-4-6" ``` **2. Set the proxy URL** in `~/.cline/data/globalState.json`: ```json { "anthropicBaseUrl": "http://127.0.0.1:3456", "actModeApiProvider": "anthropic", "actModeApiModelId": "claude-sonnet-4-6" } ``` **3. Run:** ```bash cline "refactor the login function" ``` No plugin needed — Cline uses the standard Anthropic SDK. ### Aider ```bash ANTHROPIC_API_KEY=x ANTHROPIC_BASE_URL=http://127.0.0.1:3456 \ aider --model anthropic/claude-sonnet-4-6 ``` > **Note:** `--no-stream` is incompatible due to a litellm parsing issue — use the default streaming mode. ### Codex CLI Codex CLI ≥ 0.96 dropped `wire_api = "chat"` and speaks only the OpenAI **Responses API** (`/v1/responses`), which Meridian serves. Add a provider to `~/.codex/config.toml`: ```toml model = "claude-sonnet-5" model_provider = "meridian" [model_providers.meridian] name = "Meridian" base_url = "http://127.0.0.1:3456/v1" wire_api = "responses" env_key = "MERIDIAN_KEY" # any value unless MERIDIAN_API_KEY is set ``` ```bash MERIDIAN_KEY=x codex "refactor this function" MERIDIAN_KEY=x codex exec "run the tests and summarize failures" # non-interactive ``` Codex is a tool-driving agent — Meridian runs the `/v1/responses` endpoint in **passthrough** mode automatically (Codex executes its own shell/apply-patch tools), so no `MERIDIAN_PASSTHROUGH` change is needed. A harmless `Model metadata for 'claude-sonnet-5' not found` warning from Codex is expected — it doesn't recognize non-OpenAI model ids but works regardless. `model_reasoning_effort` is supported and won't stall the CLI. Reasoning carries **across** turns through SDK session resume, not through the Responses API's encrypted-reasoning envelope: each Codex thread resumes its own Claude SDK session, keyed by the thread id in `x-codex-turn-metadata` (falling back to `prompt_cache_key`), so Claude's earlier thinking stays in the resumed session. The encrypted reasoning items Codex sends back are OpenAI-specific and incompatible with Claude's signed thinking blocks, so Meridian ignores them and returns an empty reasoning item where Codex expects one. Spawned subagent threads and side requests (`compact`, `title`, `summary`, …) get keys of their own, so they never rewrite the conversation's session. Verified on Codex 0.144 with plain, tool-driving, and reasoning-enabled turns. ### OpenAI-compatible tools (Open WebUI, Continue, etc.) Meridian speaks the OpenAI protocol natively — no LiteLLM or translation proxy needed. **`POST /v1/chat/completions`** — accepts OpenAI chat format, returns OpenAI completion format (streaming and non-streaming) - `image_url` parts are supported when provided as **data URLs** (`data:image/...;base64,...`) - `file` parts are supported for PDFs sent inline as a **data URL** in `file_data` (`data:application/pdf;base64,...`); Claude receives them as documents, titled with `filename`. An uploaded `file_id`, another file type, or any other part Meridian cannot deliver (such as `input_audio`) is replaced by a short omission note, so the model knows the input is missing - multimodal tool flows where a tool returns `tool_result.content = [text, image]` are preserved through the structured multimodal path instead of being flattened to text **`GET /v1/models`** — returns available Claude models in OpenAI format Set the OpenAI API base to `http://127.0.0.1:3456/v1` (clients append `/chat/completions` or `/models`). Use your proxy key if authentication is enabled: ```bash # Open WebUI: OpenAI API base = http://127.0.0.1:3456/v1 # Continue: apiBase = http://127.0.0.1:3456/v1, provider = openai # OpenAI SDK: base_url="http://127.0.0.1:3456/v1", api_key="x" ``` > **Note:** A request without a session key has its prior turns packed into the system prompt and runs on a fresh SDK session — the client replays the full history itself. Images and PDFs from earlier turns are packed as `[Image attached]` / `[Document attached]` placeholders, so only the latest message's attachments reach the model. A request keyed by `x-opencode-session`, `x-session-affinity` or `x-session-id` (Jcode: `x-jcode-session`) keeps its real messages and resumes one SDK session per key, under the contract every keyed client has: > > - turns under one key are serialized; a turn that lost the race and no longer holds the committed history is refused with HTTP 400 (`This session advanced while the request was waiting`) — retry it with the latest history; > - the history per key must be append-only: an edited turn forks at the edit as an undo, a rewritten middle replays fresh; > - a retry of an identical body is classified `replayed-request` and replays fresh — a second, billed answer; > - at this endpoint `x-session-affinity` and `x-session-id` are read as conversation identity, not a stickiness hint — send a distinct value per conversation, or omit them. > > `x-session-id` is the header to send from a client that also talks to other providers: OpenRouter uses it as its own session key, and browser clients can send it there because OpenRouter's CORS allowlist names it. When several are present, `x-opencode-session` wins, then `x-session-affinity`, then `x-session-id`. ### Jcode Use `/v1/chat/completions` with a stable `x-jcode-session` header. The dedicated `jcode` adapter preserves append-only history for SDK session reuse. Explicit selection uses `x-meridian-agent: jcode`; automatic detection requires both a `jcode/` User-Agent and a valid session header. Other OpenAI clients follow the rules in the note above: with a recognized session key (or a derived `tool-loop:` key) they also keep their real history, and only unkeyed requests have prior turns packed. ### Letta Code Letta Code reaches Meridian over the OpenAI-compatible `POST /v1/chat/completions` endpoint and sends no session header. Register Meridian as an OpenAI-compatible provider, using any API key value (or the shared key when `MERIDIAN_API_KEY` is set). Its conversation identity is the `conv-` id inside the `` agent-info block that Letta places in one of its own user messages. Letta emits that block once, in the opening user message; it appears on later turns only because the client replays the history. Meridian reads that id and uses it as the session key, which is what turns on history preservation and cache reuse. The fingerprint fallback cannot help here: those reminder blocks are stripped before hashing, leaving only the opening message and the working directory — so two conversations opened with the same words in one project would land on one key. Only a `conv-` value is accepted. The literal `default` is the id Letta assigns every subagent conversation of an agent — an agent's interactive conversations carry `conv-` ids, verified on real traffic — so it is not used as a key: keying all of a parent's subagent conversations to one session would be worse than leaving them unidentified. Requests carrying `default`, and requests with no reminder at all, keep the generic `openai` behaviour. A request body without such a reminder is not a Letta request; it falls through to the `openai` adapter with unchanged behaviour. There is deliberately no User-Agent match, since Letta shares the generic OpenAI SDK User-Agent with other clients. ### Cherry Studio [Cherry Studio](https://github.com/CherryHQ/cherry-studio) is a desktop chat client. Point it at Meridian by setting the Anthropic API base URL to `http://127.0.0.1:3456` (any API key value works). Because Cherry Studio is a chat client rather than a coding agent, select the `cherry` adapter so Claude's **built-in web search** is available (coding-agent adapters block it in favour of their own): ```bash MERIDIAN_DEFAULT_AGENT=cherry meridian ``` The `cherry` adapter runs in internal mode: Claude executes `WebSearch`/`WebFetch` itself and Meridian returns the grounded answer — the internal tool calls are hidden from the client. This resolves the "no WebSearch/WebFetch tool exposed" error (#481). > Cherry Studio doesn't send a Meridian-specific header, so set `MERIDIAN_DEFAULT_AGENT=cherry` on a Meridian dedicated to it, or send `x-meridian-agent: cherry` if your setup allows custom headers. ### ForgeCode Add a custom provider to `~/forge/.forge.toml`: ```toml [[providers]] id = "meridian" url = "http://127.0.0.1:3456/v1/messages" models = "http://127.0.0.1:3456/v1/models" api_key_vars = "MERIDIAN_FORGE_KEY" response_type = "Anthropic" auth_methods = ["api_key"] [session] provider_id = "meridian" model_id = "claude-opus-4-6" ``` Set the API key env var. Any value works unless you've enabled authentication with `MERIDIAN_API_KEY`, in which case use your auth key here: ```bash export MERIDIAN_FORGE_KEY=x ``` Then log in and select the model: ```bash forge provider login meridian # enter any value when prompted forge config set provider meridian --model claude-opus-4-6 ``` Start Meridian with the ForgeCode adapter: ```bash MERIDIAN_DEFAULT_AGENT=forgecode meridian ``` ForgeCode uses reqwest's default User-Agent, so automatic detection isn't possible. The `MERIDIAN_DEFAULT_AGENT` env var tells Meridian to use the ForgeCode adapter for all unrecognized requests. If you run other agents alongside ForgeCode, use the `x-meridian-agent: forgecode` header instead (add `[providers.headers]` to your `.forge.toml`). ### Pi Pi 1.0 and newer use the Meridian extension, which ships with Meridian: ```bash meridian setup --client pi pi --model meridian/claude-sonnet-5-5 ``` On a Claude subscription, also install the [`pi-scrub` server plugin](plugins.md#official-plugins). Pi's default system prompt identifies Pi, and Claude can refuse it as third-party traffic ("Third-party apps now draw from your extra usage, not your plan limits") with or without the extension. On a Max account in October 2026, every Pi 1.4 request was refused without the scrub and answered with it. The extension and the scrub do different jobs: the extension carries Pi's session identity; the scrub removes Pi's fingerprint from the prompt Meridian sends. Setup copies the extension to `~/.pi/agent/extensions/meridian` (or `$PI_CODING_AGENT_DIR/extensions/meridian`) and creates the shared `opencode-turn.key`. Rerun it after upgrading Meridian; startup warns when the installed copy is missing or differs from the one Meridian ships. Restart Pi or run `/reload`, then pick a model under the `meridian` provider with `/model`. If a directory Meridian did not install is already at that path, setup moves it to `~/.pi/agent/meridian-extension-backup-*` and prints where. Always name the provider (`meridian/claude-sonnet-5-5`). Pi 1.3 rejects a bare model ID that more than one authenticated provider offers. The extension registers a `meridian` provider next to Pi's built-in `anthropic` provider, so direct Anthropic models stay available. It: - discovers models from Meridian's `/v1/models` and keeps the catalog in Pi's model store. Pi starts without waiting for Meridian, from the catalog it last discovered at that URL or, failing that, from the list of models the installed extension's Meridian version serves, so `pi --model meridian/…` works straight after setup; - keys every request by Pi's own session ID (`x-session-affinity`), so a resumed Pi session finds its backing conversation and a fork gets its own; - marks compaction, branch summaries and other side calls with `x-meridian-source: fork-side-call`, under their own session key, which keeps them out of the primary conversation. They keep the conversation's model tier: a compaction request carries the history it summarizes, so it needs the same context window; - gives delegated children the base model tier: a child Pi process started with `MERIDIAN_SOURCE=subagent-` in its environment, or with pi-subagents' `PI_SUBAGENT_CHILD=1`, sends that source on every request, and in-process pi-subagents agents are recognized by their `` prompt marker; - signs the latest user message of a root conversation, so [`next-user-turn` priority failback](profiles.md) can move it back to the preferred profile. Saved forks, children, side calls and requests with an explicit `x-meridian-profile` are never signed. Configuration: | Setting | Effect | |---------|--------| | `MERIDIAN_BASE_URL` | Meridian's URL (default `http://127.0.0.1:3456`) | | `MERIDIAN_API_KEY` | Sent as `x-api-key` when Meridian has [API-key protection](configuration.md) on | | `providers.meridian.baseUrl` in `~/.pi/agent/models.json` | Overrides `MERIDIAN_BASE_URL` (Pi 1.3 and newer) | | `MERIDIAN_SOURCE` | `x-meridian-source` for every request of this Pi process | Pi runs in passthrough mode — it executes its own tools and Meridian just forwards the `tool_use` blocks. Opt out with `MERIDIAN_PASSTHROUGH=0`. Known limits: - Pi refreshes the catalog only in interactive and RPC modes. `pi -p` uses the catalog last discovered at your Meridian URL for seven days, and after that as long as it still lists every model the installed extension knows. Otherwise it uses the list that ships with the extension. After upgrading Meridian and rerunning setup, start Pi interactively once, or new models reach `pi -p` only when that week is up. The shipped list shows Opus 4.6 at 200k even when your account has its legacy 1M window, 1M windows even when Meridian runs with `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`, and the models of the Meridian version that ran setup, even if `MERIDIAN_BASE_URL` points at another version. Start Pi interactively once to load your Meridian's own catalog. - A session that started on the shipped list or on an expired catalog keeps the model definition it started with. Select the model again with `/model`, or restart Pi, to pick up the discovered one. - A child that runs on the base tier still sees each model's full context window in the catalog. With Opus and Fable, whose base tier is 200k, a long child conversation can overflow before Pi compacts it. - A user message another extension adds (for example with `pi.sendUserMessage()`) is signed like one you typed. Forks and clones of an unsaved (`--no-session`) session have no parent on record, so they are signed as root conversations. - Pi's `/bug` summary reuses the conversation's session ID. Meridian treats it as a turn of that conversation, and the next real turn replays the history. - The extension always sends `x-meridian-agent: pi`, so it cannot select a custom Pi-based [adapter instance](#adapter-instances). #### Moving from the `models.json` setup Earlier Meridian docs pointed Pi's built-in `anthropic` provider at Meridian. That keeps working after you install the extension, but those requests still go out without the extension's session identity, and the same model IDs then exist under both `anthropic` and `meridian`. To switch: 1. Remove the `anthropic` `baseUrl` override from `~/.pi/agent/models.json`, and any `ANTHROPIC_BASE_URL` you export for Pi, unless you want both routes. 2. Remove any extension of your own that sets `x-session-affinity` or `x-meridian-agent` for the `anthropic` provider; the Meridian extension does this for its own provider. 3. Set `"defaultProvider": "meridian"` together with a `"defaultModel"` such as `"claude-sonnet-5-5"` in `~/.pi/agent/settings.json`, or pick a `meridian/…` model with `/model`. Pi ignores `defaultProvider` without a `defaultModel`. A resumed session keeps the model it was using until you switch it. #### Without the extension Pi releases before 1.0, which cannot load the extension, can point the built-in `anthropic` provider at Meridian in `~/.pi/agent/models.json`: ```json { "providers": { "anthropic": { "baseUrl": "http://127.0.0.1:3456", "apiKey": "x", "headers": { "x-meridian-agent": "pi" } } } } ``` The [`pi-scrub` server plugin](plugins.md#official-plugins) applies to this route too. Pi mimics Claude Code's User-Agent, so the `x-meridian-agent: pi` header (or `MERIDIAN_DEFAULT_AGENT=pi` when Pi is your only agent) selects the Pi adapter. This setup sends no session identity: Meridian falls back to fingerprint matching, side calls share the primary model tier, and priority failback cannot move the conversation. Meridian logs a one-time warning when it sees such a request. For reliable tool-loop continuity, configure [session affinity](configuration.md#client-driven-tool-loops-need-a-session-header). [Oh My Pi](https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent) (`omp`) is built on the same runtime and uses the Pi adapter. Its config lives in `~/.omp/agent/models.yml` and takes the same three keys: ```yaml providers: anthropic: baseUrl: http://127.0.0.1:3456 apiKey: x headers: x-meridian-agent: pi ``` omp runs its main turn, title generation and mid-turn side questions concurrently under one session id. Meridian serializes them and answers a conflicting late request by replaying its own history. It does not reject that request merely because another caller committed while it waited. Normal upstream errors and cancellation still apply. The mapping follows the last completed caller: if that is a side call, the next main turn may also need a fresh replay. Separate session identities avoid this extra replay cost. omp's side calls (idle recap, composer predictions, `/btw`, completion probes) are an exception that Meridian recognizes. They carry the conversation's session id in `metadata.user_id` and their own id, `:side:`, in `X-Claude-Code-Session-Id`. The Pi adapter treats a request with a side id of its own session key as an auxiliary request, and leaves the conversation's mapping alone, so the next main turn still continues the conversation. The key may extend the header's session id after `~`, as an omp extension that rotates accounts does (`~`). omp runs a side call on the conversation's own system prompt and tools, so one that only adds user text after a completed turn resumes the conversation's SDK session as a fork that is never published (`lineage=continuation … auxiliary=fork`). It reads the conversation's prompt cache and writes only its own prompt. A side call over a pending tool call, or carrying a snapshot of a reply still in flight, is answered from a fresh replay (`diverged=independent-request:auxiliary-request`). Fresh side requests use their own tool declarations. Tool definitions omitted on a continuation can be inherited only from that same published SDK branch; a failed side request does not replace its tool cache. ### Prime Agent **Concurrent RLM subagents are not production-safe.** Existing investigations observed overload amplification, cache churn during fresh replay, lost child-task context, and undelivered tool envelopes. Use one active agent for unattended or usage-sensitive work. Distinct child session keys and parent cancellation support do not establish reliable orchestration. The dated evidence below distinguishes real-client tests from protocol replays. [Prime Agent](https://www.npmjs.com/package/prime-agent) is a fork of Pi with a different prompt and tool surface, so it uses its own `prime` adapter rather than Pi's. Its only tool by default is `ipython`, a persistent kernel in the client — passthrough is effectively required, and internal mode (`MERIDIAN_PASSTHROUGH=0`) drops that tool entirely. Connect it with an extension. Save as `.prime/agent/extensions/meridian.ts` in a project, or `~/.prime/agent/extensions/meridian.ts` globally: ```typescript import type { ExtensionAPI } from "@earendil-works/pi-coding-agent" const MERIDIAN_PROVIDER = "meridian" export default function (pi: ExtensionAPI) { pi.registerProvider(MERIDIAN_PROVIDER, { name: "Meridian (Claude Max)", baseUrl: "http://127.0.0.1:3456", apiKey: "MERIDIAN_API_KEY", // env var name, or any literal if auth is off api: "anthropic-messages", headers: { "x-meridian-agent": "prime" }, models: [ { id: "claude-opus-5", name: "Claude Opus 5 (Meridian)", reasoning: true, input: ["text", "image"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 1000000, maxTokens: 64000, }, ], }) // Required, not an optimisation — see below. pi.on("before_provider_request", (event: any, ctx: any) => { if (ctx?.model?.provider !== MERIDIAN_PROVIDER) return undefined const sessionId = ctx?.sessionManager?.getSessionId?.() if (typeof sessionId !== "string" || !sessionId) return undefined const identity: Record = { session_id: sessionId } // Optional, and only present on newer Prime Agent builds. It is what lets // Meridian cancel a whole subagent tree — see "Subagent cancellation". const parentSessionId = ctx?.sessionManager?.getParentSessionId?.() if (typeof parentSessionId === "string" && parentSessionId) { identity.parent_session_id = parentSessionId } return { ...(event.payload as Record), metadata: { user_id: JSON.stringify(identity) }, } }) } ``` Then pick a model with `/model` or `--provider meridian --model claude-opus-5`. **`contextWindow` must say `1000000`.** Provider models registered this way are static — Prime Agent never calls `GET /v1/models` for them — so this literal is the *only* thing driving the TUI footer and auto-compaction (`contextTokens > contextWindow - reserveTokens`). Meridian routes every primary `opus` request to the SDK's `opus[1m]` alias, so a `200000` here compacts the conversation at a fifth of the window you are actually paying for. Restart Prime Agent after editing: providers are registered once per process. Set it back to `200000` if you opt out of extended context on the proxy side — `MERIDIAN_1M_CONTEXT_SUPPORT=0`, `MERIDIAN_OPUS_MODEL=opus`, or a plan that doesn't include Opus 1M (Meridian then falls back to plain `opus` after one Extra-Usage rejection). Leaving `1000000` in that case surfaces as upstream errors on long conversations instead of local compaction. `maxTokens: 64000` advertises a client output budget. Meridian does not enforce `max_tokens` by default; see [output limits](configuration.md#known-limitations). Registering a **new** provider rather than overriding `anthropic` means installing this changes nothing until you select one of its models, so an already-running agent is unaffected. **The `before_provider_request` hook is required.** Prime Agent sends no session identity of its own, and under passthrough every tool round ends in a `tool_result` — which Meridian treats as a self-contained request needing no session resume. Each round then replays the whole conversation into a fresh session, and since that replay strips the assistant's `tool_use` blocks by design, the model loses track of what it has already run. Stamping `metadata.user_id` makes each round a continuation instead, so the SDK keeps the real tool calls in its own session state. `getSessionId()` is distinct per agent, so RLM children get their own keys rather than colliding with the parent. **Subagent cancellation.** RLM children reach Meridian as independent requests on their own session keys, so cancelling the parent used to leave every child running — holding an SDK permit and billing the subscription until its own socket closed. `parent_session_id` closes that: it names the child's *immediate* parent, Meridian keeps a registry of in-flight requests and their parent links, and aborting a parent's request aborts every live request in the subtree below it, evicting each one's session mapping exactly as a direct cancel does. Three limits are deliberate. Only an actual abort propagates — a parent turn that merely finishes leaves its children alone, because a child routinely outlives the turn that spawned it. Only *live* requests are tracked; a session with nothing in flight is not remembered. And a client that omits `parent_session_id` is unaffected, which is the whole gate — there is no config flag. `POST /v1/sessions//cancel` cancels a subtree explicitly if you want to stop one without dropping sockets, and `/telemetry/summary` reports the counts under `sessionTree`. Detection is by the `x-meridian-agent: prime` header above, or `MERIDIAN_DEFAULT_AGENT=prime`. There is deliberately no User-Agent rule: in API-key mode Prime Agent sends the generic `Anthropic/JS ` that every Anthropic SDK client sends, so matching on it would misroute unrelated traffic. **Known limitation — file-change tracking.** Meridian reads file changes out of `ipython` cells for `%%bash` bodies, `!` shell escapes, and `await edit(path=…)` calls. It does **not** parse arbitrary Python writes (`open(p, "w").write(…)`, `Path.write_text`, library calls), which would need real dataflow analysis. Those edits still happen; they just don't appear in Meridian's file-change summary. #### What was verified, and what wasn't Measured on 2026-08-13/14 against Prime Agent 0.7.2: | Verified | How | |---|---| | Adapter selection, live turns | Real `prime-agent` binary through Meridian | | Tool-round session continuity | 45/45 rounds resumed as continuations across 12 sessions | | RLM children get distinct keys | Parent and depth-1 child carried different `metadata.user_id` on the wire | | Works with `codeSystemPrompt` off | 6 multi-round loops per arm; preset on vs off scored identically | | Survives long idle gaps | 7-minute silence, then `lineage=continuation` and the model recalled a codeword set before the gap | | Not metered as a third-party app | Negative control → full 18KB prompt → control again, all passing with the preset off | **Not verified: cron/scheduled tick delivery.** Two attempts, neither conclusive. Against a shared supervisor the scheduler fired (`runs=3`) but no request reached Meridian. Against an isolated supervisor, `schedule add` itself hung and never persisted the job. Session continuity across a worker restart is likewise untested. Four constraints make this awkward to exercise, all learned the hard way: - Only *resident* workers can be scheduled against. `print`, `rpc` and `json` create **client-owned** workers, which Prime Agent deliberately omits from schedules — so every headless mode is structurally ineligible. A resident worker needs an interactive session, which needs a TTY (a pty works). - The `--daemon-socket` flag must come **before** the subcommand: `prime-agent --daemon-socket schedule list`. Placed after, it is rejected as an unknown option, which reads misleadingly like the subcommand cannot target a custom socket. - `PRIME_AGENT_CODING_AGENT_DIR` does **not** isolate a session from a shared supervisor. The supervisor writes sessions into whichever agent directory *it* was started with, so a test run against an already-running daemon lands its sessions in that daemon's store. The supervisor socket is likewise global per UID (`$TMPDIR/prime-agent-/daemon.sock`), so real isolation needs `--daemon-socket` *and* a matching `PRIME_AGENT_CODING_AGENT_DIR`. - A dangling `~/.cache/meridian` makes Meridian return `500 ENOENT … mkdir '~/.cache/meridian'` on affected requests. The client retries and appears to hang, which is easy to misread as the agent stalling. Check that path resolves before diagnosing anything else. A resident worker configured this way *does* reach Meridian — verified — so the remaining gap is specifically the scheduler, not the transport. The long-idle result above covers the part Meridian owns — a turn arriving on a session after a quiet gap resumes rather than replaying. Also not verified: the real client driving its own IPython kernel through a full tool loop. Kernel provisioning stalled in the isolated test environment; the tool-round evidence above comes from replaying Prime Agent's exact prompt and tool schema rather than from its kernel. **The metering result is a dated snapshot, not a property of the prompt.** It means "not flagged on this account at this moment" — the same classifier was observed changing its answer within a single day during the OpenClaw work. If you hit `400 You're out of extra usage` on Prime Agent traffic, re-measure before assuming the prompt is fine. ### Claude Code Claude Code can point at Meridian like any other Anthropic API client. The common use case is sharing a single Claude Max subscription from one host across other machines on your network — run Meridian on the box that is logged into Claude Max, then run Claude Code anywhere else against it. ```bash # On another machine (or the same one) ANTHROPIC_AUTH_TOKEN=x ANTHROPIC_BASE_URL=http://meridian-host:3456 claude ``` > **Note:** Use `ANTHROPIC_AUTH_TOKEN` (or `ANTHROPIC_API_KEY`) — Claude Code > treats both as bearer credentials. Set the value to your `MERIDIAN_API_KEY` > if you've enabled authentication, otherwise any string works. > ⚠️ **Security for multi-machine setups.** If you expose Meridian beyond > loopback (e.g. bind to `0.0.0.0` or a LAN IP), **set `MERIDIAN_API_KEY` to a > strong secret** and require it on clients. An unprotected network-accessible > proxy is a Claude Max credential leak — anyone who can reach the port can > burn your subscription. Claude Code is detected automatically via its `claude-cli/*` User-Agent. Requests flow through the Claude Code adapter which: - Parses the client's real working directory from its `Primary working directory:` system-prompt line so Claude answers path-related questions with your local path, not the proxy host's. - Leaves the SDK subprocess cwd on the proxy host (Claude Code's local paths don't exist there). - Runs in passthrough mode by default — Claude Code executes its own tools on the machine it runs on; Meridian just forwards tool_use blocks. ### Adapter instances Run several configurations of the same adapter side by side — e.g. a passthrough variant with thinking enabled and one without, or a dedicated config for a specific client. Define instances in `~/.config/meridian/adapter-instances.json` (or the `MERIDIAN_ADAPTER_INSTANCES` env var as a JSON string): ```jsonc { "oc-thinky": { "base": "opencode", "features": { "thinking": "enabled" } }, "lite-plain": { "base": "passthrough", "passthrough": true, "match": { "userAgentPrefix": "litellm/" } }, "team-webui": { "base": "opencode", "features": { "codeSystemPrompt": false }, "match": { "header": { "x-team": "alpha" } } } } ``` - **`base`** — which built-in adapter provides the behavior (tool handling, session tracking, transforms). Existing plugins and transforms scoped to the base adapter apply to its instances automatically. - **`features`** — per-instance overrides of the [SDK feature toggles](configuration.md#sdk-feature-toggles-experimental) (thinking, system prompts, memory, ...) layered over the base's settings. Same keys as the settings UI. - **`passthrough`** — per-instance passthrough mode, overriding the adapter default and `MERIDIAN_PASSTHROUGH`. - **`match`** — optional automatic selection: exact header values and/or a User-Agent prefix. Match rules outrank built-in User-Agent detection (that's their purpose). Without `match`, select the instance per request with `x-meridian-agent: `. Built-in adapter names are reserved and can't be shadowed. With no instances configured, detection is exactly the built-in chain. Config file changes apply within ~5s, no restart needed. ### Claude Design MCP Meridian proxies the Claude Design MCP API (`api.anthropic.com/v1/design/*`), so MCP clients can use Claude Design tools through your local endpoint. **1. Add the MCP server.** For Claude Code: ```bash claude mcp add -s user --transport http claude-design http://127.0.0.1:3456/v1/design/mcp ``` Any other MCP client: point it at `http://127.0.0.1:3456/v1/design/mcp` (streamable HTTP). **2. Grant Claude Design consent (one time, per Anthropic account).** Tool calls return a `needs_consent` error until you enable it: open [claude.ai/design/settings](https://claude.ai/design/settings), find **"Claude product access"** ("Let other Claude products, like Claude Code, read and edit your Design projects"), and switch it **On**. This is a setting on the Anthropic account itself — with multiple Meridian profiles, the account behind the *profile handling the request* is the one that needs the toggle. That's it — your existing Claude Max login covers auth (`initialize`, `tools/list`, and tool calls are all verified working with a plain Max token). Verify with a quick handshake: ```bash curl -s -X POST http://127.0.0.1:3456/v1/design/mcp -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}' ``` **Multiple profiles:** design requests use the active profile by default. To pin design traffic to a specific profile regardless of which is active, register the server with a profile header: ```bash claude mcp add -s user --transport http --header "x-meridian-profile: personal" \ claude-design http://127.0.0.1:3456/v1/design/mcp ``` **Fallback OAuth flow:** if the upstream ever rejects your token with an `auth_error` (scope enforcement has varied over time), `/design-login` obtains a dedicated token with the `user:design:read`/`user:design:write` scopes: ```bash curl http://127.0.0.1:3456/design-login # returns an authorize URL — open it in your browser curl -X POST http://127.0.0.1:3456/design-login \ -H 'content-type: application/json' \ -d '{"code": ""}' # paste the code you were shown ``` The design token is stored at `~/.config/meridian/design-token.json` (mode `0600`, global across profiles) and refreshed automatically when it expires. > Contributed by [@sittitep](https://github.com/sittitep) (#543). ### Polytoken [Polytoken](https://polytoken.dev/) talks native Anthropic Messages and executes its own tools, so Meridian always runs it in passthrough mode. tool_use blocks come back to Polytoken, which executes them client-side and posts `tool_result` continuations. ```yaml # Polytoken provider config (config.yaml) providers: meridian: kind: type: catalog name: anthropic url: http://127.0.0.1:3456 auth: type: static_key key: headers: x-meridian-profile: work # optional profile pin ``` Polytoken selection signals (full precedence follows below): 1. A nonblank `X-Polytoken-Conversation` or `X-Polytoken-Session` header selects Polytoken. The trimmed conversation header is the identity used for resume, turn coordination, and routing; the session header is a legacy fallback when the conversation header is absent or blank. Modern Polytoken sessions can contain several independent subagent conversations, so the session correlation ID must not override their conversation IDs. Polytoken 0.8.21 gives sibling subagents distinct conversation IDs, but observed title-inference requests still share the main conversation ID. The adapter isolates the native title-only contract (the sole `_infer_title` tool plus its system instruction) under a separate deterministic key. Ordinary same-conversation conflict checks stay strict. 2. A `Polytoken ` or `Polytoken/` User-Agent (token-boundary match; `PolytokenImpostor` does not match). UA-only selection never manufactures identity: without a valid native header there is no session key, so tool-result continuations run independent and are never resumed (plain text turns still fall back to the generic first-message fingerprint, as for any other headerless client). 3. `x-meridian-agent: polytoken` / `MERIDIAN_DEFAULT_AGENT=polytoken` for explicit selection. An explicit `x-meridian-agent` override (built-in adapter or instance name) beats everything above it: it is checked before the native header. The full order is explicit selection → native header → automatic instance match rules → the User-Agent chain. Unrelated OpenCode headers (`x-opencode-*`, `x-session-affinity`) have no effect on Polytoken traffic. Contract notes: - **The session header is identity, not authentication.** Same trust model as every other adapter's headers — protect the proxy with `MERIDIAN_API_KEY` if it is network-exposed. - **Client-owned tools are mandatory.** Passthrough cannot be disabled for this protocol: an instance `passthrough: false` or a global `MERIDIAN_PASSTHROUGH=0` is ineffective for `polytoken` (all other adapters keep their normal precedence). Tool names, descriptions, schemas, and `Task`/`task` `subagent_type` values are preserved: no alias rewriting, no SDK subagent routing. The proxy still repairs common input slips (camelCase keys, string-typed numbers) the same way it does for every adapter, before the call reaches the client. - **Native prompt defaults.** No Claude Code preset is layered on (`codeSystemPrompt: false`); the client's system prompt is the prompt. Memory/dreaming/CLAUDE.md injection stay off. Explicit overrides via `/settings` or an instance's `features` still apply. - **Thinking.** Thinking blocks from the model are preserved through streaming and non-streaming responses, signatures included (redacted thinking rides the same path; automated coverage exercises the signed form on the non-streaming route). The thinking-generation and `thinkingPassthrough` settings keep their existing semantics. - **Profile scoping.** With non-default profiles, the native key is scoped per profile (`:`) for resume state, exactly like other keyed adapters. Blank/missing keys never resume (by design — no invented fallback identity). ### Any Anthropic-compatible tool ```bash export ANTHROPIC_API_KEY=x export ANTHROPIC_BASE_URL=http://127.0.0.1:3456 ``` ### Hermes Agent [Hermes](https://hermes-agent.nousresearch.com) profiles route through Meridian via their model config — no adapter-specific setup on the Meridian side: ```yaml # $HERMES_HOME/config.yaml model: provider: anthropic base_url: http://127.0.0.1:3456 ``` Use `ANTHROPIC_API_KEY=x` when proxy authentication is disabled, or the configured `MERIDIAN_API_KEY` value when enabled. Meridian handles upstream authentication. Note that Hermes profiles have isolated `HERMES_HOME` directories: repeat the config for each profile. **Strongly recommended:** install the [`meridian-affinity` Hermes plugin](../examples/hermes-plugin/) — without it, every agentic turn ending in a `tool_result` is treated as an independent session and prompt-cache reuse is lost (each turn re-bills cache creation for the whole history). With it, sessions are resumed and historical long runs showed high cache reuse; the rate is workload-dependent. The plugin also wires `x-request-id`, `x-meridian-source` and `x-opencode-effort` for per-task cost control and telemetry correlation. **Which adapter Hermes lands on.** Hermes sends `User-Agent: python-httpx`, which matches no detection heuristic, so plain Hermes traffic falls through to whatever `MERIDIAN_DEFAULT_AGENT` names — `opencode` only when that variable is unset. Installing `meridian-affinity` changes this: the `x-session-affinity` header it injects resolves to the **`opencode`** adapter unless a stronger explicit adapter selection is present. That is usually what you want — the plugin's headers are the ones the OpenCode adapter reads — but it is a real switch, not a no-op. If you run `MERIDIAN_DEFAULT_AGENT=pi` (or anything else) and rely on that adapter's transforms for Hermes, set the adapter explicitly per request rather than letting the header decide. ## Compatibility at a glance | Agent | Status | Notes | |-------|--------|-------| | [OpenCode](https://github.com/anomalyco/opencode) | ✅ Verified | V1, three pinned V2 betas, and released 2.0.16/2.0.21/2.0.31; Desktop 2.2.0 qualified on Darwin arm64 with Opus 5.5. Use the matching `meridian setup` mode ([setup](#opencode)); the [V2 host policy](#host-support-policy) lists coverage and limits. | | [ForgeCode](https://forgecode.dev) | ✅ Verified | Provider config (see [Agent Setup](#agent-setup)) — passthrough tool execution, session resume, streaming | | [Droid (Factory AI)](https://factory.ai/product/ide) | ✅ Verified | BYOK config (see [Agent Setup](#agent-setup)) — full tool support, session resume, streaming | | [Crush](https://github.com/charmbracelet/crush) | ✅ Verified | Provider config (see [Agent Setup](#agent-setup)) — full tool support, session resume, headless `crush run` | | [Cline](https://github.com/cline/cline) | ✅ Verified | Config (see [Agent Setup](#agent-setup)) — full tool support, file read/write/edit, bash, session resume | | [Aider](https://github.com/paul-gauthier/aider) | ✅ Verified | Env vars — file editing, streaming; `--no-stream` broken (litellm bug) | | [Open WebUI](https://github.com/open-webui/open-webui) | ✅ Verified | OpenAI-compatible endpoints — set base URL to `http://127.0.0.1:3456` | | [Pi](https://github.com/earendil-works/pi) | ✅ Verified | `meridian setup --client pi` extension on Pi 1.0+ (see [Pi](#pi)); models.json config for older releases; on a Claude subscription, load the `pi-scrub` server plugin (see [Pi](#pi)) — full tool support via passthrough, per-session identity, subagent tiering and `next-user-turn` failback | | [Prime Agent](https://www.npmjs.com/package/prime-agent) | ⚠️ Single-agent verified | Extension config (see [Agent Setup](#agent-setup)) — reliable with one active agent. Concurrent RLM subagents receive distinct session keys, but are not yet production-safe; see [Prime Agent subagents](#prime-agent-subagents). The extension's `metadata.user_id` stamp is **required**, not optional. | | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | ✅ Verified | `ANTHROPIC_BASE_URL` — remote clients share a Max subscription over the network; client CWD preserved in system prompt | | [Cherry Studio](https://github.com/CherryHQ/cherry-studio) | ✅ Verified | `cherry` adapter (see [Agent Setup](#agent-setup)) — chat client with Claude's built-in web search via internal mode | | [Polytoken](https://polytoken.dev/) | ✅ Verified | Provider config (see [Agent Setup](#Polytoken)) — `X-Polytoken-Session` identity, mandatory client-owned tools (passthrough cannot be disabled), signed-thinking passthrough | | Jcode | ✅ Verified | `/v1/chat/completions` + `x-jcode-session` header — dedicated `jcode` adapter keeps append-only history intact, so retained sessions resume on one SDK session (90.9% cache hit on turn 2 of a two-turn Opus session) | | Letta Code | ✅ Verified | `/v1/chat/completions` (see [Agent Setup](#letta-code)) — adapter reads the `conv-` id from Letta's own agent-info reminder as the session key, so history is preserved and the prompt cache reused across turns (on turn 2 of a two-turn Sonnet session, 15,300 of 15,365 prompt tokens were read from cache and only 63 written, against zero cache reuse for the control, the same request shape with no reminder and its own prefix) | | [Codex CLI](https://github.com/openai/codex) | ✅ Verified | `/v1/responses` (see [Agent Setup](#agent-setup)) — Responses-API provider, passthrough tool execution; verified on 0.144 (plain + tool-driving turns) | | [Continue](https://github.com/continuedev/continue) | 🔲 Untested | OpenAI-compatible endpoints should work — set `apiBase` to `http://127.0.0.1:3456` | ### Prime Agent subagents Prime Agent is reliable through Meridian with one active agent. RLM children have separate session identities and can execute successfully, but concurrent subagent orchestration is not yet production-safe. Observed failure modes include overload amplification, expensive cache churn after fresh-session replay, loss of child-task context during recovery, and undelivered tool envelopes. Use a single active Prime Agent for unattended or usage-sensitive work until coordinated fixes land in Prime Agent and Meridian. Parent-to-child cancellation is handled on the Meridian side: when the extension stamps `parent_session_id` alongside the child's session id, aborting a parent's in-flight request aborts every live request in the subtree below it and evicts each one's session mapping. See [Subagent cancellation](#prime-agent). Prime Agent can keep Opus on the root session while selecting Sol for an individual child. A child inherits its parent's model unless the `rlm` call supplies an exact `provider/model` selector returned by `rlm.find_models()`: ```python sol_models = await rlm.find_models("sol") print(sol_models) # choose an available exact selector for your authenticated providers child = await rlm( "Review this change and report your findings to the parent.", name="sol-reviewer", model="openai-codex/gpt-5.6-sol", ) ``` The selector above requires an authenticated OpenAI Codex provider in Prime Agent; Prime Inference may expose a different Sol selector. Explicit child model selection reduces Claude Max pressure, but does not by itself fix the orchestration and cancellation limitations above. Tested an agent or built a plugin? [Open an issue](https://github.com/rynfar/meridian/issues) and we'll add it.