pastoon
v0.1.4
Published
Auto-convert clipboard JSON to TOON — 40% fewer LLM tokens
Maintainers
Readme
pastoon
Auto-convert clipboard JSON to TOON — 40% fewer LLM tokens, zero friction.
What it does
Every time you copy JSON, pastoon silently converts it to TOON format before you paste — saving ~40% of tokens in LLM chat UIs, coding agents, and API calls.
JSON (verbose): TOON (40% fewer tokens):
{ users[3]{id,name,role}:
"users": [ 1,Alice,admin
{"id":1,"name":"Alice", 2,Bob,user
"role":"admin"}, 3,Carol,user
...
]
}TOON is lossless — perfect JSON round-trip, same data model, just without the braces, quotes, and repeated keys.
Install
npm install -g pastoon
pastoon setupThat's it. The [P] icon appears in your menu bar. Every JSON you copy is automatically converted.
Supports macOS (LaunchAgent), Linux (systemd user service), and Windows (registry Run key).
Agent install
If you use a coding agent (Claude Code, OpenCode, Cursor, Windsurf), give it SETUP.md:
"Set up pastoon for me using the instructions in docs/SETUP.md"
MCP server
pastoon exposes two MCP tools for agents working with JSON in context:
pastoon mcp add # register with detected coding agents
pastoon --mcp # start MCP server manuallyTools:
json-to-toon— convert JSON string to TOON (use before reasoning over large JSON)toon-to-json— convert TOON string back to JSON
CLI
pastoon # JSON → TOON (clipboard)
pastoon --reverse # TOON → JSON (clipboard)
pastoon --pipe # stdin → stdout (for scripts)
pastoon setup # install background service + start tray
pastoon stop # stop tray
pastoon start # start tray
pastoon uninstall # full removalWhat is TOON?
TOON (Token-Oriented Object Notation) is a compact, human-readable format for JSON data. It achieves:
- ~40% fewer tokens than JSON
- 76.4% LLM accuracy vs JSON's 75.0%
- Perfect lossless round-trip
- Spec-driven with implementations in TypeScript, Python, Go, Rust
License
MIT
