TraceLab: Characterizing Coding Agent Workloads for LLM Serving

Kan Zhu, Mathew Jacob, Chenxi Ma, Yi Pan, Stephanie Wang, Arvind Krishnamurthy, Baris KasikciarXiv 2026

TL;DR

TraceLab introduces the first large-scale, cross-provider workload trace of real-world coding agents (Claude Code and Codex) to understand their unique demands on LLM serving infrastructure. By analyzing over 4,300 developer sessions, the paper reveals that coding agent workloads are characterized by long autonomous loops, massive context reuse, and short outputs—fundamentally shifting the serving bottleneck from token generation to context management.

What Problem Does This Paper Address?

Modern LLM serving systems (like vLLM or TGI) are heavily optimized for traditional workloads like single-turn chat or code completion. However, the rapid rise of autonomous coding agents (e.g., Claude Code, Cursor) introduces a completely different operational paradigm. Agents execute long, multi-step loops, frequently invoking tools (like compilers or file editors) and accumulating massive context histories over time.

To serve these agents efficiently and minimize latency/cost, systems engineers need to understand real-world workload patterns. Unfortunately, existing public traces focus on standard chat, and capability benchmarks (like SWE-bench) evaluate agent accuracy on isolated tasks rather than capturing the continuous, day-to-day system characteristics of persistent developer sessions. This paper bridges the gap by collecting and characterizing real-world coding agent traffic.

Methods

The authors built an end-to-end trace collection and normalization pipeline. Coding agents naturally log their tool calls and conversations locally. The authors collected these raw logs from users, normalized their schemas, and anonymized sensitive information (replacing code snippets and prompts with character counts and token metadata to preserve privacy).

They broke down token usage into three distinct categories for system analysis:

  1. Prefix Tokens ($P$): History tokens retrieved from a prefix cache.
  2. Append Tokens ($A$): Freshly added input tokens from the user or tool outputs.
  3. Output Tokens ($O$): Tokens generated by the LLM (including hidden reasoning tokens).

Using this framework, they analyzed macroscopic session behavior, context growth dynamics, API cost distributions, and tool execution latencies.

Datasets

The paper introduces TraceLab, a dataset containing roughly 4,300 coding-agent sessions collected from 43 developers over eight months.

Table 1: Summary of the collected coding-agent trace. Token counts are in billions (B) and millions (M); the price column is an estimated API list-price equivalent.

The trace spans both Claude Code and Codex across more than 20 model versions, accumulating approximately 350,000 LLM steps and 430,000 tool calls. Unlike static benchmarks, TraceLab captures the real-world temporal dynamics of agent usage, including the "human-thinking" idle gaps between requests.

Key Insights and Ideas

  • The "Inverted" Cost Structure: In standard LLM workloads, token generation (decoding) is the primary cost and latency driver. For coding agents, this intuition is inverted. Because agents repeatedly replay long conversation histories, prefix cache reads dominate the overall cost (~60%), while short outputs make generation relatively cheap.
  • Bimodal Input Distribution: Input lengths follow a strict bimodal pattern. Steps either have a tiny prefix and massive append length (representing initial prefills or cache misses) or a massive prefix and tiny append length (representing incremental tool steps in an ongoing loop).
Figure 1: Per-step prefix tokens vs. append tokens.
  • Human Gaps Kill Caches: While the global prefix cache hit rate is high, the primary cause of expensive cache misses isn't unique data—it's human idle time. When a developer pauses to think, read, or type, the idle gap frequently exceeds the serving system's cache eviction timeout, forcing a costly full prefill on the next turn.
  • Heavy-Tailed Tool Latency: Tool execution times are highly unpredictable. While 70% of tool calls finish in under a second, a tiny fraction (4%) take longer than a minute (e.g., running complex test suites or waiting for user input) but account for 85% of total tool execution time.

Key Results

  • Autonomous Loop Behavior: An average request requires 8.8 LLM steps and 10.8 tool calls to complete, demonstrating that the agentic loop is largely self-driving.
Table 2: Per-session, per-request, and per-step count distribu- tions across the coding-agent trace.
  • Token Length Disparity: The median step reads 116k–126k prefix tokens but appends fewer than 900 tokens and generates only 184–252 output tokens. Frequent tool calls cut the generation short, preventing long sustained decoding phases.
  • Cache Miss Impact: Cache misses cause 3.8× more tokens to be prefilled than truly unique input tokens. Retaining the cache across human thinking gaps could theoretically reduce overall append prefill tokens by 45.9% and cut total API costs by 12.8%.

Limitations and Future Work

The authors note a few key limitations:

  1. User Diversity: The trace is sampled from the day-to-day work of 43 developers within their own research organization, which may not fully reflect enterprise-scale or alternative engineering workflows.
  2. Black-Box Perspective: The analysis relies on externally visible logs and API metadata. It lacks internal provider telemetry regarding hardware utilization, scheduling queues, or exact KV-cache eviction policies.

For future work, the authors highlight several system opportunities, including designing append-length-aware prefill routing, implementing semantic-aware tool-latency prediction to guide cache eviction, and developing proactive cache-prefetching policies to keep session histories alive during human idle gaps.

Summary updated

BibTeX
@misc{zhu2026tracelab,
  author = {Kan Zhu and Mathew Jacob and Chenxi Ma and Yi Pan and Stephanie Wang and Arvind Krishnamurthy and Baris Kasikci},
  title = {{TraceLab: Characterizing Coding Agent Workloads for LLM Serving}},
  year = {2026},
  eprint = {2606.30560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.30560},
}
Figure