View-oriented Conversation Compiler for Agent Trace Analysis

Lvmin Zhang, Maneesh AgrawalaarXiv 2026 · arXiv

TL;DR

AI agent execution traces are massive, messy JSONL logs that are notoriously difficult for both humans and "reflector" LLMs to analyze efficiently. This paper introduces VCC (View-oriented Conversation Compiler), a tool that treats agent logs like source code, compiling them into a shared intermediate representation to generate three distinct, coordinated views. By maintaining strict line-number pointer consistency across these views, VCC improves agent task success rates while cutting token costs by up to two-thirds.

What Problem Does This Paper Address?

Modern AI coding agents (like Claude Code or Codex) generate incredibly complex trajectories. A single session can produce a JSONL log exceeding 10,000 lines, packed with user prompts, chain-of-thought blocks, system directives, and massive tool inputs/outputs.

Analyzing these traces is crucial for context engineering—such as training an agent's memory or debugging failures. However, effective analysis requires balancing three conflicting needs:

  1. A lossless record to verify exact tool behaviors.
  2. A high-level overview to understand the session flow without getting bogged down in details.
  3. Role-aware retrieval to distinguish between an agent's intention (in a tool call) and its observation (in a tool result).

Existing approaches rely on raw text dumps or basic regex/grep searches, which either overwhelm the analyzer with tokens or strip away critical structural context.

Methods

VCC solves this by treating agent traces as a structured language and processing them through a classic compiler pipeline:

  1. Lexing & Parsing: Raw JSONL logs are tokenized, stripped of non-conversational noise (like progress bars or API errors), and parsed into a typed Intermediate Representation (IR). Nodes in the IR are tagged by semantic roles (e.g., user, assistant, tool_call, thinking).
  2. Line Number Assignment: Before any formatting changes occur, VCC sequentially assigns monotonically increasing line numbers to all IR nodes. This establishes a single, immutable coordinate system.
  3. View Lowering: The IR is then projected into three complementary views:
  4. Full View: A lossless, verbatim transcript that defines the master line-number coordinate system.
  5. UI View: A high-level summary mimicking what a user sees. It collapses massive tool blocks and thinking chains into single-line summaries containing range pointers back to the Full View.
  6. Adaptive View: A filtered view based on a relevance predicate (like a keyword grep or embedding similarity). It extracts only matching blocks but preserves their structural headers and role annotations.

This architecture enables a progressive disclosure workflow: an analyzing agent can scan the compact UI View to understand the trajectory, and then use the line-range pointers to surgically extract verbatim details from the Full View.

Figure 1: The same agent trace rendered under three views. The full view (left) emits every IR node with line numbers. The UI view (center) collapses tool calls to one-line summaries with line-range pointers (purple arrows). The adaptive view (right, grep “dog”) retains only matching blocks with role annotations and range pointers (blue arrows). Highlighted lines show matching content; all pointers resolve to the full view’s line-number coordinate system.

Datasets

The authors evaluated VCC using AppWorld, a robust API interaction benchmark designed for autonomous agents. They utilized:

  • Train split: 90 tasks used for the training/reflection phase.
  • Test splits: test_normal (168 tasks) and test_challenge (416 tasks), spanning three difficulty levels (easy, medium, hard).

Key Insights and Ideas

  • Traces as Code: Shifting the perspective of an LLM trajectory from a "flat text dump" to a "compilable structured document" unlocks standard compiler optimizations and static analysis techniques for prompt engineering.
  • The "SSA" of Prompting: Assigning line numbers before modifying the text layout ensures that pointers from compressed views always resolve perfectly to the exact context in the lossless view. This eliminates the risk of an LLM hallucinating references to a log file.
  • Mitigating "Lost in the Middle": LLMs often struggle to find information buried deep within long contexts. By providing a clean, structured overview (UI View), VCC prevents the reflecting LLM from being overwhelmed by tool output noise, leading to sharper, more accurate rule generation.

Key Results

The authors tested VCC across three model configurations (Claude 3 Opus, Sonnet, and Haiku) in an epoch-based reflection loop, comparing it against directly reading raw JSONL logs:

  • Higher Success Rates: VCC improved aggregate task_goal_completion rates across all six model and data split combinations. The largest gain was seen with Haiku on test_normal, where pass rates jumped by 4.2 percentage points over the raw JSON baseline.
  • Massive Token Savings: Total token consumption for the reflector agent during training plummeted. For Opus, token usage dropped from 22.1M to 7.6M (a ~65% reduction). For Sonnet, it fell from 20.5M to 8.8M.
  • Cleaner Memory Files: Because the reflector agent wasn't distracted by log noise, it generated smaller, more focused memory files (e.g., 12.0K vs 12.6K characters for Opus), indicating fewer redundant or low-quality rules.

Limitations and Future Work

  • Format Specificity: The current frontend lexer and parser are specifically tailored to the Claude Code JSONL format. While the IR and lowering modules are generalizable, supporting other frameworks (like OpenClaw or Codex) requires writing new parsers.
  • Benchmark Diversity: The evaluation was strictly performed on AppWorld.

To prove the generalizability of VCC, the authors note that future work will extend evaluations to other prominent agent benchmarks, including SWE-bench, TAU-bench, WebArena, and AgentBench.

Summary updated

Abstract

We observe that an agent trace is a structured document. A coding agent session contains user turns, assistant text, chain of thought blocks, tool calls, tool results, subagent invocations, compaction boundaries, and harness injected directives, and may exceed ten thousand JSONL lines. Effective trace analysis requires a lossless record, a session level overview, and content retrieval with conversational roles. To this end, we propose VCC, namely View oriented Conversation Compiler, which lexes, parses, and lowers a raw JSONL log into three views based on one intermediate representation. The full view provides the lossless transcript and defines the line number coordinate system. The UI view reconstructs the interaction perceived by the user. The adaptive view selects relevant trace content and preserves role annotations and line range pointers. Line numbers are assigned before view lowering, ensuring that all pointers can be resolved to the full view. We evaluate VCC in a context engineering experiment on AppWorld by varying the input format of the reflector. Experiments with three model configurations and two test splits show that VCC improves aggregate task goal pass rates by 1.1 to 4.2 points, reduces reflector token consumption by one half to two thirds, and generates smaller memory files. These results demonstrate the effectiveness of trace format as an important component of context engineering infrastructure.
BibTeX
@misc{zhang2026view,
  author = {Lvmin Zhang and Maneesh Agrawala},
  title = {{View-oriented Conversation Compiler for Agent Trace Analysis}},
  year = {2026},
  eprint = {2603.29678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.29678},
}
Figure