Trim the context before it gets heavy
Conversations with tools like Claude Code in a terminal window load up with context over time. As they do, each conversation uses more and more tokens. The logical fix is to build a slash-command skill that trims the context and refreshes the conversation, so it eats fewer tokens.
- When I started thinking about this, I ran a quick audit of my own setup, which I call the bench and describe in this video. It splits my conversations with AI into separate folders depending on what we're talking about.
- My setup suffers from bloated context too, even though I already have an automatic note taker much like the trim skills people are building. Up to now, though, it only kicked in after a terminal session had been inactive for an hour or longer.
- I now realise it would be better if it triggered automatically at a specific token count, instead of waiting until the conversation is over. I'm going to try this adjustment and will let you know how it works.
- We also need service files that hold temporary pointers. Once the conversation is refreshed, the new AI doesn't remember anything, so it reads those pointers to learn what was happening before the refresh.
I'm using OptMem, which on my bench is a three-layer system with an overnight automation that organizes things. Even a simple follow.md file would work to begin with.
Yours, wherever this finds you,
Zhenia