Twitxy Saved

Ahmad Ghoniem

Verified account This account is verified. Learn more

@ghoniemdotdev

Spell casting with AI agents
Alexandria, Egypt ahmadghoniem.me Joined August 2015
317 Following 645 Followers 12K Posts

Latest posts 5

Ahmad Ghoniem Verified account @ghoniemdotdev
Haiku and Luna got a new contender in browser automation!

Meet Meta's Muse Ember.

Same price per token as Haiku 5.5 and GPT-6 Luna: $0.10/$0.50 per M.

• Model cost per task on @browser_use's Bench V2.1:
Ember 5.3¢, Luna 12–16¢, Haiku 23–46¢

• Price jump for long context: Ember at 200K (3×), Haiku at 100K (5×), Luna at 272K (2× input, 1.5× output)

I ran it with Browser Use Cloud browsers on an Instabox VM set up by Claude Code with Muse Spark as the judge.

4 of the bench's 200 tasks
Ember @ high:
• Avg score 74 (100 / 90 / 60 / 46)
• Median 9.8 min per task (Haiku high 9.3 min, xhigh 14.2 min)
• ~350 tok/s streaming (crazy fast)
Ahmad Ghoniem Verified account @ghoniemdotdev
TIL: forking a session keeps the main agent's cache warm since both share the identical prefix, and every hit resets its TTL

forks are overlooked compared to subagents tbh and they also get the full context instead of a summary
Alexander Yue Verified account @Alezander9 Nov 6
Subagents are the biggest cause of AI failures

In most harnesses:
1. Main agent writes a summary of what it knows
2. Subagent starts from that summary only, and makes assumptions
3. Subagent works and sends back a new summary of what it did

Same flaw as compaction: all summaries are lossy. This is how your assistant makes emails you never wanted, or purchases what you told it just to get the price of

So I tried something new: checkpoint agents

The initial agent has complete context of what needs to be done. And that input is already cached

Fork the session where it is. Send the fork ahead to do the task and it will do exactly what the main agent would have done; their context is identical

What is even better is when the fork finishes, the cache of the main agent is kept warm by the subagent (they share the same prefix)

I measured it on a 137k-token session with Opus 5.5:
→ Main agent does it on its own: 67 s, $0.38, context +8-17k
→ Checkpoint: 117 s, $0.68, context +2k
→ Classic subagent: 123 s, $0.57, context +4-5k

But here is what I found: avoiding large input is even more important than keeping cache. And most subagent tasks were done better either in series with retrieval, or split up to be parallel over fresh sessions from the start

I do not think there is a place for subagent delegation at all. There should either be a super-agent that orchestrates and does no work, or a long running agent that can retrieve from previous sessions, not a worker that completes tasks partially and delegates the rest to other workers

Don't design harnesses based on our assumptions of human behavior
View quoted post on X
Ahmad Ghoniem Verified account @ghoniemdotdev
"caching is cope for a slow design. do not add caches and delete all existing caches."
0:09
Jarred Sumner Verified account @jarredsumner Nov 1
some things I often say to claude when doing perf optimization work:

> how do we rewrite this to better leverage data-oriented design principles

> can you replace those hash tables with a flat array? can we make the pointers an index into the array? can we pack the most commonly used data into upper bits of the index?

> caching is cope for a slow design. do not add caches and delete all existing caches. instead, redesign it to be faster

> should this be a structure of arrays instead of an array of structures?
View quoted post on X