# What's the difference between the Claude Agent SDK and Mastra?

The Claude Agent SDK hands you Claude Code's own binary and tool loop, running one model, Claude; Mastra is a TypeScript framework you assemble yourself, bundling its own agent, workflow, memory, and eval building blocks behind a router that reaches more than 1,000 models from any provider, Claude included.

Licensing splits in an unexpected direction. [The Claude Agent SDK's Python package is MIT, but its TypeScript package carries Anthropic's own commercial terms](/answers/claude-agent-sdk-evals/is-the-claude-agent-sdk-open-source), the language most Mastra users would actually reach for. Mastra itself is TypeScript-only, and its core ships under the Apache License 2.0; only code inside directories named `ee/` sits under a separate, source-available Enterprise License that requires a paid license for production use and stays free for development and testing.

The two also disagree on what "the agent" owns. The Agent SDK lets you add your own tools, hooks, and subagents around Claude Code's loop, but the loop itself and the model it runs are fixed; Mastra expects you to wire together its own workflow engine, [its own memory system](/answers/agent-memory/what-is-agent-memory), and retrieval primitives yourself, with the model as one configurable piece rather than the thing the whole library is built around.

---

Published: 2026-10-20

Sources:
- Agent SDK overview, Anthropic: https://code.claude.com/docs/en/agent-sdk/overview (fetched 2026-10-20)
- Mastra AI Agent Framework overview (mastra.ai): https://mastra.ai/ai-agent-framework (fetched 2026-10-20)
- mastra-ai/mastra README, license section: https://github.com/mastra-ai/mastra (fetched 2026-10-20)

Source: https://tessary.ai/answers/claude-agent-sdk-evals/whats-the-difference-between-the-claude-agent-sdk-and-mastra
More on Claude Agent SDK evals: https://tessary.ai/answers/claude-agent-sdk-evals
From Tessary, agent reliability for AI agents in production: https://tessary.ai
