Claude MAX
If you have an Anthropic Claude MAX subscription you can use it inside the Cosine CLI. Rather than routing requests through Cosine’s managed inference, the CLI delegates to the Claude Code CLI binary that is already installed on your machine, consuming your MAX plan’s usage directly.
Prerequisites
Section titled “Prerequisites”Before using Claude MAX in the Cosine CLI you need:
- A Claude MAX subscription from Anthropic
- The Claude Code CLI installed and authenticated on your machine
- Install it from claude.ai/code or via
npm install -g @anthropic-ai/claude-code - Log in with
claude login
- Install it from claude.ai/code or via
- The
claudebinary available on yourPATH(or configured viaCLAUDE_CODE_CLI_PATH— see Configuration below)
Verify your Claude Code installation:
claude --versionclaude "Hello, are you there?"If those commands succeed, you are ready to use Claude MAX in the Cosine CLI.
Selecting a Claude MAX model
Section titled “Selecting a Claude MAX model”Claude MAX is available as a separate provider in the model picker. Two models are offered:
| Model | Selection ID |
|---|---|
| Claude Sonnet | claudemax:claude-sonnet-4-6 |
| Claude Opus | claudemax:claude-opus-4-6 |
To use one, open the model picker inside the CLI (press M or open Settings), switch to the Claude MAX provider section, and select either Sonnet or Opus.
You can also start a session directly:
cos start --model claudemax:claude-sonnet-4-6The model selection is persisted across sessions, so you only need to change it once.
Configuration
Section titled “Configuration”Default behaviour
Section titled “Default behaviour”By default, the CLI resolves the Claude Code binary by looking for claude on your PATH. No additional configuration is needed if that is the case.
Custom binary path
Section titled “Custom binary path”If you have Claude Code installed in a non-standard location, set CLAUDE_CODE_CLI_PATH to the full path of the binary:
export CLAUDE_CODE_CLI_PATH="/opt/homebrew/bin/claude"cos startYou can also set this permanently in your shell profile (~/.zshrc, ~/.bashrc, etc.).
How it works
Section titled “How it works”┌──────────────────────────┐│ Cosine CLI (cos) ││ ││ ┌──────────────┐ ││ │ Agent Session │ ││ │ │ ││ │ System prompt forwarded ───┼───┐│ │ Conversation snapshot │ ││ └──────────┬────────┘ ││ │ ││ ┌──────────▼──────────────────┐ ││ │ claude-agent-sdk-go │ ││ │ (PandelisZ/claude-agent │ ││ │ -sdk-go) │ ││ └──────────┬──────────────────┘ ││ │ stdin/stdout IPC │└─────────────┼────────────────────┘ │┌─────────────▼───────────────┐│ claude (Claude Code CLI) ││ running locally on your ││ machine, billed to your ││ MAX subscription │└─────────────────┘When you run a Claude MAX session, the Cosine CLI:
- Builds a system prompt from the same instructions used for Cosine-managed models, forwarded via the SDK’s
SystemPromptfield - Spawns the local
claudebinary usinggithub.com/PandelisZ/claude-agent-sdk-go, a Go port of Anthropic’s official Claude Agent SDK - Communicates over stdin/stdout — the SDK drives the Claude Code process via a JSON streaming protocol, not a direct API call
- Streams responses back to the Cosine CLI’s normal chat interface
All inference goes directly from the claude binary to Anthropic’s servers using your locally authenticated MAX subscription. No inference traffic passes through Cosine’s servers.
The claude-agent-sdk-go library
Section titled “The claude-agent-sdk-go library”The integration is built on github.com/PandelisZ/claude-agent-sdk-go, a Go port of Anthropic’s Claude Agent SDK.
The SDK’s job is straightforward: it launches the local claude binary as a subprocess, sends requests over its stdin using a streaming JSON protocol, and forwards response events back to the caller. It does not make HTTP calls to the Anthropic API directly — it relies entirely on the claude binary already being installed and authenticated on your machine.
This means:
- Your MAX subscription’s authentication is handled by Claude Code, not by Cosine
- The CLI binary version on your machine determines what features and models are available
- If Anthropic changes the Claude Code CLI’s internal protocol, this integration may break until updated
Differences from Cosine-managed models
Section titled “Differences from Cosine-managed models”Claude MAX in the Cosine CLI is not a drop-in replacement for Cosine-managed Claude models. There are meaningful differences:
Tools are exposed over MCP, not natively
Section titled “Tools are exposed over MCP, not natively”With Cosine-managed models, the agent’s tools (file reading, code editing, terminal access, etc.) are called directly inside the process. With Claude MAX, only a limited read-only subset of tools is exposed to the Claude Code subprocess via an in-process MCP (Model Context Protocol) server:
| Tool | Available with Claude MAX |
|---|---|
read_file | Yes |
directory_tree | Yes |
filename_search | Yes |
grep | Yes |
read_tool_result | Yes |
edit / apply_patch | No |
start_terminal | No |
browser | No |
| All other write/action tools | No |
Because tools go through MCP rather than native calls, they add a round-trip and may behave differently than you expect. Claude MAX can read your codebase but cannot make edits, run commands, or use browser automation through this path.
No write operations
Section titled “No write operations”Claude MAX sessions are read-only from the tool perspective. The model can analyse your code and answer questions about it, but any edits must be done by the user. If you need the full agentic experience — including file edits, terminal commands, and multi-step task execution — use a Cosine-managed model.
System prompt forwarding, not full context parity
Section titled “System prompt forwarding, not full context parity”The Cosine system prompt is forwarded to Claude Code via the SDK’s SystemPrompt field. The model receives the same instructions as Cosine-managed Claude models, but because tool availability differs, the model’s behaviour will not be identical.
No conversation-level memory or session reuse
Section titled “No conversation-level memory or session reuse”Each Claude MAX session starts fresh. Previous-response reuse is disabled for Claude MAX, so the model does not carry state between sessions the way Cosine-managed models can within a running session.
Why use it?
Section titled “Why use it?”Claude MAX makes sense if:
- You already pay for a Claude MAX subscription and want to use that quota in the Cosine CLI for read-only code analysis
- You want to experiment with Claude Opus on tasks where its reasoning depth outweighs the tool limitations
- You prefer keeping inference off Cosine’s servers for a particular session
For the best overall experience — full agentic capabilities, reliable tooling, and ongoing improvements — Cosine-managed models are recommended.
Troubleshooting
Section titled “Troubleshooting””claude: command not found”
Section titled “”claude: command not found””The CLI could not find the Claude Code binary. Either:
- Install Claude Code:
npm install -g @anthropic-ai/claude-code - Or set
CLAUDE_CODE_CLI_PATHto the full path of yourclaudebinary
”authentication failed” / unauthenticated error
Section titled “”authentication failed” / unauthenticated error”Your local Claude Code session has expired. Run:
claude loginThen retry your Cosine session.
The model is not responding or producing errors
Section titled “The model is not responding or producing errors”Claude MAX depends on the Claude Code CLI version installed locally and the stability of its internal protocol. If Claude Code was recently updated, the integration may be temporarily broken. Check for updates to the Cosine CLI and report issues at cosine.sh/support.
Responses feel different from the same model in Cosine
Section titled “Responses feel different from the same model in Cosine”This is expected. The limited tool surface and MCP-based tool routing mean the model behaves differently than when run with native Cosine tooling. This is an inherent limitation of the current approach.