Twitxy Saved

Clem

Verified account This account is verified. Learn more

@clembuildsstuff

YouTube @ ClementOh
Ramble about product / eng stuff 😳
Somewhere in the Cloud. clementoh.dev Joined June 2014
1.3K Following 245 Followers 785 Posts

Latest posts 5

Clem Verified account @clembuildsstuff
compaction has a weird design flaw 😳

the handoff summary gets written by the agent at its worst moment ~ 400k tokens deep, the most lost it'll ever be

and the fresh session trusts it blindly

retrieval here: $0.10 vs up to $1.99 compacting 👀
Alexander Yue Verified account @Alezander9 Oct 29
Compaction is a mistake.

When an agent's context fills up, tools like Codex and Claude Code compact it:
1. The model prefills the entire session again
2. It writes a summary of everything so far
3. A new session starts from that summary

I measured this on a real ~400k-token session with Opus 5.5:
→ 38 s and $1.99 when the prompt cache has expired
→ 29 s and $0.17 when it hasn't

And the summary is lossy. The exact error message, the file path, the one number you needed is often gone.

So I do something new for Mainplane

Context retrieval works the other way around. Mainplane keeps the full record of every session as a file. When the context fills up, a new session starts right away with one instruction: "You are continuing session X. Retrieve key context from it as you go."

The agent searches the old session and copies the exact lines it needs, when it needs them.

Same session, same model: 15 s and $0.10 to get back to work. It does not depend on a cache hit, and nothing is paraphrased.

This is the bitter lesson applied to agent memory. Don't hand-design what the model should remember. Give it the full record and good tools, and let it decide.

Mainplane is open source (MIT). Link in the first comment.
View quoted post on X
Clem Verified account @clembuildsstuff
~half of forever security's customers launch coding agents from ~/Downloads 😳

a site can drop a file there with zero clicks. a planted AGENTS.md got codex to install a bad npm package 90%+ of the time in their tests

where do you launch yours from?

forever.security/blog/hijacking…
forever.security Markdown Is the New Executable: Attackers Are Dropping Agent Instructions Into Your Downloads... Forever caught live malware on a customer's machine attempting a new kind of attack: a file planted in the Downloads folder that turns your own AI coding agent against you. Here's how it works on...