toon-format — Claude Code skill: what it does, how to install
Encodes JSON data into compact TOON syntax to trim prompt tokens by roughly 40%. Helps agents format inputs efficiently for language models.
npx skills add reason-machines/trending-skills --skill toon-format -a claude-codeWhat toon-format does
TOON transforms standard JSON structures into a lighter textual representation. Nested maps use spacing similar to YAML, while arrays of matching records collapse into comma-separated rows under a single header. Repetitive keys disappear. Stripping repetitive field names and bracket syntax lowers token consumption by around 40%.
The skill guides your agent on using the @toon-format/toon package. Run toon encode input.json in the terminal to process files. The --stats flag outputs token savings. In TypeScript, scripts import encode and decode functions directly.
Language models need a brief explanation of TOON conventions in their system instructions. Without that primer, models misread tabular rows.
What it helps with
- shrink token overhead when feeding large JSON datasets into LLM prompts
- serialize uniform object collections into tabular rows with shared headers
- convert JSON files to TOON via CLI using
toon encode - parse TOON strings back to JavaScript objects using
decode
Example prompts for the agent
- Convert users.json into TOON format and print token savings using --stats.
- Serialize this list of recent transactions into TOON notation for the prompt.
- Use encode from @toon-format/toon to structure the customer dataset.
How to install toon-format
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill toon-format -a claude-code2Manually: put the files in place
~/.claude/skills/toon-format/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/toon-format/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill toon-format -a codex2Manually: put the files in place
.agents/skills/toon-format/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill toon-format -a cursor2Manually: put the files in place
.cursor/skills/toon-format/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install reason-machines/trending-skills toon-format2Manually: put the files in place
.github/skills/toon-format/SKILL.md1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill toon-format -a gemini-cli2Platform CLI
gemini skills install https://github.com/reason-machines/trending-skills --path skills/toon-formatManually: put the files in place
.devin/skills/toon-format/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill toon-format -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about toon-format
How do I install the toon-format skill in Claude Code?
Run npx skills add reason-machines/trending-skills --skill toon-format -a claude-code in your terminal.
What does toon-format do?
It teaches coding assistants how to encode JSON data into TOON notation, shrinking prompt size by about 40%.
How can I measure token reduction from the terminal?
Install the package globally with npm install -g @toon-format/toon and execute toon encode input.json --stats.