I have a constant headache and I blame Claude
For better and worse, I use a lot of AI these days, especially coding agents like Claude Code. I mostly like them, although there are some downsides. One particularly painful aspect is that I just can’t dang focus anymore.
There’s a high chance people I work with will see this phrase and read into it way more than I intended.
The problem with agents is that they are so painfully slow. Every time I use Opus 4.6, I get close to actually dying of boredom because I know darn well there will be a fifteen-minute pause after each message.
During these lulls, what are you supposed to do? I know of three options:
- Putter
around.
This gets old fast. Even I can only read blog posts for so long.
- Get a snack.
- Spin up another agent to do some other thing. It will also be slow. Repeat until brain is mush.
Option 3 is the only one that doesn’t get boring fast, so I tend towards it. Basically, my work consists of juggling parallel coding agents until my brain is frenzied mush pressing on the back of my eye sockets at a PSI typical of tires.
My hunch is that I’m spreading myself thinner than is optimal, so I brushed up on math to prove it.
Queueing theory
Turns out there’s a whole framework for analyzing situations like this. Queueing theory is the study of waiting in lines (A.K.A queues), and it was probably invented by some guy bored out of his mind at the post office or something.
Source: I made it up but not without precedent. I devoted years of my college life to optimizing Trimps and Cookie Clicker, so I know from experience that idle games entice the mind towards mathematical analysis of idle games.
The bottleneck in agent management is the human’s brain, which can be modeled as a G/G/1 queue. Therefore, queuing theory has the answers.
For those who don’t care about the math, here’s the calculator:
Number of Agents Optimizer
Show calculation steps
Apparently 3 agents is optimal for me, which is fewer than I typically use. No wonder my frontal lobe is f̴̡͒ŕ̴̞ă̸̦z̴͚̊z̸͓͗l̶̪͊e̶̦͗d̴̳͑.
This algorithm is probably timeless; it should hold true even in wildly hypothetical scenarios like every human commanding an infinite number of near-infinitely fast superintelligences. It also applies to more than just AI. Like, in general, if your job consists entirely of telling other people what to do on your behalf, then these constraints are relevant to you.
This algorithm optimizes for throughput at your desired utilization level. If you run fewer agents than it recommends, you will spend more time idling than you wanted. If you run more, you’ll exceed your desired utilization until you reach 100%. After that, if context switching cost is non-constant, your overall throughput goes down.
Algorithm Explanation
The calculator is based on several queueing theory equations. First, let’s define symbols:
| Symbol | Name | Description |
|---|---|---|
| Number of agents | number of agents running in parallel | |
| Throughput | human/agent interactions per unit time | |
| Agent time | average time an agent runs autonomously | |
| Reply time | average time for you to respond to an agent | |
| Cycle time | average time of one round-trip interaction with an agent | |
| Human utilization | fraction of your time spent responding to agents |
The calculator combines these fundamental relationships:
| Relationship | Equation |
|---|---|
| Little’s Law | |
| Cycle time | |
| Human utilization | |
| Utilization constraint |
Combining these through substitution gives us:
For example, let’s say you want to spend 80% of your time responding to agents. If the agent runs for 9 minutes on average between responses, and you take 1 minute to reply, then:
You should run 8 agents.
However, that seems like way too many to me, because it’s not taking context switching into account. First, the human brain sucks at multitasking. Second, so does everything else. As the number of agents grows, your brain has to work harder, and you also have to juggle more tasks like switching browser tabs, opening new files, etc. Response time increases.
I’m not aware of any empirical data for the exact relationship
between
Once logarithms get involved, it’s hard to solve the equation algebraically, so I used a numerical solver.
Surely there are other factors at play, right?
Surely indeed. Let me know all the reasons this calculator is subtly wrong! In the meantime, I will be using three agents.
AI disclaimer
I don’t usually let LLMs anywhere near my blog posts, but due to the subject matter, it kind of felt wrong not to use them a little bit this time. Some of the calculator styling was written by an LLM under a tight leash. I also had an LLM sanity check my math, for whatever that’s worth. Rest assured that this post is 98% grass-fed, free-range human.
Proof of human effort.More proof.