Skip to content
tokenworm ★ GitHub

← All comparisons

tokenworm vs Claude Agent SDK

Anthropic-published agent SDK

Claude Agent SDK and tokenworm both let you build coding agents, but they make opposite deployment bets. Claude Agent SDK is a package on Node.js or Python that talks to Anthropic models, integrates tightly with Claude features, and ships JSON-resumable sessions. tokenworm is a 960KB native Zig binary that talks to any of five providers, sandboxes shell commands at the OS level, and uses a portable binary session format.

All rows below are taken from the tokenworm README's "Why Tokenworm?", "Performance", and "Comparison with Other Agent SDKs" tables. Where the README marks a value "N/A" we preserve it as "N/A". We intentionally do not introduce dimensions the README does not document.

Dimension tokenworm Claude Agent SDK Advantage
Runtime dependency None (native binary) Node.js or Python tokenworm
Binary size 960KB (ReleaseSmall) N/A (~200MB runtime) tokenworm
Cold start 8ms ~500ms (480ms in the perf table) tokenworm
Idle memory 2.4MB ~45MB tokenworm
Sandbox OS-native (bwrap, seatbelt) None tokenworm
Language SDKs 5+ (C ABI → any language) 2 (Python, TS) tokenworm
Multi-provider Yes (5 providers) Anthropic-only tokenworm
Session format Binary .tworm (5x smaller per README) JSON tokenworm
Deployment model Embeddable library (libtokenworm.so) Package dependency tokenworm
Implementation language Zig (native) TypeScript, Python Comparable
Install Single binary / brew / npm / pip npm install / pip install Comparable
Built-in tools 6 10 Claude Agent SDK
Subagents Yes (AgentDefinition) Yes (Agent tool) Comparable
Hooks 18 shell-based 7 callback-based tokenworm
Skills SKILL.md files SKILL.md files Comparable
MCP stdio + SSE Config-based Comparable
Streaming SSE + callback Async iterator Comparable
Cancellation SIGINT + API Signal-based Comparable
Embeddable libtokenworm.so No tokenworm
Session save (100 msgs) 0.4ms 12ms (JSON) tokenworm
Session load (100 msgs) 0.6ms 18ms (JSON) tokenworm
Session size (100 msgs) 24KB (.tworm) 145KB (JSON) tokenworm
Token overhead per task 1.0x (minimal prompt) 1.4x tokenworm
License MIT Commercial Terms tokenworm

Pick tokenworm when

  • You want a 960KB binary you can drop into a CI runner, a CLI tool, or a desktop app with no Node or Python install
  • You need to switch between Anthropic, OpenAI, Ollama, MiniMax, or OpenCode Zen at runtime without changing code
  • An 8ms cold start matters because you invoke the agent dozens of times per task
  • You want OS-native sandboxing (bwrap on Linux, sandbox-exec on macOS) without standing up Docker
  • You want a portable .tworm session format that resumes across the CLI, Python, TypeScript, and Go SDKs
  • You need to embed the agent core in another language via a C ABI — Rust, Swift, C#, Kotlin

Pick Claude Agent SDK when

  • You are already standardized on Claude and want the deepest integration with Anthropic-specific features
  • You prefer an SDK with the language-ecosystem familiarity that Node and Python give you
  • You want the vendor-published, vendor-supported path for an agent built on Claude
  • Your agent runs inside an environment that already has Node or Python available and binary size does not matter

Both choices are reasonable for different jobs.

Claude Agent SDK is the vendor-published path; tokenworm is the systems-language bet. The numbers above come from the README's own benchmarking on Linux x86_64 (Intel i7-13700K, 32GB RAM) — pull the repo and rerun them if you want to verify.