Claude Agent SDK vs Mastra
Claude Agent SDK (Anthropic) and Mastra (Mastra) side by side on public data, as of Nov 20, 2026.
Claude Agent SDK has 7.9x the weekly package downloads of Mastra (29.3M against 3.7M). Mastra has 3.4x the GitHub stars of Claude Agent SDK (29.6K against 8,588). Over the last 30 days downloads moved +38% for Claude Agent SDK and +50% for Mastra. Claude Agent SDK shipped 41 stable releases in the past 90 days. Mastra shipped 24 stable releases in the past 90 days.
Which should you choose?
Choose Claude Agent SDK if
- you want frequent updates (41 stable releases in 90 days against 24)
Choose Mastra if
- you need to run local models
- you want to switch between model providers (12 documented against 4)
Built from documented features, official prices, status pages and usage data on this page; it does not judge output quality.
Side-by-side numbers
| Metric | Claude Agent SDK | Mastra |
|---|---|---|
| Gid Score | 64 | 63 |
| Usage data as of | Nov 19 | Nov 19 |
| Rank by Gid Score | #4 | #5 |
| Downloads, last 7 days | 29.3M | 3.7M |
| Downloads, 7-day change | up 5.9% | up 14.9% |
| Downloads, 30-day change | up 37.6% | up 49.9% |
| VS Code installs | — | — |
| Marketplace rating | — | — |
| GitHub stars | 8,588 | 29.6K |
| Homebrew installs, 30 days | — | — |
| Hacker News mentions, 30 days | 8 | 18 |
| Latest stable release | 0.2.185 · yesterday | 1.84.0 · 2d ago |
| Stable releases, 90 days | 41 | 24 |
| Terminal-Bench (best run) | — | — |
| Price | Free (OSS) | Free (OSS) |
| Incidents, last 30 days | 12 · 10 major or critical | — |
| License | MIT (Python SDK) | Apache-2.0 (enterprise features under a separate licence) |
| First released | — | October 2024 |
| Interfaces | Python library, TypeScript library | TypeScript library |
| Models | — | — |
A dash means there is no public data for that metric as of Nov 20, 2026.
Trends
Claude Agent SDK
Anthropic's SDK that exposes the agent loop, tools and context management behind Claude Code, for building custom agents in Python and TypeScript.
Pricing: The SDK is free to install; usage is billed through the Claude API or a Claude subscription.
Latest release 0.2.185:
- bash pip install claude-agent-sdk==0.2.185
Mastra
A TypeScript framework for building agents and AI workflows, with memory, evals, retrieval and observability built in.
Pricing: Mastra is open source and free to use; you pay only for the models and infrastructure it runs on.
Latest release 1.84.0:
- Knowledge alpha scope matching changed: $param now matches exactly one segment; raw : is no longer allowed inside a scope segment, requiring canonical encoding via encodeKnowledgeScopeId /…
- @mastra/factory: newestOpenPullRequestNumber is no longer exported from @mastra/factory/boards; use workingPullRequest(item) + pullRequestSourceNumber.
- @mastra/playground-ui: ListSearch and SearchFieldBlock are removed; migrate to SearchInput. Also removed SectionCard and CardHeading in favor of settings components.
- @mastra/factory: MastraFactory no longer accepts intake: { evaluator } (set via env/project config instead); passing it now throws at startup.
Claude Agent SDK vs Mastra: common questions
Do Claude Agent SDK and Mastra support local models?
Mastra documents support for local models; Claude Agent SDK's documentation does not.