// With the Claude Code SDK directly
import { query, type SDKMessage } from '@anthropic-ai/claude-code';
import { spawn } from 'child_process';
import { mkdtempSync, rmSync } from 'fs';
import { tmpdir } from 'os';
import { join } from 'path';
// You own: ephemeral sandbox, git clone, branch policy, commit + push,
// streaming protocol, retry on 429, multi-provider routing, abort
// handling, cost accounting, MCP server config, working-dir lifecycle.
const dir = mkdtempSync(join(tmpdir(), 'task-'));
spawn('git', ['clone', repoUrl, dir]).on('exit', () => { /* … */ });
for await (const m of query({ prompt, options: { cwd: dir /* + everything else */ } })) {
// 30+ lines just to render tool calls, accumulate text deltas,
// commit changes, push the branch, surface auth errors…
}// With OrchestraCode
const stream = await fetch('https://api.orchestracode.dev/v1/tasks', {
method: 'POST',
headers: {
'authorization': `Bearer ${ORCH_KEY}`,
'x-github-token': GH_TOKEN,
'x-model-key': ANTHROPIC_KEY,
},
body: JSON.stringify({ repo, branch, task, model: 'claude-sonnet-4-6' }),
});
// → stream of typed events: status / assistant / tool_use / tool_result / git / resultA fresh, per-task working directory with node, npm, git, jq, ripgrep. Booted before the agent's first tool call.
Clone-with-token, feature-branch policy, atomic commit-then-push, retry on transient auth, friendly error if the token rotated.
429 with Retry-After, 5xx with exponential backoff, timeout and network drop retries. All wrapped around the SDK call.
A typed event stream (status / assistant / tool_use / tool_result / git / result) that survives client disconnects.
Same payload routes Sonnet, GPT, GLM, DeepSeek, Qwen. Switch by changing `model`, no per-provider plumbing.
Prompt tokens, completion tokens, cache reads, dollar cost. Itemised so you can pass-through bill.
Honest framing: we're a wrapper around the Claude Code SDK and a few peer model providers. The SDK is great; running it in production is the part that bites. We're the part that bites, so you don't.
Every plan is BYOK. Your Anthropic, OpenAI, or open-weights key. We charge for the agent loop, the sandbox, and the git push. Model tokens are billed by your provider, never marked up.
For trying it out on a side project.
For one developer shipping serious work.
For small teams building with the API in production.
For high-volume API embeds and enterprise contracts.
Tell us how you'd use the Claude Code SDK if the infra was already handled. We'll send back an API key and a working example for your stack.