Mastra: build a Claude Code-inspired coding agent

Learn how Mastra structures a coding agent with modes, approvals and memory, then follow a demo that replaces a tool approval popup with an inline component.

Player not loading? Watch on YouTube

This workshop explains how to build a coding assistant with Mastra. The presenters describe a harness as the stateful execution environment around an agent: it assembles prompts, controls tool access, tracks sessions and connects execution events to an interface. Claude Code and OpenCode provide reference points for plan and build modes.

The code walkthrough covers harness configuration, memory, storage, subagents and event subscriptions. It separates the harness logic from the interface so developers can supply their own terminal or graphical UI. Tool permissions, human approval and session cost tracking are part of the design.

A live Mastra Code demo asks the agent to replace its own tool approval popup with an inline component. The presenter switches models and modes, interrupts planning, approves a plan and checks the resulting approval interaction. The demo also exposes an early-release memory bug, prompting a switch to an older version.

Observational memory receives particular attention. The speakers describe event-based observations that replace raw messages while preserving a stable prompt prefix for caching. They report useful results with a local 3B model for observations, but do not demonstrate a fully offline workflow. They describe Mastra Code as an open source research project with missing documentation at the time. Benefits on long tasks remain anecdotal in this workshop; benchmark work was still underway.