Skip to content

Instantly share code, notes, and snippets.

Claude Code JSON-to-TOON Hook

Automatically converts JSON in your Claude Code prompts to TOON format for 30-60% token savings.

What is TOON?

TOON (Token-Oriented Object Notation) is a compact data format optimized for LLMs. Instead of repeating field names in every object, TOON declares them once and streams values as rows.

Example: