“Treat Agent Threads as One-Off Notes and Rip Them Off Frequently”

→ Flowing with agents with Beyang Liu, CTO of Sourcegraph (Changelog Interviews #658)

When working with a coding agent, do you consciously keep the conversation short and start a new thread for a new task?

In September, Sourcegraph’s co-founder and CTO Beyang Liu took an interview on the podcast, Changelog Interviews.1 In the show, he shares his observations on how senior software engineers use coding agents. Compared with how non-engineering users tend to use them, he offers the following advice:

I would actually recommend… you should treat threads sort of like one-and-done, rip-off notes. Rip them off frequently rather than do the whole… like You don’t need to build the entire app inside a single thread. In fact, I would probably recommend against doing that, because you will get lower quality, higher latency, and more cost if you do that.

(The quote actually starts at 01:01:05, but I set the video to play from 59:06 to give more context.)

I am writing this post as a reminder to myself, because I was one of those people who kept working with the coding agent in the same thread, even when the tasks weren’t related, until we ran into the context limit.

A couple of months ago, I used ChatGPT to turn an idea into a little Mac app. I first used ChatGPT’s web app, and I made a workable prototype in an afternoon. (It’s incredible!) Later, I started using ChatGPT’s Mac app alongside Xcode. Eventually, I switched to Claude Code because of its reputation for coding.

I had been working with Claude Code in the same thread the whole time, handing it one task after another, until auto compact kicked in. Back then, I knew the thread would need compaction once we got close to the context limit, and I never really thought about why there was even a command to compact the conversation manually. Then one day I realized something was off: Claude Code suddenly seemed “dumber.” Even though we were still in the same thread, it seemed to have forgotten what we had talked about earlier and the tasks it had already completed. It was frustrating.

That was the moment I understood that the thread itself had become the problem.

Now I get it. After I listened to the podcast, I changed the way I work with coding agents. When I normalize my news database and build things on top of it with Amp, I keep threads short and, when possible, start a new one or use Amp’s handoff feature.

If you have the same issue I had, you can also read this guide on managing context from Amp. As the guide puts it, “The longer your conversation goes on, the higher the chances are the model goes ‘off the rails’: hallucinating things that don’t exist, failing to do the same things over and over again, declaring victory while standing on a mountain of glass shards.” It clearly explains why the user should manage context consciously, illustrated with diagrams created in Monodraw. And if you happen to be an Amp user, the guide also provides a series of features for working with the context window in Amp.


  1. Now Sourcegraph and Amp are two separate companies. See “Amp, Inc.” for more details. ↩︎