llm-fmt - Token optimization for structured data

VerifiedSafe

Converts JSON, YAML, XML, and CSV data into token-efficient formats like TSV, TOON, and YAML, reducing token usage by 30-70% for LLM inputs. Supports filtering by paths, limiting nesting depth, and truncating arrays to fit context windows. Useful for minimizing token consumption when feeding structured data to language models.

Sby Skills Guide Bot
Data & AIBeginner
806/2/2026
Claude CodeCursorWindsurfCopilotCodex
#structured-data#token-efficient#json#yaml#csv

Recommended for

Our review

Converts structured data files (JSON, YAML, CSV) into token-efficient formats to reduce token usage in LLM contexts.

Strengths

  • Reduces tokens by 30-70% on structured data
  • Supports multiple input formats (JSON, YAML, XML, CSV)
  • Offers filtering, truncation, and format selection options

Limitations

  • May lose some nested structure details if truncation is too aggressive
  • Best for tabular or uniform data sets
  • Not suitable if full data fidelity is required without any loss
When to use it

When feeding large structured data into an LLM and aiming to minimize token costs.

When not to use it

If you need to preserve the complete original data structure with no information loss.

Security analysis

Safe
Quality score90/100

The skill is a data formatting utility that converts structured formats (JSON/YAML/XML/CSV) into token-efficient representations. It does not execute any destructive operations, exfiltrate data, or disable safety features. All actions are legitimate transformations, and no risky patterns like curl-pipe-shell or unexpected system modifications are present.

No concerns found

Examples

Basic conversion to TOON
Convert this JSON file to TOON format to save tokens: llm-fmt data.json
CSV to TSV for maximum savings
I have a large CSV file, convert it to TSV format for token efficiency: llm-fmt data.csv -f tsv
Analyze best format
Analyze the best format for my JSON data: llm-fmt data.json --analyze

name: llm-fmt description: Convert JSON/YAML/XML/CSV to token-efficient formats (30-70% savings) allowed-tools: Bash

llm-fmt

Reduces tokens by 30-70% for structured data in LLM contexts.

Usage

llm-fmt data.json                    # TOON output (default)
llm-fmt data.json -f tsv             # TSV (best for tables, 60-75% savings)
llm-fmt data.json -f yaml            # YAML (nested configs, 25-35%)
llm-fmt data.json --analyze          # Compare all formats

Filtering & Truncation

llm-fmt data.json -i "users[*].name"           # Extract paths
llm-fmt data.json --max-depth 3                # Limit nesting
llm-fmt data.json --max-items 50               # Limit arrays
llm-fmt data.json --max-string-length 200      # Limit strings
llm-fmt data.json --truncation-strategy tail   # head|tail|balanced|sample

Format Guide

| Data | Format | Savings | |------|--------|---------| | Tables, uniform arrays | tsv | 60-75% | | Object arrays (API/logs) | toon | 45-60% | | Nested configs | yaml | 25-35% | | Mixed/complex | json | 10-15% |

Pipes

curl -s api.example.com/data | llm-fmt -f tsv
cat large.json | llm-fmt --max-items 100
Related skills