@stratusagent/provider-claude-code
v0.12.0
Published
Claude subscription runtime for Stratus Agent: runs turns through the Claude Agent SDK so Pro/Max plans cover usage
Maintainers
Readme
@stratusagent/provider-claude-code
The Claude subscription runtime for Stratus Agent: turns run through the Claude Agent SDK (Claude Code as a library), so a Claude Pro/Max plan covers usage instead of per-token API billing.
import { createClaudeCodeProvider } from '@stratusagent/provider-claude-code';
const provider = createClaudeCodeProvider({
authToken: process.env.CLAUDE_CODE_OAUTH_TOKEN, // from `claude setup-token`
model: 'claude-opus-5-5', // default
});- The agent's persona and long-term memory are rendered as the system prompt, and multi-turn sessions are replayed as a transcript — a Stratus agent is the same person on this runtime as on the API-key provider.
- Images on the newest message (a screenshot sent in Slack) reach the model as images: a run whose message carries one is sent through the SDK's message-stream input with the images as
imageblocks beside the text, and a run without one keeps the plain prompt string. Older images in a replayed transcript are named, not re-sent. An image the API refuses to process is emptied on the session and the turn replays into a fresh SDK session with a note in its place — fresh, because the SDK already recorded the refused message in the one it was resuming. - Kernel tools run here too. Pass
executeTool(the CLI wiresAgentRunner.executeHostedToolCallautomatically) and the request's tools are bridged into the Claude Code loop as an in-process MCP server: Claude calls them mid-turn, your host executes them — approval policy, agent allowlists, andtool.called/tool.completedevents included — and the result feeds back into the same turn.memory.rememberworks on a subscription exactly like it does on an API key. - The subprocess environment pins billing to the subscription in both auth modes (any ambient
ANTHROPIC_API_KEYis cleared). WithauthTokenset the setup token is used; omit it to use the machine's existingclaudesign-in. - Claude Code's built-in tools stay disabled — Stratus owns the tool surface.
Most users won't wire this directly — @stratusagent/cli routes subscription sign-ins here automatically: stratus setup → Providers → Claude → Claude subscription.
