uv add ctxrot

🚧 Work in progress. Early notes on a tool that’s still alpha — expect this to change.

A ReAct agent looks fine right up until it doesn’t. It loops, it restates what it already said, the answers get longer and say less. The window isn’t full — it’s just rotting. I kept hitting this and had no way to see it, so I built ctxrot, a way to understand your ReAct agent’s context window. It’s implemented as a drop-in callback for DSPy, and every LM and tool call gets recorded into a local SQLite database.

uv add ctxrot

Why bother

We treat context as append-only, a clarification here, a correction there, and we never go back to prune. The bigger the window, the easier it is to assume more tokens means more understanding. They don’t. Treating context as something to measure rather than trust is the whole point: if the prompt is a program, then context rot is a bug, and bugs you can see are bugs you can fix.

If you want to poke at it with your own agents — docs here.




Enjoy Reading This Article?

Here are some more articles you might like to read next: