Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
kochetkov-ma avatar

Text Optimizer

  • 2.1k installs
  • 29 repo stars
  • Updated August 2, 2026
  • kochetkov-ma/claude-brewcode

text-optimizer is an agent skill that Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categorie.

About

Plugin kochetkov ma claude brewcode https github com kochetkov ma claude brewcode Reduces token count in prompts docs and agent instructions by 20 40 without losing meaning Applies 41 research backed rules across 6 categories Claude behavior token efficiency structure reference integrity perception LLM comprehension Benefits cheaper API calls faster model responses clearer LLM instructions fewer hallucinations Examples bash text optimize prompt md single file medium mode default text optimize d agents deep mode all md files in directory The text optimizer skill documents workflows prerequisites and usage patterns grounded in its repository SKILL md Agents should follow the documented steps respect safety and permission notes and cite only capabilities described in the source It triggers on phrases matching the skill description and integrates with the agent toolchain for the tasks outlined in the documentation

  • description: "Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules acro
  • allowed-tools: Read Write Edit Grep Glob
  • > Plugin: [kochetkov-ma/claude-brewcode](https://github.com/kochetkov-ma/claude-brewcode)
  • See SKILL.md for text-optimizer operational details.
  • See SKILL.md for text-optimizer operational details.

Text Optimizer by the numbers

  • 2,066 all-time installs (skills.sh)
  • +10 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #582 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

text-optimizer capabilities & compatibility

Capabilities
description: "optimizes text, prompts, and docum · allowed tools: read write edit grep glob · > plugin: [kochetkov ma/claude brewcode](https:/ · see skill.md for text optimizer operational deta
Use cases
orchestration
From the docs

What text-optimizer says it does

description: "Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference integri
SKILL.md
allowed-tools: Read Write Edit Grep Glob
SKILL.md
> Plugin: [kochetkov-ma/claude-brewcode](https://github.com/kochetkov-ma/claude-brewcode)
SKILL.md
npx skills add https://github.com/kochetkov-ma/claude-brewcode --skill text-optimizer

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.1k
repo stars29
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositorykochetkov-ma/claude-brewcode

What does text-optimizer help with and when should an agent load it?

Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference integrity, perception

Who is it for?

Developers using text-optimizer as documented in the skill repository.

Skip if: Skip when the task falls outside the text-optimizer documented scope.

When should I use this skill?

Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference integrity, perception

What you get

Agent actions aligned with the text-optimizer SKILL.md workflow and documented deliverables.

  • Compressed markdown files
  • Before-and-after token metrics

By the numbers

  • Applies 41 research-backed optimization rules
  • Covers 6 rule categories for Claude and LLM instruction files
  • Targets 20–40% token reduction in prompts and documentation

Files

SKILL.mdMarkdownGitHub ↗
Plugin: kochetkov-ma/claude-brewcode

Text Optimizer

Reduces token count in prompts, docs, and agent instructions by 20–40% without losing meaning. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference integrity, perception, LLM comprehension.

Benefits: cheaper API calls · faster model responses · clearer LLM instructions · fewer hallucinations

Examples:

/text-optimize prompt.md          # single file, medium mode (default)
/text-optimize -d agents/         # deep mode — all .md files in directory
_Skill text is written for LLM consumption and optimized for token efficiency._

---

Text & File Optimizer

Step 0: Load Rules

REQUIRED: Read references/rules-review.md before ANY optimization.
If file not found -> ERROR + STOP. Do not proceed without rules reference.

Modes

Parse $ARGUMENTS: -l/--light | -d/--deep | no flag -> medium (default).

ModeFlagScope
Light-l, --lightText cleanup only — structure, lists, flow untouched
Medium_(default)_Balanced restructuring — all standard transformations
Deep-d, --deepMax density — rephrase, merge, compress aggressively

Rule ID Quick Reference

CategoryRule IDsScope
Claude behaviorC.1-C.6Literal following, avoid "think", positive framing, match style, descriptive instructions, overengineering
Token efficiencyT.1-T.8Tables, bullets, one-liners, inline code, abbreviations, filler, comma lists, arrows
StructureS.1-S.8XML tags, imperative, single source, context/motivation, blockquotes, progressive disclosure, consistent terminology, ref depth
Reference integrityR.1-R.3Verify file paths, check URLs, linearize circular refs
PerceptionP.1-P.6Examples near rules, hierarchy, bold keywords, standard symbols, instruction order, default over options

ID-to-Rule Mapping

IDRuleIDRule
C.1Literal instruction followingC.2Avoid "think" word
C.3Positive framing (do Y not don't X)C.4Match prompt style to output
C.5Descriptive over emphatic instructionsC.6Overengineering prevention
T.1Tables over prose (multi-column)T.2Bullets over numbered (~5-10%)
T.3One-liners for rulesT.4Inline code over blocks
T.5Standard abbreviations (tables only)T.6Remove filler words
T.7Comma-separated inline listsT.8Arrows for flow notation
S.1XML tags for sectionsS.2Imperative form
S.3Single source of truthS.4Add context/motivation
S.5Blockquotes for criticalS.6Progressive disclosure
R.1Verify file pathsR.2Check URLs
R.3Linearize circular refsP.1Examples near rules
P.2Hierarchy via headers (max 3-4)P.3Bold for keywords (max 2-3/100 lines)
P.4Standard symbols (→ + / ✅❌⚠️)
S.7Consistent terminologyS.8One-level reference depth
P.5Instruction order (anchoring)P.6Default over options

Mode-to-Rules Mapping

ModeAppliesNotes
LightC.1-C.6, T.6, R.1-R.3, P.1-P.4Text cleanup only — no restructuring
MediumAll rules (C + T + S + R + P)Balanced transformations
DeepAll rules + aggressive rephrasingMerge sections, max compression

Usage

InputAction
No argsPrompt user for file or folder path
Single pathProcess file directly
path1, path2Process files sequentially
-l file.mdLight mode — text cleanup only
-d file.mdDeep mode — max compression
folder/All .md files in directory

File Processing

Input Parsing

InputAction
No argsPrompt user for file or folder path
Single pathProcess directly
path1, path2Process files sequentially

Execution Flow

1. Read references/rules-review.md — load all optimization rules 2. Read target file(s) 3. Analyze: identify type (prompt, docs, agent, skill), note critical info and cross-references 4. Apply rules by mode (see Mode-to-Rules Mapping) 5. Edit file with optimized content 6. Generate optimization report

Quality Checklist

Before

  • [ ] Read entire text
  • [ ] Identify type (prompt, docs, agent, skill)
  • [ ] Note critical info and cross-references

During — Apply by Mode

CheckLightMedDeep
C.1-C.6 (Claude behavior)YesYesYes
T.6 (filler removal)YesYesYes
T.1-T.5, T.7-T.8 (token compression)-YesYes
S.1-S.8 (structure/clarity)-YesYes
R.1-R.3 (reference integrity)YesYesYes
P.1-P.4 (LLM perception)YesYesYes
Aggressive rephrasing--Yes
No information lossYesYesYes

After

  • [ ] All facts preserved
  • [ ] Logic consistent
  • [ ] References valid (R.1-R.3)
  • [ ] Tokens reduced

Output Format

## Optimization Report: [filename]

| Metric | Before | After | Change |
|--------|--------|-------|--------|
| Lines  | X      | Y     | -Z%    |
| Tokens | ~X     | ~Y    | -Z%    |

### Rules Applied
- [Rule IDs]: [Description of changes]

### Issues Found & Fixed
- [Issue]: [Resolution]

### Cross-Reference Verification
- [x] All file refs valid (R.1)
- [x] All URLs checked (R.2)
- [x] No circular refs (R.3)

---

**Full development platform:** [brewcode](https://github.com/kochetkov-ma/claude-brewcode) — infinite focus tasks, 16 agents, quorum reviews, knowledge persistence.
Install: `claude plugin marketplace add https://github.com/kochetkov-ma/claude-brewcode && claude plugin install brewcode@claude-brewcode`

Anti-Patterns

AvoidWhy
Remove all examplesHurts generalization (P.1)
Over-abbreviateReduces readability (T.5 caveat)
Generic compressionDomain terms matter
Over-aggressive languageOpus 4.5 overtriggers (C.5)
Flatten hierarchyLoses structure (P.2)
"Don't do X" framingLess effective than "Do Y" (C.3)
Overengineer promptsOpus 4.5 follows literally (C.6)
Overload single promptsDivided attention, hallucinations (S.3)
Over-focus on wordingStructure > word choice (T.1)

Related skills

How it compares

Pick text-optimizer over manual editing when CLAUDE.md or SKILL.md files need measured 20–40% compression with 41 validated rules instead of ad-hoc trimming.

FAQ

What is text-optimizer?

Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference i

When should I use text-optimizer?

Optimizes text, prompts, and documentation for LLM token efficiency. Applies 41 research-backed rules across 6 categories: Claude behavior, token efficiency, structure, reference i

Is text-optimizer safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.