Menu

Post image 1
Post image 2
1 / 2
0

Why My CLI Output Isn't XML (And How I Ended Up Reinventing TOON Without Knowing It)

DEV Community·Fernando Rodriguez·about 1 month ago
#vUX31A98
#llm#cli#rust#state#format#tokens
Reading 0:00
15s threshold

TL;DR : When your primary consumer is an LLM, XML and JSON waste tokens by repeating structure in every element. A compact positional format reduces consumption by 50%. Turns out this idea already had a name: TOON (Token-Oriented Object Notation). Same selective pressure — expensive tokens and repeated keys — same solution. Anthropic uses XML for everything. Their system prompts are wrapped in <instructions> , their examples in <example> , their tools in <function> . If you work with Claude, you live surrounded by tags. So when I asked Claude to design the output for a CLI meant to be consumed by LLMs, the obvious temptation was: XML. If the model gets information in XML, shouldn't the CLI return it in XML? Turns out, no. The problem: compulsive repetition Imagine your CLI lists issues from a project tracker. You have 50 issues.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More