json-to-toon

json-to-toon is a skill for Claude Code, Codex from soulcodex/agentic. It costs 88 tokens per session (1,377 once invoked), scanned A, original, MIT.

A converter from JSON, a common data format, to TOON, a shorter text format designed for language-model prompts.

In plain words
What is it for?
Use it to convert arrays and nested objects into compact inline, table-like, or list formats according to the TOON specification.
Why use it?
It reduces repeated text in structured data, leaving more room in a model’s context window for useful information.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions OpenCode.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/soulcodex/agentic/json-to-toon
Any agent
npx skills add soulcodex/agentic --skill json-to-toon
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for json-to-toon

README.md
[![agentmods](https://agentmods.dev/badge/skills/soulcodex/agentic/json-to-toon.svg)](https://agentmods.dev/skills/soulcodex/agentic/json-to-toon)
Your own site
<a href="https://agentmods.dev/skills/soulcodex/agentic/json-to-toon"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/json-to-toon.svg" alt="Measured on agentmods" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,377 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01377
Opus 5 $0.00044 $0.00688
Sonnet 5 $0.00018 $0.00275
Haiku 4.5 $0.00009 $0.00138

Measured 6d ago against content hash 59ac49be61b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

json-to-toon scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/data/json-to-toon/SKILL.md · 159 lines

How it starts

The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JSON to TOON Transformation Skill

Convert JSON input into TOON (Token-Oriented Object Notation) to achieve 30–70% token reduction, making it ideal for use in LLM prompts, RAG pipelines, and any context-window-sensitive application.


Step 1 — Load the Specification

Read toon-spec-reference.md (in this skill's directory). It contains the complete encoding rules you must apply throughout this skill.


Step 2 — Assess the Input

Inspect the JSON the user has provided:

  1. Identify the root type: is it an object, array of uniform objects, array of mixed objects, or a primitive array?
  2. Scan for high-repetition patterns: arrays of objects with identical keys are prime candidates for tabular format (biggest token savings).
  3. Flag any values that require quoting: strings containing ,, :, [, {, - at start, leading/trailing spaces, or values that look like booleans/numbers/null.
  4. Note depth: deeply nested structures may benefit most from TOON's indentation-based nesting (no closing braces).

Output a brief one-line assessment: e.g. "Root object with 3 tabular arrays and 2 nested objects — expect ~55% token reduction."


Step 3 — Choose Array Format for Each Array

For every array in the input, apply this decision tree:

Is every element a primitive (string, number, boolean, null)?
  YES → Inline format:  key[N]: v1,v2,v3

Are ALL elements objects AND do they share identical top-level keys AND
are all their values primitives (no nested objects or arrays)?
  YES → Tabular format: key[N]{f1,f2,f3}:
                          v1,v2,v3
                          v4,v5,v6

Otherwise (different keys, nested values, mixed types)
       → List format:   key[N]:
                          - field: value
                            field2: value2

Use the field order of the first object for all tabular rows. Never re-order fields.


Step 4 — Encode the Full Structure

Walk the JSON top-down and apply the rules from toon-spec-reference.md:

Read the full file on GitHub · 159 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 159 lines · 88 tokens per session scan A 59ac49be61b2

Subscribe to this mod's changes

json-to-toon is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed yesterday), licensed MIT. It adds 88 tokens to every session and 1,377 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.