Tooner banner
mostafamoq mostafamoq

Tooner

Data community

Description

๐Ÿš€ Claude Code hook that automatically compresses JSON data by up to 60% using Toon format before sending to LLMs. Save tokens, reduce costs, same results.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Tooner - Claude Code Hook

**Reduce LLM token usage by up to 60% with automatic JSON compression**

Tooner is a Claude Code hook that automatically compresses structured JSON data into the efficient [Toon format](https://github.com/toon-format/toon) before sending to LLMs. Uses the official [toon-python library](https://github.com/toon-format/toon-python) for compression. Perfect for working with large datasets, API responses, and tabular data.


**๐Ÿ“š Quick Navigation:** [Installation](#-installation) ยท [Testing](#-testing-with-mcp-server-optional) ยท [How It Works](#-how-it-works) ยท [Development](#-development) ยท [Contributing](#-contributing)


โšก Get Started

**Install the hook:** Follow the [installation steps](#-installation) to automatically compress JSON data in Claude Code.

**Want to test the compression first?** [Use the MCP test server](#-testing-with-mcp-server-optional) with Claude Desktop to explore how Toon compression works.


๐Ÿš€ Quick Overview

**What it does:** Converts verbose JSON arrays into compact Toon format, dramatically reducing tokens.

**Example:**

// Before (100 tokens)
[
  {"id": 1, "name": "Alice", "role": "admin", "status": "active"},
  {"id": 2, "name": "Bob", "role": "user", "status": "active"},
  {"id": 3, "name": "Carol", "role": "admin", "status": "inactive"}
]

// After (55 tokens) - 45% savings!
data[3]{id,name,role,status}:
 1,Alice,admin,active
 2,Bob,user,active
 3,Carol,admin,inactive

๐Ÿ“ฆ Installation

Requirements

  • Python 3.10+ (required for toon-python library)
  • pip (Python package manager)
  • Claude Code CLI

**Note:**

  • The installer automatically handles externally-managed Python environments using pip --user
  • If you have Python < 3.10, the installer will warn you and skip compression (hook still installs but won't compress)

Automatic Installation (Recommended)

Run this one command to install everything:

curl -fsSL https://raw.githubusercontent.com/mostafamoq