media-transformation — Claude Code skill: shrink JSON prompt tokens
media-transformation rewrites uniform JSON arrays as TOON v2.0, with field names declared once and rows after. Useful when repeated records fill your context.
LicenseRef-Proprietary 126 installs ★ 50 updated 2026-01-05
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a claude-codeWhat media-transformation does
The skill takes structured data and lays it out as TOON v2.0: a single header carries the field names, each record becomes one line. Arrays of five or more similar objects lose 30-60% of their token weight. Event logs, API payloads, query results and metric tables all qualify, since the shape matters more than the labels.
Three layouts cover most input: a tabular block for objects that share fields, an inline list for plain values, an expanded form when they don't. Separators follow the data — comma by default, tab when values contain commas, pipe for a markdown-like look. Nested keys get folded flat (server.host, database.port) for another 25-35%.
The skill also refuses. Short arrays, deeply nested trees and objects with little field overlap stay in JSON, and it names the reason in the output. The fast route shells out to a Zig encoder at .claude/utils/toon/zig-out/bin/toon; on a fresh checkout that binary isn't built, so the manual step-by-step path is what you get. Terms sit in LICENSE.txt.
What it helps with
- compress a user-list API response before it reaches the prompt
- fit a database query result into context without dropping columns
- turn per-route performance metrics into a compact block
- flatten nested config keys into one level
- pick a separator for street addresses containing commas
Example prompts for the agent
- Convert this array to TOON with tab delimiters and folded keys.
- Encode the
/api/usersresponse as TOON if the fields line up. - Decide between JSON and TOON for this payload and show the result.
How to install media-transformation
1Skills CLI (Vercel)
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a claude-code2Manually: put the files in place
~/.claude/skills/media-transformation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/media-transformation/
1Skills CLI (Vercel)
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a codex2Manually: put the files in place
.agents/skills/media-transformation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a cursor2Manually: put the files in place
.cursor/skills/media-transformation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install qodex-ai/ai-agent-skills skills/media-transformation2Manually: put the files in place
.github/skills/media-transformation/SKILL.md1Skills CLI (Vercel)
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a gemini-cli2Platform CLI
gemini skills install https://github.com/qodex-ai/ai-agent-skills --path skills/media-transformationManually: put the files in place
.devin/skills/media-transformation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add qodex-ai/ai-agent-skills --skill media-transformation -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 media-transformation
How do I install media-transformation in Claude Code?
Run npx skills add qodex-ai/ai-agent-skills --skill media-transformation -a claude-code. The skill lands at ~/.claude/skills/media-transformation/SKILL.md.
What does media-transformation do?
It encodes uniform arrays and tables in TOON v2.0, declaring the fields once and writing one row per record. On large regular datasets that trims 30-60% of the tokens.
When does it keep JSON instead?
With short arrays, deep nesting or objects whose fields barely overlap. In those cases it states the reason and passes the data through unchanged.