Meridian
Use your Claude Max subscription with OpenCode. Proxy that bridges Anthropic's official SDK to enable Claude Max in third-party tools.
Install / Use
/learn @rynfar/MeridianQuality Score
Category
Development & EngineeringSupported Platforms
README
Meridian turns your Claude Max subscription into a local Anthropic API. Any tool that speaks the Anthropic protocol — OpenCode, Crush, Cline, Continue, Aider — connects to Meridian and gets Claude, powered by your existing subscription through the official Claude Code SDK.
Harness Claude, your way.
[!NOTE] Renamed from
opencode-claude-max-proxy. If you're upgrading, seeMIGRATION.mdfor the checklist. Your existing sessions, env vars, and agent configs all continue to work.
Quick Start
# Install
npm install -g @rynfar/meridian
# Authenticate (one time)
claude login
# Start
meridian
Meridian starts on http://127.0.0.1:3456. Point any Anthropic-compatible tool at it:
ANTHROPIC_API_KEY=x ANTHROPIC_BASE_URL=http://127.0.0.1:3456 opencode
The API key value doesn't matter — Meridian authenticates through your Claude Max session, not API keys.
Why Meridian?
You're paying for Claude Max. It includes programmatic access through the Claude Code SDK. But your favorite coding tools expect an Anthropic API endpoint and an API key.
Meridian bridges that gap. It runs locally, accepts standard Anthropic API requests, and routes them through the SDK using your Max subscription. Claude does the work — Meridian just lets you pick the tool.
<p align="center"> <img src="assets/how-it-works.svg" alt="How Meridian works" width="920"/> </p>Features
- Standard Anthropic API — drop-in compatible with any tool that supports custom
base_url - Session management — conversations persist across requests, survive compaction and undo, resume after proxy restarts
- Streaming — full SSE streaming with MCP tool filtering
- Concurrent sessions — run parent + subagent requests in parallel
- Passthrough mode — forward tool calls to the client instead of executing internally
- Multimodal — images, documents, and file attachments pass through to Claude
- Telemetry dashboard — real-time performance metrics at
/telemetry - Cross-proxy resume — sessions persist to disk and survive restarts
- Agent adapter pattern — extensible architecture for supporting new agent protocols
Agent Setup
OpenCode
ANTHROPIC_API_KEY=x ANTHROPIC_BASE_URL=http://127.0.0.1:3456 opencode
For automatic session tracking, use a plugin like opencode-with-claude, or see the reference plugin to build your own.
Crush
Add a provider to ~/.config/crush/crush.json:
{
"providers": {
"meridian": {
"id": "meridian",
"name": "Meridian",
"type": "anthropic",
"base_url": "http://127.0.0.1:3456",
"api_key": "dummy",
"models": [
{ "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6 (1M)", "context_window": 1000000, "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-4-5-20251001", "name": "Claude Haiku 4.5", "context_window": 200000, "default_max_tokens": 16384, "can_reason": true, "supports_attachments": true }
]
}
}
}
Then use Meridian models in Crush:
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 extra configuration needed. In crush run headless mode all tool operations (read, write, bash) execute automatically without prompting.
Droid (Factory AI)
Droid connects via its BYOK (Bring Your Own Key) feature. This is a one-time setup.
1. Add Meridian as a custom model provider in ~/.factory/settings.json:
{
"customModels": [
{
"model": "claude-sonnet-4-6",
"name": "Sonnet 4.6 (1M — Meridian)",
"provider": "anthropic",
"baseUrl": "http://127.0.0.1:3456",
"apiKey": "x"
},
{
"model": "claude-opus-4-6",
"name": "Opus 4.6 (1M — Meridian)",
"provider": "anthropic",
"baseUrl": "http://127.0.0.1:3456",
"apiKey": "x"
},
{
"model": "claude-haiku-4-5-20251001",
"name": "Haiku 4.5 (Meridian)",
"provider": "anthropic",
"baseUrl": "http://127.0.0.1:3456",
"apiKey": "x"
}
]
}
The apiKey value doesn't matter — Meridian authenticates through your Claude Max session.
2. In the Droid TUI, open the model selector (/model) and choose any custom:claude-* model.
How models map to Claude Max tiers:
| Model name in config | Claude Max tier |
|---|---|
| claude-sonnet-4-6 | sonnet[1m] — Sonnet 4.6 with 1M context |
| claude-opus-4-6 | opus[1m] — Opus 4.6 with 1M context |
| claude-haiku-4-5-20251001 | haiku — Haiku 4.5 |
| claude-sonnet-4-5-* | sonnet — Sonnet 4.5, no extended context |
Note: Droid automatically uses Meridian's internal tool execution mode regardless of the global
CLAUDE_PROXY_PASSTHROUGHsetting. No extra configuration needed.
Cline
Cline CLI connects by setting anthropicBaseUrl in its config. This is a one-time setup.
1. Authenticate Cline with the Anthropic provider:
cline auth --provider anthropic --apikey "dummy" --modelid "claude-sonnet-4-6"
2. Add the proxy base URL to ~/.cline/data/globalState.json:
{
"anthropicBaseUrl": "http://127.0.0.1:3456",
"actModeApiProvider": "anthropic",
"actModeApiModelId": "claude-sonnet-4-6"
}
3. Run Cline:
cline --yolo "refactor the login function" # interactive
cline --yolo --model claude-opus-4-6 "review this codebase" # opus
cline --yolo --model claude-haiku-4-5-20251001 "quick question" # haiku (fastest)
No adapter or plugin needed — Cline uses the standard Anthropic SDK and falls through to the default adapter. All models (Sonnet 4.6, Opus 4.6, Haiku 4.5) route to their correct Claude Max tiers automatically.
Aider
Aider works out of the box — no plugin or config file needed:
ANTHROPIC_API_KEY=x ANTHROPIC_BASE_URL=http://127.0.0.1:3456 \
aider --model anthropic/claude-sonnet-4-5-20250929
All standard aider features work: file editing, repo-map, git integration, multi-file changes.
Note: Aider's
--no-streamflag is incompatible due to a litellm parsing issue — use the default streaming mode (no flag needed).
Any Anthropic-compatible tool
export ANTHROPIC_API_KEY=x
export ANTHROPIC_BASE_URL=http://127.0.0.1:3456
# Then start your tool normally
Tested Agents
| Agent | Status | Plugin | Notes |
|-------|--------|--------|-------|
| OpenCode | ✅ Verified | opencode-with-claude | Full tool support, session resume, streaming, subagents |
| Droid (Factory AI) | ✅ Verified | BYOK config (see setup above) | Full tool support, session resume, streaming; one-time BYOK setup |
| Crush | ✅ Verified | Provider config (see setup above) | Full tool support, session resume, streaming, headless crush run |
| Cline | ✅ Verified | Config (see setup above) | Full tool support, file read/write/edit, bash, session resume, all models |
| Continue | 🔲 Untested | — | Should work — standard Anthropic API |
| Aider | ✅ Verified | Env vars (see setup above) | File editing, streaming; --no-stream broken (litellm bug) |
Tested an agent or built a plugin? Open an issue and we'll add it.
Architecture
Meridian is built as a modular proxy with clean separation of concerns:
src/proxy/
├── server.ts ← HTTP orchestration (routes, SSE streaming, concurrency)
├── adapter.ts ← AgentAdapter interface (extensibility point)
├── adapters/
│ ├── detect.ts ← Agent detection from request headers
│ ├── opencode.ts ← OpenCode adapter
│ ├── crush.ts ← Crush (Charm) adapter
│ └── droid.ts ← Droid (Factory AI) adapter
├── query.ts ← SDK query options builder
├── errors.ts ← Error classification
├── models.ts ← Model mapping (sonnet/opus/haiku)
├── tools.ts ← Tool blocking lists
├── messages.ts ← Content normalization
├── session/
│ ├── lineage.ts ← Per-message hashing, mutation classification (pure)
│ ├── fingerprint.ts ← Conversation fingerprinting
│ └── cache.ts ← LRU session caches
├── sessionStore.ts ← Cross-proxy file-based session persistence
├── agentDefs.ts ← Subagent definition extraction
└── passthroughTools.ts ← Tool forwarding mode
Session Management
Sessions map agent conversations to Claude SDK sessions. Meridian classifies every incoming request:
| Classification | What Happened | Actio
