/latent-gate:token-optimizerfrom latent-gate
Reads large files (logs, JSON, CSV, long docs) through a local token optimizer that compresses content losslessly or aggressively, preserving facts while reducing token count. Use instead of raw reads for files over ~2,000 tokens.
Ships in latent-gate. 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.
The latent-gate MCP server returns a compact version of text with the
facts intact. It runs locally in ~1ms per file, needs no Ollama or API key,
and gives the same output for the same input.
Call read_file_optimized instead of reading the file directly when it is
large and you only need its content:
id=5001…5398). Often 90%+ smaller.question and level: "aggressive" or a
max_tokens budget to keep only the sentences relevant to what you need.Code blocks, URLs and quoted strings are always returned byte-for-byte.
The optimized text is not byte-identical to the file (JSON is minified, runs are folded). Read files you intend to modify with the normal file-reading tool, so your edits match the real content.
| level | what it does | facts kept |
|---|---|---|
lossless | whitespace, JSON minify, exact-duplicate folding | all |
balanced (default) | + log-run folding, filler removal | all except folded log values (ranges kept) |
aggressive | + keeps the most relevant sentences (~50%) | most; the actual request is never dropped |
optimize_text does the same for text you already have, and count_tokens
measures size. Report the savings (original_tokens → optimized_tokens)
when it helps the user see what was saved.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kathanmodh259/latent-gate --plugin latent-gateOther plugins' skills for the same job