Inside the Scaffold: A Source-Code Taxonomy of Coding Agent Architectures
This paper introduces a source-code-level architectural taxonomy for LLM-based coding agents, derived from analyzing 13 open-source scaffolds across 12 dimensions, to reveal how composable control primitives and divergent design choices in context and state management shape agent behavior beyond abstract capability classifications.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a brilliant, hyper-intelligent apprentice (the AI Model) who can write code, fix bugs, and solve problems. But this apprentice has a catch: they are incredibly naive. They don't know where the files are, they can't run tests on their own, and if they make a mistake, they might just keep making the same mistake forever.
To make this apprentice useful, you have to build a Scaffold around them. Think of the scaffold as the foreman, the toolbox, the safety harness, and the project manager all rolled into one. It's the code that tells the AI what tools to use, how to check its work, and when to stop.
This paper is a massive "architectural tour" of 13 different construction sites (13 different open-source coding agents). Instead of just saying "this agent is smart" or "that agent is fast," the author, Benjamin Rombaut, went into the source code to see exactly how these scaffolds are built.
Here is the breakdown of what he found, using some everyday analogies:
1. The Three Layers of the Scaffold
The author organized the complex code into three main layers, like the floors of a skyscraper:
Floor 1: The Control Architecture (The Brain's Strategy)
- What it is: How the agent decides what to do next.
- The Analogy: Imagine a chef.
- Some agents are like a Factory Assembly Line: They follow a strict, pre-written recipe (Step 1: Find bug, Step 2: Fix it, Step 3: Done). They don't think; they just execute.
- Some are like a Detective: They ask a question, look at the answer, ask another question, and keep going until they solve the case (this is called a "ReAct" loop).
- The most advanced ones are like Gamblers playing Chess: They simulate thousands of possible futures (Monte Carlo Tree Search) to see which move leads to a win before actually making it.
- The Finding: There isn't just one "best" way. Some agents mix these strategies, like a detective who also plays chess.
Floor 2: The Tool & Environment Interface (The Toolbox)
- What it is: What tools the AI is allowed to touch.
- The Analogy: Giving the apprentice a hammer vs. a Swiss Army Knife.
- Some agents give the AI zero tools and just let the user do the heavy lifting (like Aider, where the human says "open this file," and the AI just edits it).
- Others give the AI 37 different tools (search, edit, run tests, browse the web, check security).
- The Twist: Even though the number of tools varies wildly, they all do the same four basic things: Read, Search, Edit, and Execute. It's like having a toolbox with 37 different screwdrivers vs. just one multi-bit screwdriver; the job is the same, but the complexity of the box is different.
Floor 3: Resource Management (The Memory & Budget)
- What it is: How the agent handles its memory and costs.
- The Analogy: The AI has a short-term memory (a sticky note) and a limited budget.
- Memory: Some agents just keep adding notes to the sticky note until it falls off the wall (crashing). Others have a "Summarizer" who reads the notes and writes a short summary to keep the note clean. Some even have a "Time Travel" feature (Event Sourcing) that lets them rewind and replay exactly what happened.
- Budget: Some agents use a "Guardian" (a second, cheaper AI) to check if the main AI is about to do something dangerous or expensive before letting it happen.
2. The Big Surprises (What the Paper Actually Discovered)
Surprise #1: It's a Spectrum, Not a List
Previous studies tried to put agents into boxes like "Tool-User" or "Planner." This paper says that's like trying to sort cars by "Fast" or "Slow."
- The Reality: Agents exist on a continuous spectrum. One agent might be 10% "Assembly Line" and 90% "Detective." Another might be 50/50. You can't just label them; you have to measure where they sit on the line.
Surprise #2: The "Loop Primitives" are Lego Bricks
The author found that agents aren't built from scratch every time. They are built by stacking 5 basic Lego bricks:
- ReAct: Think, Act, Observe.
- Generate-Test-Repair: Write code, run test, fix if broken.
- Plan-Execute: Make a plan, do it.
- Retry: Try again if it fails.
- Tree Search: Try many paths at once.
- The Finding: 11 out of 13 agents stack multiple bricks together. A "Detective" agent might also have a "Repair" brick attached to it. This makes them much more powerful than a single-brick agent.
Surprise #3: The "Who's Driving?" Question
This is the most critical design choice.
- User-Driven: The human points the way (e.g., "Go to this file"). The AI just does the work. This is safer but slower.
- AI-Driven: The AI decides where to go. This is powerful but risky (the AI might get lost).
- The Insight: If you give the AI full control, you must build a better "Search Engine" (Context Retrieval) for it. If the AI can't find the right file, it can't fix the bug.
3. Why Does This Matter?
For Researchers:
Right now, we compare agents by who wins a race (SWE-bench). But that's unfair because one runner might have a better shoe (Model) and the other a better coach (Scaffold). This paper gives us a ruler to measure the shoes and the coaches separately. Now we can say, "Agent A failed not because the AI is dumb, but because its memory management was bad."
For Builders (Developers):
If you want to build your own coding agent, you don't have to guess. You can look at this "menu" of 12 dimensions.
- Do you want speed? Maybe skip the "Tree Search" and use a "Pipeline."
- Do you want safety? Maybe add a "Guardian" AI.
- Do you have a huge codebase? You need a specific "Context Compaction" strategy so the AI doesn't forget the beginning of the conversation.
The Bottom Line
This paper is the first detailed map of the "under-the-hood" mechanics of AI coding agents. It stops us from treating these complex systems as magic black boxes and starts treating them as engineering projects with specific, measurable parts. It tells us that the future of coding agents isn't just about making the AI smarter; it's about building better scaffolds to help the AI do its best work.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.