This post explains, in plain language, CROCode, the manuscript that came out of my 2026 research internship at Université de Montréal (Chapter 4 of the story). The paper is still in preparation, so I’ll stick to the problem, the idea, and the headline result, and add more once it’s out.
The problem: agents read a lot
When an LLM-based agent tries to fix a bug, it doesn’t jump straight to the patch. It explores: it opens files, searches the repository, reads functions, and runs tests. Each of those steps puts more text into the model’s context, and every token costs money and time.
More context isn’t always better, either. Irrelevant code can distract the model, and long contexts are expensive to process again on every step of an agent loop.
So the question we asked was:
How much of what a repair agent reads does it actually need?
What we looked at
I started by reviewing existing automated program-repair pipelines and how they gather context: what they retrieve, when, and how much of it ends up being used for the final patch. The review showed a gap. Context selection is usually treated as a fixed step, not something to optimize, and its cost is rarely measured next to repair quality.
The idea
CROCode is a context-optimization approach for coding agents, applied here to agentic program repair. It is more selective about what the agent is given, with the aim of making agents frugal: a leaner context that keeps the information the agent needs to locate and fix the bug.
The result
On our evaluation, CROCode keeps repair performance the same while using 14% fewer tokens.
That may not sound dramatic, but agents run many steps per bug and many bugs per evaluation, so the savings add up. It also means that at least some of the context agents consume today is dead weight.
Why it matters
This paper is the first step in my PhD agenda (Chapter 5): treating AI coding agents as engineering tools that can be measured on cost and reliability, not just on whether they solve a benchmark task. Knowing what an agent actually needs to read is a prerequisite for making these tools cheaper, faster, and easier to trust.
I’ll update this post with the preprint, code, and full results when the paper is submitted.