Our setups today as software engineers have changed significantly from what they were a few years ago. We now have harnesses and models and skills and "CLAUDE.md" files and so on. But the fact of the matter is that we're not spending nearly enough time refining them.
Flying Blind
We're constantly evolving our setups all the while being blind to whether we're actually making them any better. Picking a harness or a model often just comes down to which one feels better. Skills fall into the same category. You can add some information to a skill feeling like you've made it better, but have you really? You pretty much have no way of truly knowing.
This is a variation of an old problem. We've always tended to (sometimes against our will) make our setup just good enough. Evolutions happened in a mostly reactive way:
- Some big performance bug hit production and affected customers, so we introduced performance testing.
- The release process was slowed down too much by manual testing, so we introduced more E2E tests.
So not evolving our setup until it really hurt us was always a thing in some organizations.
What's new though is the fact that we no longer have a clear idea of how good or bad our setups really are. We used to roughly know that our code was "slow" or "fast" or "buggy". Now we have no idea if Claude is hallucinating more or less compared to last month. Or if it's quicker or slower, less or more expensive, more or less reliable.
When a new model comes out, it's obviously the AI lab's "best model yet", but how good is it really compared to the model we used until now? Even more confusing, how good is it compared to the model the competition has just launched (since these launches have been landing within days of each other lately)? And the cherry on top: how good is it for our actual codebase? Public benchmarks are great, but they don't tell you much about your particular situation.
We're pretty much flying blind, trusting only the marketing hype and our gut feeling. This is not a very good position to be in. I believe that some things will fall into place and normalize as the industry itself matures, but until then we can't just sit and do nothing.
Setups Change Incredibly Quickly
The other problem with setups is that they now change incredibly quickly:
- New models get released all the time and you want to know if they are right for you.
- You may switch harnesses due to cost or contractual reasons.
- Colleagues may edit skill files and they keep bloating, with nothing to actually check their quality.
- Similarly, new skills are added to the codebase all the time.
So What's There To Do?
I think the most important thing is to have some baselines and evaluations that are meaningful (and tailored) to each team's use-cases and setup.
We should be able to answer questions like:
- Which model is objectively better for our needs and by how much?
- Which model offers the best price to performance ratio on our code base?
- If I modify this skill or prompt file, will it actually make the setup better or worse?
Building The Baselines
Now how do we build these baselines? That's part of why I wrote last week's article, since we can take some inspiration from how the actual LLM benchmarks are built.
Question Answering
If your main task is question answering, it's pretty simple. You need to build a golden set of questions that are important for you. For instance something like "what does that subsystem do" and make your agent answer those questions.
Grading the answers is a bit trickier and depends on the type of answers you are expecting. You can use an LLM to grade the answers for you, but then you need to make sure that the LLM is not biased towards its own model family.
What I would recommend is to create a list of general concepts that you expect to find in the answer, like "subsystem X handles rate limiting", "subsystem X sits in front of the application's REST API" and ask the judge to check for the presence of these concepts in the answer. Besides that, you can also look for the presence of certain keywords inside the answer.
If you care about the answer's structure or wording, you can ask a judge to rate it as well. But, if you do that, make sure you use few-shot prompting and provide the LLM judge with a few good quality examples for each grade, alongside the justification for why the answer deserves that grade.
Code Generation
Correctness
For code, the thing you care about most is probably that the code is correct. The most straightforward and reliable way to measure that is to come up with a few tasks to complete and tests for said tasks.
What I would recommend doing is scouring through your old, already completed tasks and looking for the most relevant and challenging ones (you actually need difficult ones since models are pretty good). Once you have that, you can just reset the state of your codebase to the point right before that task was completed, ask the agent to complete it and then use the actual tests you wrote for the task to determine whether it succeeded or not. Of course, you would need to build some sort of hook to block the agent from cheating by looking up the solution via git.
Tasks can be solved in multiple ways, which means that the existing tests may not fit the agent's solution. In these cases, you can do one of two things:
- specify the public interface explicitly in the prompt
- use another LLM to adapt the tests to the specific solution the agent came up with
Code Quality
Code quality is also very important, but it's much harder to evaluate. The first and most challenging step is for your team to agree on what "good quality" code actually means.
Then you can yet again use an LLM as a judge to grade the quality of the code. The same advice applies here: use few-shot prompting and provide the LLM judge with a few good quality examples for each grade, alongside the justification for why the answer deserves that grade.
But before running the LLM judge, there are a few cheap and deterministic tests you could use, like linters and checking that the agent did not edit unrelated files.
What Else To Keep In Mind
While running these evaluations, keep track of the cost per task, how much time each task took and how many tool calls were performed.
With LLMs being probabilistic machines, you need to run each task multiple times to ensure that the results are not just a fluke.
Measure Before You Merge
In closing, I want to ask you this: would you merge a performance fix without measuring it? If you answered "no" (and hopefully you did), then why are you merging skill updates and CLAUDE.md improvements without measuring them?
With the dust just starting to settle on this new age of software development, I think it's time we start approaching things methodically.
There is some time commitment to building your evaluations, I'll give you that. You need to allocate some actual "human thinking" time to writing the tasks, tests and rules. But having evaluations in place is the only way to ensure you're actually going in the right direction. It's also a good way to catch all sorts of context bloat and regressions coming from constantly editing all of your markdown files.