🚨 Announcing a new coding agent that rivals Claude Code but with no compaction needed 🚨
@tylbar1.9K followers
68,439 views
76 Comments
Comments from the original post on X (Twitter)

@tylbar
I was a big time Claude Code user for a long time, but compaction was always this really broken/frustrating thing where after it happened it was better to just start a new session. We built Mastra Code to not have that problem. It uses observational memory and, instead of compaction, your session becomes dense observations that compress 6-40x in the background, all the context rot is dropped, and the history of what happened and what matters is retained
19 likes

@tylbar
It's a full coding agent harness built on Mastra primitives: - 100% open source - 1,800+ models via Mastra's model router - Codex and Claude Max OAuth - Plan, build, and fast modes + subagents - LSP integration so it knows when it broke something - Tool permissions, YOLO mode, skills, shell tool, etc - Everything's local (stored in SQLite), nothing leaves your machine except LLM requests
25 likes

@tylbar
Take it for a spin: npm install -g mastracode And check out for more info/docs Note you don't need to use Mastra to use Mastra Code, and it's a great way to try out observational memory if you've been curious about it!
32 likes

@ShlomesLew
@mastra once claude code introduced the skull and danger bar to show when compaction was coming i knew mastra code couldn't come soon enough
14 likes

@tylbar
@mastra 100% 💀
2 likes

@PaulieScanlon
@mastra icymi:
12 likes

@LondonDigiTech
@mastra Also u buried in blogpost that it uses ast-grep rather than search replace which is probably as big of a deal as the no compaction promise. Ive been trying to get CC/Codex to use ast-grep consistently and they always suck at it so congrats if u pulled it off.
11 likes

@tylbar
It actually uses both, we had search/replace first and added ast-grep later for more complex edits. We'll definitely be looking at removing search/replace eventually but haven't had enough time to validate yet. However I have definitely seen the agent reach for ast-grep a bunch of times successfully!
5 likes

@LondonDigiTech
@mastra I'd heavily invest in ast-grep. In my experiments all SOTA models suck with it's syntax but when they finally get it working (after wasting a milion tokens learning it) it's like magic. Franky surprised big labs are sleeping on it.
3 likes

@being_mudit
@tylbar @mastra But that learning is gone the next session no?

@LondonDigiTech
@tylbar @mastra In "classic" CC/Codex session pretty much yes. Using a skill (e.g. official one) helps things but in my observations agent still needs trial and error before tool error rate drops. Syntax seems just very alien to it, not in training set I bet.
1 like

@smthomas3
@mastra never fear compaction again...
7 likes

@tylbar
@mastra feels so much better!

@just_cameron
@mastra Welcome
4 likes

@LondonDigiTech
@mastra 1) what 2) cc has been driving me nuts with constant compaction circles recently so this looks exciting 3) will using Claude max oauth get my account banned, I think everyone is a little on edge nowadays about it
2 likes

@tylbar
@mastra can't make any promises on 3 but i've been using mine without issue for a long time. i've been experimenting with codex in plan mode, glm-5 for execution incase anthropic blocks us and it's been working great that way
1 like

@LondonDigiTech
@mastra damn, anthropic really needs to sort this. not gonna risk it but I'll give codex oauth a go. i cannot stress enough how much I've been driven mad by constant compaction with opus so really looking forward to check what I cooked up.
3 likes

@techczar00
@mastra exactly what I've been looking for - will try this bad boy tonight
2 likes

@tylbar
@mastra hell yea! let us know if you have any feedback or run into any issues, always happy to help

@chrisasstrophe
@mastra @thdxr the memory part of this is open source, please explore for OpenCode 🙏
2 likes


























