The Practitioner's LLM Curriculum ← Week 10 · Code Agent Trace Comparator
Interactive · Week 10 · Section 6

Two agents, same task, very different traces.

Both agents are asked to fix the same Python bug. Agent A is well-prompted with clean tool design; Agent B has weak tool docs and no context-management discipline. Both succeed in the end — but A takes 8 steps and $0.12, while B takes 20 steps and $0.55. Click any step to see the agent's reasoning. The visceral lesson: the difference between a code agent that ships in production and one that doesn't isn't model capability, it's tool design and prompt engineering. Same model can produce both traces.

Task Python · pytest SWE-bench-style
Fix the failing test in test_string_utils.py
The function truncate_string(s, n) in string_utils.py should truncate a string to n characters and append '...' only if truncation occurred. The test test_no_truncation_short_string is failing because '...' is being appended even when no truncation happened.
def truncate_string(s, n): return s[:n] + '...' # bug: always appends '...' # Failing test: def test_no_truncation_short_string(): assert truncate_string('hello', 10) == 'hello' # currently returns 'hello...'
Model: Claude Sonnet 4.6 Both agents have the same model, same task What differs: tool design + system prompt
Total steps
8 vs 20
B uses 2.5× more steps
Tokens
30k vs 141k
B uses 4.7× more tokens
Cost
$0.10 vs $0.47
B costs 4.7× more
Wall time
~45s vs ~3m
B takes 4× longer
Outcome
PASS vs PASS*
*after recovery

Side-by-side trace · click any step to expand

Agent A · Efficient
Read · understand · fix · verify · done.
Tight tool design · senior-engineer system prompt · context-managed
Agent B · Wandering
Explore · explore · misfix · recover · finally fix.
Loose tools · weak prompt · accumulating context · same model as A

What separates Agent A from Agent B