Skip to content

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.

Before using Claude MAX in the Cosine CLI you need:

  1. A Claude MAX subscription from Anthropic
  2. 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
  3. The claude binary available on your PATH (or configured via CLAUDE_CODE_CLI_PATH — see Configuration below)

Verify your Claude Code installation:

Terminal window
claude --version
claude "Hello, are you there?"

If those commands succeed, you are ready to use Claude MAX in the Cosine CLI.

Claude MAX is available as a separate provider in the model picker. Two models are offered:

ModelSelection ID
Claude Sonnetclaudemax:claude-sonnet-4-6
Claude Opusclaudemax: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:

Terminal window
cos start --model claudemax:claude-sonnet-4-6

The model selection is persisted across sessions, so you only need to change it once.

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.

If you have Claude Code installed in a non-standard location, set CLAUDE_CODE_CLI_PATH to the full path of the binary:

Terminal window
export CLAUDE_CODE_CLI_PATH="/opt/homebrew/bin/claude"
cos start

You can also set this permanently in your shell profile (~/.zshrc, ~/.bashrc, etc.).

┌──────────────────────────┐
│ 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:

  1. Builds a system prompt from the same instructions used for Cosine-managed models, forwarded via the SDK’s SystemPrompt field
  2. Spawns the local claude binary using github.com/PandelisZ/claude-agent-sdk-go, a Go port of Anthropic’s official Claude Agent SDK
  3. Communicates over stdin/stdout — the SDK drives the Claude Code process via a JSON streaming protocol, not a direct API call
  4. 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 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

Claude MAX in the Cosine CLI is not a drop-in replacement for Cosine-managed Claude models. There are meaningful differences:

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:

ToolAvailable with Claude MAX
read_fileYes
directory_treeYes
filename_searchYes
grepYes
read_tool_resultYes
edit / apply_patchNo
start_terminalNo
browserNo
All other write/action toolsNo

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.

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.

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.

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_PATH to the full path of your claude binary

”authentication failed” / unauthenticated error

Section titled “”authentication failed” / unauthenticated error”

Your local Claude Code session has expired. Run:

Terminal window
claude login

Then 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.