Skip navigation
Shelley's new compaction algorithm: a tool that the model calls to "squish" and "trim" prior…
0:00 / 0:24

Shelley's new compaction algorithm: a tool that the model calls to "squish" and "trim" prior…

David Crawshaw

@davidcrawshaw15K followers

Visit on X
279 likesDownloadOriginal post

15,937 views

Shelley's new compaction algorithm: a tool that the model calls to "squish" and "trim" prior messages.

12 Comments

Comments from the original post on X (Twitter)

  • Jeff Huber's profile picture

    @jeffreyhuber

    nice viz

    3 likes

  • Nope that ain't me's profile picture

    @kamikaz1_k

    Why did you use to animate ?

    2 likes

  • 0xblackcat.eth's profile picture

    @quangndedu

    Love your illustrarion. How can u do that?

    2 likes

  • Kelly J. Rose (kjrose)'s profile picture

    @kjrose

    Letting the model pick what to squish is a fun trust exercise. Does it go after giant tool outputs first? My bet is one 400-line log dump nobody needed is always the real context hog.

    1 like

  • Buswe's profile picture

    @buswe_com

    Keeping the pre-squish text on disk pays off: when a trim drops something needed you re-expand that one message instead of rerunning.

    1 like

  • Daniel Lenton's profile picture

    @DanielLenton1

    your second version, a summary plus the last few messages kept verbatim, is pretty much what claude code does now. what made you drop it?

  • Jyothidhar's profile picture

    @jyothepro

    like that the model picks what to trim instead of a fixed cutoff. old tool output is usually the dead weight, not the actual conversation

  • Tommy's profile picture

    @agneau123

    Failed constraints still get trimmed first

  • von's profile picture

    @evolnahguav

    Very cool. I wonder what impact this would have on autoresearch workflows where the agent is doing heavy data analysis

  • John Rood's profile picture

    @johnroodepic

    the first thing a squish eats is the why: a decision gets trimmed to one line, so next session the agent reads 'no retries on webhooks' as an arbitrary constraint and proposes removing it. log every trimmed decision with its reason, outside the window. that's the whole reason i built memoryrouter.

  • Steven John's profile picture

    @StevenJPx2

    How does it keep the prompt cache?

  • AI Quanting's profile picture

    @AIQuanting

    Letting the model pick what to drop is the interesting gamble there. Whatever decides something is safe to forget is the same thing that needs it forty turns later. Does it ever squish something and then go hunting for it again?