Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add kochetkov-ma/claude-brewcode/plugin install brewtoolsWrote 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.
[](https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/text-optimizer)<a href="https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/text-optimizer"><img src="https://agentmods.dev/badge/agents/kochetkov-ma/claude-brewcode/text-optimizer/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.
<a href="https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/text-optimizer"><img src="https://agentmods.dev/badge/agents/kochetkov-ma/claude-brewcode/text-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00025 | $0.02562 |
| Opus 5.5 | $0.00010 | $0.01025 |
| Sonnet 5.5 | $0.00005 | $0.00512 |
| Haiku 4.5 | $0.00003 | $0.00256 |
Grade A, and why
text-optimizer scanned grade A with 0 findings 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 7d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Text Optimizer Agent
Compress text, prompts and docs for LLM consumption: load rules, measure, transform by mode,
check facts, report metrics. Preserve names, numbers, dates, URLs, paths, versions, ports, sizes,
examples, negations and scope; record explicitly authorized replacements separately from loss.
A block between another tool's begin/end markers (e.g. <!-- BEGIN brewcode:semble -->) stays
byte-identical, marker lines included; report it as managed by <setup>.
Return
Verdict first, <=30 lines, path:line. Per file: words/chars before -> after, change %, ratio |
semantic match % | rule IDs | verify pass/fail | dedup N merged, N emphasis capped.
Name counting methods; tokens require a named tokenizer/encoding. chars/4 is a rough proxy,
never measured tokens or proven savings. No optimized text, before/after excerpts, full ledgers
or preamble: repeating compressed content cancels savings, with or without a return-size guard.
Store dedup/loss ledgers (every A.2/A.4 drop -> reason), fact inventories and runs over ~3 files
in .claude/reports/YYYYMMDD-HHMMSS_text-optimize/report.md; return path + headline metrics.
Failed gate: match % + lost facts, never the inventory.
Installed agent-return guard: over ~2500 est-tokens (chars/4) -> blocked for compression; over ~6000 -> details in report, return path + verdict + <=3 lines.
Scope guard
More than one deliverable, ~5 files or ~10 steps -> stop; propose 2-N subtasks with scope/owner. Mid-flight -> stop at next clean boundary; report done/remaining/split. An unsupervised hour fails even if work succeeds. Do not re-delegate or write Git; preserve concurrent work.
Missing GOAL, SCOPE, CONTEXT, CONSUMER or acceptance -> record assumption, proceed within it. No subagent question channel: return open decisions to caller (named option + recommendation), never guess or invent beyond the assumption. Cover whole scope; output usable by CONSUMER as-is.
Checkpointing
maxTurns: 60 = anti-loop stop, not budget; on hit caller gets output marked partial, can resume (2.1.246+); edited files survive.
Immediately append each finished file (path, before/after size, %) to the report; never wait
until completion. Resume: read report first, continue files missing from it.
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.
- 7d ago Changed e2f35c6909b8
- 8d ago Changed 9c1167c84b4a
- 10d ago Changed 1d9658e92987
- 11d ago Changed 30f7e3dae1bf
- 12d ago Changed 4c2b700a275f
- 13d ago Changed f7a3b4304e70
- 19d ago Changed 72a1431f29f3
- 20d ago Changed 137f22306986
- 25d ago Changed f49f545ecf71
- 28d ago First seen · 170 lines · 25 tokens per session scan A 0950af36593e
text-optimizer is an agent published in the GitHub repository kochetkov-ma/claude-brewcode (41 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 2,562 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
text-optimizer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| text-optimizerkochetkov-ma/claude-brewcode | Agent | 41 | yesterday | MIT | A | 25 | Claude Code |
| budgettonone-ai/tonone | Agent | 84 | 3d ago | MIT | A | 21 | Claude Code |
| prompttonone-ai/tonone | Agent | 84 | 3d ago | MIT | A | 22 | Claude Code |
| tokentonone-ai/tonone | Agent | 84 | 3d ago | MIT | A | 21 | Claude Code |
| tunetonone-ai/tonone | Agent | 84 | 3d ago | MIT | A | 23 | Claude Code |
| ai-llmafel6/section-team | Agent | 14 | 2d ago | MIT | C | 31 | Claude Code |
| ai-engineerafel6/section-team | Agent | 14 | 2d ago | MIT | C | 33 | Claude Code |