Anthropic Agents SDK (Claude Subscription)
Provider value: anthropic-agents-sdk
Use your Claude Pro or Max subscription to run ra agents instead of paying per-token API costs. This wraps the Anthropic Agent SDK as a model interface — ra owns all context engineering, tool execution, and the agent loop.
When to use this vs the anthropic provider
Use anthropic if you have an API key and want per-token billing. Use anthropic-agents-sdk if you want to use your Claude subscription instead.
Setup
Step 1: Install the Claude CLI
The provider requires the Claude CLI installed and authenticated:
# Install
npm install -g @anthropic-ai/claude-code
# Authenticate (opens browser)
claude loginStep 2: Run
ra --provider anthropic-agents-sdk "Hello"No API key or environment variables needed — the provider uses your Claude CLI subscription.
Environment variables
None required. Authentication is handled by the Claude CLI.
Models
Available models depend on your Claude subscription tier:
| Model | Notes |
|---|---|
claude-sonnet-4-6 | Default. Fast and capable |
claude-opus-4-6 | Most capable |
ra --provider anthropic-agents-sdk --model claude-opus-4-6 "Design a system"Extended thinking
Supports extended thinking via the --thinking flag:
ra --provider anthropic-agents-sdk --thinking high "Design a distributed cache"Config file
agent:
provider: anthropic-agents-sdk
model: claude-sonnet-4-6How it works
- Each
stream()call spawns a fresh Claude CLI subprocess via the SDK'squery()function - ra's conversation history is serialized as XML-tagged text (
<user>,<assistant>,<tool_result>) - Tools are registered as MCP schemas with no-op handlers — the model sees them but ra executes them
maxTurns=1ensures the SDK does exactly one model call per turn, then returns control to ra- All SDK context features (memory, dreams, git instructions, session persistence) are disabled — ra owns context
Limitations
- Requires the Claude CLI installed and on PATH
- Subscription rate limits apply
- Slightly higher latency per turn due to subprocess spawning
See also
- Anthropic provider — for API key-based access
- Providers overview — switching between providers
- Configuration — provider credentials reference