Find the Idea, Not the Case
A big part of the job as an engineer is keeping the system simple as it grows. It’s a difficult thing trying to keep a system well designed through many, many small changes. Now that agents make most of those changes, I’ve been thinking a bit about why systems tend to drift from good structure and what to do about it. Here’s some of what I’ve learned.
Two ways to represent any system
Any system can be described somewhere along a range. At one end is a long list of specific cases (we’ll call this casing). At the other is a small number of general ideas that all of those cases come out of (we’ll call this generalizing). Neither word is a perfect description of the underlying idea there, and it’s much more nuanced, but they’re useful names for the two ends. In my experience, generalizing makes for a much better system.
The practical reasons are easy to see. You can keep a few ideas in your head; you can’t keep two hundred cases. An idea covers cases nobody has hit yet, and when something changes, you change it in one place instead of hunting down every case it touched. This concept of generalization, I think, is where a lot of software design principles stem from.
Side note: What first got me thinking along these lines was a more mathematical angle on understanding. 3Blue1Brown’s Compression is Intelligence videos go into how compressing information connects to understanding it, and the idea that understanding something well means reaching the same conclusions with a few general principles instead of a lot of memorized facts. Good lunch watch.
Why we special-case
It comes down to short-term versus long-term reward and effort. When something new comes up, you have two options. You can handle it as a small case, which is quick and gets things working today. Or you can step back and ask what it says about the whole system, which is slower and only pays off in changes that haven’t happened yet. With a working system in front of you and something due, the special case wins almost every time. It’s the sensible call in the moment, and it’s still the sensible call the next time, and the time after that.
Here’s a simple example to illustrate. Say your app starts with one rule: admins can edit everything, everyone else can view. Then managers need to edit their own team’s records, so you add a check. Then a contractor needs access to one project, so you add another. Then support needs to see customer accounts but not export them, and finance needs to export but not edit. Each check is a reasonable call, and each one lives wherever the request landed. A year later nobody can answer “who can do what?” without reading the whole codebase. The missing idea was there from the start: access is a person, a role and a resource, with permissions connecting them. Once that exists, most of those checks become rows in a table.
You might read that and think “well, obviously.” That’s a common example with a common solution, but even when the idea is this obvious in hindsight, systems can still end up cased, one reasonable decision at a time.
Organizations drift the same way. A process picks up a new step after every incident. Each step made sense when it was added. A year later the process is long and now people follow it without knowing why because “that’s how we do it - it works”. The real fix was probably some underlying idea about how the work/information should flow. But organizations are much harder to change than software or a document, because reworking the system means changing how a lot of people do things.
Iteration seems to be a primary cause of casing, but iteration is just how the world works. Lessons rarely arrive all at once. They come as a stream of small corrections, each judged on its own short-term cost and too minor to justify a rethink, so each gets handled in place and the cases pile up.
Agents and the short term
LLMs are actually very good at designing a well-represented system from scratch. Give an agent a blank slate and good context and it will typically come back with something clean, with sensible boundaries. Where they struggle is the same place people do: the iteration. Inside an existing system, they take the least-effort path to done, and that path is almost always the local patch.
I think a big part of the reason is how they’re trained. Models are mostly rewarded for the short term: the tests pass, the request is met, the task is done. Whether the system is better represented afterward only shows up much later, and is hard to measure, so it tends to get left out of the reward. Casing is exactly what you’d expect from something optimized that way.
Good human engineers get a longer-term signal: they usually have to live with the system they change. The cost of the shortcut comes back to them, and the best ones learn to pay a little more up front. Agents don’t carry that forward yet. Each task starts fresh and ends when it’s done.
And because agents work much faster than people do, and usually in many more iterations, the cases pile up faster too. I think this is one of the reasons we see AI work turn to “slop” pretty quickly, and it can be frustrating.
Caring about the long term
The answer isn’t to put maximum effort into every change. If you restructure the system every time something new comes up, you move forward too slowly, and somewhere with real resistance to change, like a large organization, constant rework does its own damage. Over-engineering is a real failure mode too. Sometimes a special case is the right call. But if you only ever optimize for the short term, the patchwork wins by default.
What I’ve seen work best is the good ole refactor cycle. Let small cases land where they land, and watch for the second or third one with the same shape. That’s usually the sign of a missing idea, and that’s when restructuring pays for itself: it handles the cases you’ve seen and a few you haven’t hit yet.
With good human engineers, this balance is largely solved: living with their systems teaches them when to refactor. Agents don’t have that yet, and they change the math on both sides. An agent can restructure a module in minutes, so in software the general fix is much cheaper than it was. But agents also default to the patch, and they add cases faster than anyone can review them. So the effort moves from doing the rework to deciding when it’s needed. Organizations don’t get that discount, since people still have to change how they work, so the restructure cost is still high (this is one of the reasons I love startups btw).
This applies beyond code too. Agents work on docs, spreadsheets, processes, etc - and their scope of work is getting bigger. These things can all drift the same way, and most of those don’t have tests to catch it yet.
So a useful way to think about it is: how do we get models, and the systems we build around them, to care about long-term reward, and how long is long-term? Some of that is probably training, and some is probably context. Getting agents to do this well is an open problem, and I think it’s one of the more important ones in how we’ll all build with them. The shortest version I’ve landed on: don’t add the case, find the idea behind it.
Luke Weidner