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, 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, and retrieval primitives yourself, with the model as one configurable piece rather than the thing the whole library is built around.

published

sources

keep reading

More on this.

Try Tessary on Cloud.

free · 10,000 traces a month · 1 GB · 30-day retention · $10 one-time credit for triage and RCA · no credit card