/major-ai-skills:json-minified-payloadsfrom major-ai-skills
Serialize JSON without optional formatting whitespace for compact transport or model input.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When LLMs generate or ingest structured JSON objects (e.g., function calling tool parameters, API response payloads, configuration maps), standard libraries default to pretty-printed formatting with 2-to-4 space indentation and line breaks on every key-value pair.
In multi-line JSON structures, indentation whitespace and newline characters account for 30% to 50% of the entire token payload. For a 500-record data extraction run, pretty-printing wastes over 25,000 output tokens on decorative formatting.
The JSON Minification Protocol strips all unnecessary whitespace and newlines from structured data streams, formatting payloads as dense single-line strings ({"a":1,"b":2}) with zero loss of semantic fidelity.
┌─────────────────────────────────────────────────────────────┐
│ JSON Token Density Mapping │
│ │
│ Pretty-Printed JSON (95 Tokens for 2 Records): │
│ { │
│ "status": "success", │
│ "data": [ │
│ { │
│ "id": 101, │
│ "name": "Alice" │
│ }, │
│ { │
│ "id": 102, │
│ "name": "Bob" │
│ } │
│ ] │
│ } │
│ ↳ 42 whitespace & newline tokens (44% pure token waste) │
│ │
│ Minified Compact JSON (32 Tokens - 66.3% Reduction!): │
│ {"status":"success","data":[{"id":101,"name":"Alice"},{"id":102,"name":"Bob"}]}│
│ ↳ 32 clean tokens, 100% valid JSON.parse() compatibility │
└─────────────────────────────────────────────────────────────┘
Always specify compact separators=(',', ':') when serializing JSON for LLM prompts or tool calls:
import json
from typing import Any
def serialize_minified_json(payload: Any) -> str:
"""Serializes data into ultra-dense JSON with zero unnecessary whitespace."""
return json.dumps(payload, separators=(',', ':'), ensure_ascii=False)
export function serializeMinified(data: unknown): string {
// JSON.stringify without 3rd indentation argument produces compact single-line JSON
return JSON.stringify(data);
}
import (
"bytes"
"encoding/json"
)
func MinifyJSON(jsonBytes []byte) ([]byte, error) {
buffer := new(bytes.Buffer)
err := json.Compact(buffer, jsonBytes)
return buffer.Bytes(), err
}
When configuring agent function calling schemas (OpenAI / Anthropic tools), instruct the model to emit compact arguments:
### Tool Call Invocation Directive:
- When calling functions, serialize arguments as single-line compact JSON.
- Never insert multi-line indentation inside function calling JSON parameters.
Serializing 200 telemetry records for agent context ingestion:
| JSON Serialization Mode | Output Tokens | Turn Latency | Cost (Sonnet / GPT-4o) |
|---|---|---|---|
| Pretty-Printed (4 Spaces) | 14,800 tokens | 16.5 seconds | $0.222 |
| Pretty-Printed (2 Spaces) | 10,900 tokens | 12.2 seconds | $0.163 |
| Minified Compact JSON | 5,800 tokens | 6.1 seconds | $0.087 (60.8% Savings!) |
MANDATORY: Agent tool executors and prompt builders must serialize structured payloads using minified JSON (
separators=(',', ':')). Never pretty-print multi-line JSON into prompt context unless the user specifically requests a human-readable display.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.