Skip to content
Back to skills

Trimtok Compress

ASecurity

Compress large tool results, files and terminal output with trimtok and pull the raw original back from CCR only when needed. Use before reading big files, after any tool result that looks like hundreds of lines, when the context is filling up, or when the user asks about token savings.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agents

Works with

  • terminal
  • mcp

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add Stxyu-p/trimtok --skill trimtok-compress --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Trimtok Compress?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Trimtok Compress
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stxyu-p-trimtok-compress/badge)](https://www.skillsdirectory.com/skills/stxyu-p-trimtok-compress)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: trimtok-compress
description: >-
  Compress large tool results, files and terminal output with trimtok and pull
  the raw original back from CCR only when needed. Use before reading big files,
  after any tool result that looks like hundreds of lines, when the context is
  filling up, or when the user asks about token savings.
---

# Trimtok compression protocol

trimtok is a deterministic compressor with a lossless escape hatch: it shrinks
text and stores the untouched original in CCR (content-addressed store) under a
`#ref`. Markers in compressed text mean:

| Marker | Meaning |
| --- | --- |
| `[tt:terminal kind=… hidden=N #c2Ab]` | N lines were folded away; raw text is `#c2Ab` |
| `[repeated 1998x]` | 1998 identical lines collapsed |
| `[template ×12]` | 12 lines differed only in numbers/ids |
| `[@#ref] (xN = N lines)` | pointer to a folded block |

## Do this, in this order

1. **Big file, no question yet** → `trimtok_compress_tool(file_path="C:/abs/path", min_chars=0)`.
   The reply is a skeleton (signatures, headings, keys) plus a `#ref`. Then read
   only the line ranges you actually need.
2. **Huge tool/MCP result already in context** →
   `trimtok_compress_tool(result="<paste>", tool_name="grep_search")`. JSON
   becomes a TOON table, grep hits become grouped-by-file, code becomes an AST
   skeleton.
3. **Noisy command you are about to run** → `trimtok wrap -- pytest -q` (or just
   run it: allowlisted commands are compressed by the plugin hook).
4. **Need a specific answer from a `#ref`** →
   `trimtok_exec(hash="#c2Ab", code="import os,json;print(json.load(open(os.environ['TRIMTOK_PAYLOAD'])).keys())")`
   — only stdout returns.
5. **Need the raw lines** → `trimtok_retrieve(hash="#c2Ab", grep="Traceback",
   context_lines=5)`, or `section="errors" | "diff" | "summary" | "tail"`, or
   `intent="<question>"` for ranked lines.

## Rules

- Never compress a payload under 2KB — there is nothing to win.
- Never re-run a command or re-read a file to recover content you already have
  in a `#ref`.
- Never paste `[tt:...]` markers into files or commits; run `trimtok guard-check`
  before finishing a task that involved compression.
- `trimtok_status(action="gain", days=7)` answers "how much did this save?".

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.