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:
- A lossless record to verify exact tool behaviors.
- A high-level overview to understand the session flow without getting bogged down in details.
- 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:
- 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). - 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.
- View Lowering: The IR is then projected into three complementary views:
- Full View: A lossless, verbatim transcript that defines the master line-number coordinate system.
- 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.
- 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.
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) andtest_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_completionrates across all six model and data split combinations. The largest gain was seen with Haiku ontest_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