tto-compress

tto-compress is a command for Claude Code from kittimasak/thai-token-optimizer. It costs 0 tokens per session (216 once invoked), scanned C, original, MIT.

A prompt compressor for Thai Token Optimizer, a tool that shortens AI coding-agent instructions while checking that important meaning is preserved. It supports automatic compression levels, targets such as Claude, token budgets, and diagnostic checks.

In plain words
What is it for?
Use it to compress a prompt file, set a token budget, run preservation checks, or compare speculative and non-speculative compression.
Why use it?
It reduces prompt size while providing checks against losing important commands, code details, or technical requirements.

Command for Claude Code

Written for Claude Code: a Claude Code plugin manifest.

Part of the thai-token-optimizer plugin — 1 skill, 15 commands shipped together

Good fit Use it to compress a prompt file, set a token budget, run preservation checks, or compare speculative and non-speculative compression.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kittimasak/thai-token-optimizer/tto-compress
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kittimasak/thai-token-optimizer

Made for: Claude Code.

Or install thai-token-optimizer, the plugin that ships this one along with the rest of its 1 skill, 15 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tto-compress

README.md
[![agentmods](https://agentmods.dev/badge/commands/kittimasak/thai-token-optimizer/tto-compress/github.svg)](https://agentmods.dev/commands/kittimasak/thai-token-optimizer/tto-compress)
Your own site
<a href="https://agentmods.dev/commands/kittimasak/thai-token-optimizer/tto-compress"><img src="https://agentmods.dev/badge/commands/kittimasak/thai-token-optimizer/tto-compress/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tto-compress

Your own site · 80×15
<a href="https://agentmods.dev/commands/kittimasak/thai-token-optimizer/tto-compress"><img src="https://agentmods.dev/badge/commands/kittimasak/thai-token-optimizer/tto-compress.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 216 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00216
Opus 5 $0.00000 $0.00108
Sonnet 5 $0.00000 $0.00043
Haiku 4.5 $0.00000 $0.00022

Measured 9d ago against content hash 29a1ceea6072, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

tto-compress scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- ============================================================================ Thai Token Optimizer v2.0 ============================================================================ Description : A Thai token optimiza
Origin

Copies of this mod

5 near-identical copies found in the catalogue:

.claude-plugin/commands/tto-compress.md · 31 lines

What it actually says

/tto-compress

Compress prompt text with preservation checks.

tto compress --pretty --level auto --target claude --budget 500 --check prompt.txt
tto compress --speculative --diagnostics --check --target claude prompt.txt
tto compress --no-speculative --check --target claude prompt.txt

Speculative precedence: --no-speculative > --speculative > state.speculative.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 31 lines · 0 tokens per session scan C 29a1ceea6072

Subscribe to this mod's changes

tto-compress is a command published in the GitHub repository kittimasak/thai-token-optimizer (47 stars, last pushed 17d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 216 tokens. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.