Structured Context Engineering for File-Native Agentic Systems

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

It suggests teams using file-based agent workflows should stick to familiar formats like YAML, since token-efficient but unfamiliar formats like TOON actually cost more tokens.

Read this as

A new research paper asked AI models to work with very large database schemas, sometimes with 10,000 tables, and measured which ways of writing the data worked best. It ran 9,649 tests across 11 AI models and four file formats, including a compact format called TOON. The surprise: TOON files were 25% smaller, but models unfamiliar with it used up to 740% more tokens overall. Frontier models like Opus 4.5 handled file-based work better than open source models.

A 9,649-experiment study on context formats for AI agents handling large schemas found model choice matters most: frontier models (Opus 4.5, GPT-5.2, Gemini 2.5 Pro) beat open source rivals. It also found the compact TOON format backfired - at 10,000 tables it consumed 740% more tokens than YAML because models couldn't parse it. Teams choosing data formats for agent pipelines should favor familiar formats over token-efficient ones, and open source models still lag at file-based agent loops.

Damon McMillan's paper uses SQL generation as a proxy for agent operations, running 9,649 experiments across 11 models, 4 formats (YAML, Markdown, JSON, TOON) and schemas from 10 to 10,000 tables. Frontier models benefited from filesystem-based context retrieval; open weight models showed far weaker gains, consistent with Terminal Bench 2.0 being dominated by Anthropic, OpenAI and Gemini. The 'grep tax': TOON was ~25% smaller in file size but consumed 138% more tokens than YAML at 500 tables and 740% at 10,000 tables, because models couldn't construct effective refinement patterns for its syntax.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Terminal Bench 2.0 TOON YAML grep tax

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading