
Text Optimizer
Shrink prompts, CLAUDE.md, and agent instruction files with 41 token-efficiency rules so you spend less per session without losing intent.
Overview
Text Optimizer is a journey-wide agent skill that applies 41 token-efficiency rules across 6 categories to prompts, CLAUDE.md, and agent docs—usable whenever a solo builder needs leaner instructions before committing con
Install
npx skills add https://github.com/kochetkov-ma/claude-brewcode --skill text-optimizerWhat is this skill?
- Applies 41 research-backed rules across 6 optimization categories
- Typical savings: 30–50% on prose and 20–30% on technical specs
- Targets prompts, CLAUDE.md, agent instructions, and documentation
- Installed via npx skills add kochetkov-ma/claude-brewcode
- Pairs with brewcode slash-command workflow for repeatable optimization passes
- 41 research-backed rules across 6 categories
- Typical savings: 30–50% on prose, 20–30% on technical specs
Adoption & trust: 2k installs on skills.sh; 27 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your CLAUDE.md and skill files balloon until every agent turn burns tokens on redundant prose and repeated constraints.
Who is it for?
Builders maintaining large agent instruction sets, multi-skill repos, or verbose CLAUDE.md files who want systematic compression rather than one-off editing.
Skip if: Legal or compliance text that must stay verbatim, or specs where every numbered acceptance criterion must remain byte-for-byte unchanged.
When should I use this skill?
You are writing or refactoring prompts, CLAUDE.md, agent instructions, or documentation and want measurable token reduction.
What do I get? / Deliverables
You get shorter, clearer instruction artifacts with measured savings targets, ready to commit without stripping safety-critical gates.
- Revised lower-token instruction or documentation text
- Rule-category mapping showing what was removed or condensed
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
After drafting a lean PRD for an agent, run optimization so the spec fits alongside codebase context in one session.
Refactor a 400-line CLAUDE.md into tiered must-follow vs nice-to-have blocks using the six rule categories.
Trim internal API docs that are also pasted into codegen prompts for twenty to thirty percent technical spec savings.
Before release, compress runbook prose agents rely on during incident triage without deleting escalation steps.
Shorten help-center articles you syndicate into support agents to lower per-ticket inference cost.
How it compares
Skill-side tokenizer-aware editing rules—not a hosted prompt compressor SaaS or embedding cache product.
Common Questions / FAQ
Who is text-optimizer for?
Solo developers using Claude Code, Cursor, or similar agents who author CLAUDE.md, skills, and long prompts and want structured token cuts.
When should I use text-optimizer?
While building agent-tooling before a big feature push; when validating doc debt in a new repo; at ship review of runbooks; and anytime launch or grow content doubles as agent context.
Is text-optimizer safe to install?
It edits text locally through your agent workflow; confirm brewcode package provenance and read the Security Audits panel on this Prism page.
SKILL.md
READMESKILL.md - Text Optimizer
MIT License Copyright (c) 2025-2026 Maxim Kochetkov (kochetkov-ma) https://github.com/kochetkov-ma/claude-brewcode Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Text Optimizer Optimize prompts, CLAUDE.md, agent instructions, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories. Typical savings: **30-50%** on prose, **20-30%** on technical specs. ## Quick Start 1. Install: ```bash npx skills add kochetkov-ma/claude-brewcode ``` 2. Use via slash command: ``` /text-optimizer my-prompt.md /text-optimizer my-prompt.md -d # deep — max compression /text-optimizer my-prompt.md -l # light — cleanup only /text-optimizer .claude/agents/ # directory — all .md files in parallel ``` Or via natural language prompt: ``` Optimize my-prompt.md for token efficiency Optimize all agent instructions in .claude/agents/ ``` Claude reads 41 rules, analyzes your files, applies transformations, and outputs a before/after report with token counts. For directories — finds all `.md` files and processes them in parallel. ## Why Use This - **Token savings** — 30-50% fewer tokens in system prompts means lower cost and more room for context - **Better compliance** — rules based on how Claude 4.x actually processes instructions, not intuition - **Research-backed** — every rule cites a source (Anthropic docs, arXiv papers, TACL 2024) - **Non-destructive** — preserves all facts, logic, and cross-references; only changes form - **Three modes** — light cleanup for stable docs, deep compression for cost-critical prompts ## Examples ### Single file — default medium mode ``` /text-optimizer CLAUDE.md ``` Applies all 41 rules with balanced restructuring. Best for most files. <details> <summary>Optimization: filler removal + positive framing</summary> Before: ```markdown Please note that it's important to remember that the API basically requires authentication for all endpoints. Do not use markdown formatting in your responses. You should never create new files when fixing bugs. ``` After: ```markdown The API requires authentication for all endpoints. Write responses in flowing prose without formatting. Apply all bug fixes to existing files only. ``` Rules: filler removed (T.6), negative "do not" flipped to positive "do Y" (C.3), "you should" dropped for imperative (S.2). </details> <details> <summary>Optimization: prose to table</summary> Before: ```markdown The function accepts three parameters: name (string, required), age (number, optional, defaults to 0), and active (boolean, optional, defaults to true). ``` After: ```markdown | Param | Type | Required | Default | |--------|---------|----------|---------| | name | string | yes | — | | age | number | no | 0 | | active | boolean | no | true | ``` Rule: tables over prose for multi-column data (T.1). </details> ### Deep mode — max compression ``` /text-optimizer system-prompt.md -d ``` Ag