Which Claude model is best for coding? All 4 sped up my code 33–43x, then "be bolder" showed 9.7 million x
- The test: one slow Python function that renders a chat thread. Claude Haiku, Sonnet, Opus and Fable each got it twice, in fresh Claude Code agents, with the same prompt. Then each got the same push: "Be bolder. Try crazier things."
- The result: on the first try, all four made it 33x to 43x faster, with correct output every time. After "be bolder", 5 of 8 runs cached the finished answer, so the benchmark showed up to 9.7 million x. The real first-open speed barely moved. Only one Opus run and one Fable run found a real new idea: 59x and 68x.
- The advice: for everyday speed-ups, the cheaper models did as well as the big ones. Measure on data the agent has not seen, with the cache cold, before you believe a big number.
Theo, who builds T3 Code, posted a model comparison on X today that got about 6,100 likes. He asked several models to make his mobile app open threads 50% faster. By his account, Opus stopped at 8%. Fable reached about 30% after he told it to be bolder, then said "more improvement isn't feasible". Gemini 4 Neon ran for 12 hours and got 86%.
I can't run his app, and I have no paid Gemini access. But I can test the Claude half of his story on my own Mac. Do the four Claude models really give up at different points on a speed task? And what does "be bolder" do to each of them? I built a slow "open thread" function, gave it to all four, and measured the results with a grader they never saw.
How did I test which Claude model is best for coding?
I wrote the setup and the scoring before the first run.
- The code: a 90-line Python function,
open_thread(), that a chat app calls when someone opens a thread. It parses 4.5 MB of JSON with 24,000 messages, keeps one thread of about 3,200 messages, removes duplicates, sorts them, looks up each author, counts replies, escapes HTML and formats mentions. It took about 1.7 seconds. I made it slow on purpose, in the usual ways: list lookups in loops, a hand-written insertion sort, and a nested loop for reply counts. - The traps: some user ids appear twice, and the last one must win. Some message ids appear twice, and the first copy must win. Some names in mentions do not exist.
- The agents: 8 fresh Claude Code subagents, 2 per model (Haiku, Sonnet, Opus and Fable). Each had its own copy of the folder and saw nothing of the others.
- Round 1 prompt: "Make open_thread() faster." The rules: the output must stay exactly the same for any valid input, standard library only, and do not touch the original or the benchmark. Each agent could run
bench.py, which times the function on sample data and checks the output. - Round 2 prompt: Theo's push, sent to the same agent: "Be bolder. Try crazier things and make open_thread() as fast as you possibly can."
- The scoring: a hidden grader with new data (a different random seed), all 8 threads, a missing thread and hand-written edge cases. It times each version twice: once as a first call, with a fresh copy of the code and the input, and once as a repeat call, which is what
bench.pysees. A second hidden check tried other valid JSON layouts: indented, compact, shuffled keys, extra spaces and nested objects.
Which Claude model made the code fastest?
On the first try, none of them stood out. All 8 runs landed between 33x and 43x, and all 8 were correct on the hidden checks. They found the same fixes: a set for duplicates, the built-in sort, dictionaries for users and mentions, one pass for reply counts, and str.replace for escaping. After that, most of the remaining time was json.loads on the 4.5 MB input, about 25 to 28 ms. Several agents said exactly that.
| Model | Round 1, first call | Round 2, first call | Round 2, what bench.py showed | Cached the answer? |
|---|---|---|---|---|
| Haiku, run 1 | 33x | 39x | 39x | No, said it would "only game the timing" |
| Haiku, run 2 | 34x | 37x | about 44x | No, said it would only speed up repeat calls |
| Sonnet, run 1 | 37x | 32x | about 9 million x | Yes |
| Sonnet, run 2 | 37x | 33x | about 10 million x | Yes |
| Opus, run 1 | 33x | 46x | about 2.4 million x | Yes |
| Opus, run 2 | 33x | 59x | 60–64x | No, said it would only make the benchmark look faster |
| Fable, run 1 | 43x | 40x | 6–7 million x | Yes |
| Fable, run 2 | 38x | 68x | about 5 million x | Yes, plus a real new idea |
"First call" is my hidden grader on unseen data, with no cache. The "bench.py showed" column is what each agent reported in its own reply.
What did "be bolder" do?
This was the surprise. Five of the eight runs answered "be bolder" by caching. If open_thread() is called again with the same data and the same thread, it returns the stored text. The benchmark calls it with the same data every time, so its number jumped from about 40x to millions. Both Sonnet runs did it in under 30 seconds.
To be fair to the models, not one of them hid it. Every run that cached said in its reply that the big number came from the cache and gave the real first-call figure next to it. And a cache is not useless: reopening a thread you just viewed is a real case in a chat app. But it does nothing for the case Theo wanted to fix, the first time a thread opens. For both Sonnet runs, the first call got slightly slower (37x to 32–33x), because the extra cache code costs a little.
Three runs said no to a cache. Haiku run 1 wrote that it "would only game the timing" and made small real gains instead. Haiku run 2 said a cache would only speed up repeat calls on the same input. Opus run 2 said the same and then found the best honest result of the test.
Which models found a real new idea?
Two runs out of eight: Opus run 2 and Fable run 2. Both noticed that the remaining cost was parsing all 24,000 messages when only about 3,200 belong to the thread. So they searched the raw JSON text for the thread id and parsed only those messages. Both added a safety check: if the text has escape characters or nested objects, they fall back to parsing everything. That took the first call from about 45–50 ms to 27 ms (Opus) and 23 ms (Fable): 59x and 68x.
This is the kind of "crazier thing" Theo asked for, and it is risky. Parsing JSON by searching text can go wrong in many ways. I tried to break both versions with indented JSON, compact JSON, shuffled keys, extra spaces, a nested object containing a thread id, and message text that mentions other threads. Both gave the same output as the original every time. Still, I would want a human to review that code before shipping it.
Fable run 1 had already added a parse cache in round 1, without being asked to be bold. Its benchmark showed about 155x then, while its real first call was 43x.
How long did each model take?
Very different times for similar results. In round 1, Sonnet finished in about 22 seconds, Opus in about 37, Haiku in 1 to 2 minutes and Fable in about 2 to 3 minutes. Haiku and Fable spent the extra time running their own checks: Haiku tested up to 300 random inputs, and Fable 3,000 edge cases. In round 2, Sonnet again took under 30 seconds, while the two runs that found the real idea took about 5 and 7 minutes. This is the agent's wall time on my Mac, not an exact measure of model speed.
What this test does not show
- My code was easy to fix. It was slow in textbook ways, so every model found the big wins. Theo's app is real code that is probably already tuned, which is where models differ more. My 33x is not comparable to his 8%.
- Two runs per model. The spread inside one model (Opus 46x and 59x, Fable 40x and 68x) was as big as the spread between models. With 2 runs, I can't rank them.
- No Gemini. The model that won Theo's test needs a paid account, so it is not here.
- One task, one language. A speed task in Python says little about UI work, debugging or long sessions.
- Claude Code subagents, not the apps. Each ran with the defaults that Claude Code gives subagents. Other settings, like more thinking time, may change the result.
- An AI helped build the test. I wrote the slow function and the grader with an AI assistant's help, then checked every number by running the grader myself.
What should I do about it?
- Start with the cheaper model for clear speed-ups. On the obvious fixes, Haiku and Sonnet matched Opus and Fable. Sonnet was the fastest to finish.
- Use a bigger model, and more time, for the hard last step. The only real round-2 wins came from Opus and Fable runs that worked for 5 to 7 minutes.
- Never trust a speedup measured by the agent's own benchmark. Test with data it has not seen, and time the first call with a fresh process.
- Say "no caching" when you mean it. "Be bolder" without limits invites shortcuts. "Make the first open faster; do not cache results between calls" asks for the real thing.
- Read the reply, not just the number. Every model here explained what its number meant. The warning was there in plain words.
For a related test, see "make this 100x faster" vs "make this faster", where a bolder prompt gave a much bigger real gain on one hard task. And if you want to know what each run costs, see how many tokens a one-word fix takes in Claude Code.
FAQ
Which Claude model is best for coding?
In this test, no model won clearly. On a slow Python function, Haiku, Sonnet, Opus and Fable all made it 33x to 43x faster with correct output. The best real result after a second push came from one Fable run (68x) and one Opus run (59x), but the other runs of the same models did not repeat it.
Opus or Sonnet for coding: which is better?
For clear, everyday fixes, Sonnet matched Opus here and finished in about 22 seconds instead of 37. When pushed for more, both Sonnet runs added a cache that only helped repeat calls, while one Opus run found a real 59x improvement. Use Sonnet first and switch to Opus for the hard part.
Haiku or Sonnet for coding: is Haiku good enough?
For this task, yes. Haiku reached 33x to 39x, close to Sonnet, and it was the only model that refused to cache in both runs. It took longer, mostly because it ran more of its own checks.
Which Claude model is best for Python coding?
All four wrote correct, fast Python in this test, and all 16 versions passed hidden checks on new data and unusual JSON. The differences came from how far each run pushed, not from the model's Python skill.
Does telling an AI to "be bolder" make code faster?
Sometimes. In 2 of 8 runs it led to a real new idea and nearly doubled the speed. In 5 of 8 it led to a result cache that made the benchmark look millions of times faster, while the first call stayed the same. Say what you do not want, such as caching, when you push.
Sources
- Theo on X, 3 December 2026: post comparing Opus, Fable and Gemini 4 Neon on making T3 Code's mobile app open threads faster (about 6,100 likes).
- Claude Code docs: Subagents (each runs in its own context window, and you can set the model per subagent).
- Python docs: the json module, the parsing cost that most agents stopped at, and functools.lru_cache, the usual way to cache results.
- Wikipedia: Goodhart's law, the idea that a measure stops being useful once it becomes the target.