ByteBulletin

[tooling] · · 2 min read

AnyClaude SDK: Run Claude Code's Agent Loop Anywhere — Browser, Server, Local

A new open-source SDK ports Claude Code's multi-turn tool-using agent loop to any LLM endpoint, running in WebContainers, Node, or Bun with no backend required.

By ByteBulletin Editors · Editorial Team

[tooling]

The team behind Pipilot has released AnyClaude SDK, an open-source library that replicates the agent capabilities of Anthropic's Claude Code — tools, multi-turn conversations, MCP, sub-agents, and multi-agent teams — against any OpenAI- or Anthropic-compatible LLM endpoint. The SDK runs in the browser via WebContainers, Node, and Bun, with no backend, OAuth, or native binaries required.

At its core, AnyClaude exposes the same query() async-generator interface and SDKMessage envelope as Anthropic's official @anthropic-ai/claude-agent-sdk, so code written against the official SDK can consume its output unchanged. Three transport clients (AnthropicClient, OpenAIClient, OpenAICompatibleClient) normalize tool calls, streaming, and usage to a unified StreamResult, including a fallback parser for models that emit tool calls as inline text.

Multi-Agent Teams and Browser-Native Architecture

The SDK's standout feature is its multi-agent team support: a coordinator delegates tasks to worker sub-agents in parallel, with push delivery via a message-queue-like system. Messages can be delivered to running agents mid-turn, landing on their next tool round without polling. Agents can run in separate Web Workers or browser tabs that share a mailbox via BroadcastChannelMailbox. The team also provides durable cross-tab delivery with IndexedDB/localStorage fallbacks via the broadcast-channel package.

Flexible Sandboxes and Host Execution

AnyClaude isn't tied to WebContainers — a "Sandbox" is just a FileSystem plus a CommandExecutor, and you can mix and match. Supported sandboxes include WebContainer, E2B, Vercel Sandbox, Daytona, Cloudflare Sandbox, and a LocalSandbox that runs directly on the host machine (Windows, macOS, or Linux). For browser persistence, the SDK offers DexieFileSystem (IndexedDB) as the recommended default, with OpfsFileSystem for large-binary scenarios and MemoryFileSystem for tests.

Host-Client Split and Security

A key design pattern is the ability to run the agent loop server-side while tools execute on the client. The SDK's client_tool_request mechanism pauses the loop, sends a request over the wire, and waits for the client to execute the tool and return the result. This keeps the system prompt, tool instructions, and retrieved context on the server — never reaching the browser. For sensitive outputs, a stripArtifacts() transform can filter reasoning, raw tool output, and model identity from streamed messages.

Ready-Made React UI Kit

The accompanying anyclaude-react package provides a full set of restylable components: AgentChat, ChatPanel, Transcript, MarkdownMessage, Composer, Working, ToolCall, plus an IDE set with Terminal, FileExplorer, CodeEditor, and AskUser. The createAgentClient function auto-stitches paused continuations and runs client tools in the browser.

Anthropic-Compatible Router

Perhaps most intriguingly, the SDK includes an Anthropic Messages API-compatible endpoint that wraps any OpenAI-compatible model (DeepSeek, Qwen, Ollama, etc.), recovering inline tool-call dialects into proper tool_use blocks. This means Claude Code itself can be pointed at cheap local models — a boon for developers who want the Claude Code experience without the API costs.

AnyClaude SDK is MIT-licensed and available now on GitHub.

SHARE

← All stories