text-optimize

text-optimize is a skill for Codex from kochetkov-ma/claude-brewcode. It costs 74 tokens per session (5,990 once invoked), scanned A, original, MIT.

A text and document editor that reduces the number of language-model tokens they use. Tokens are the units an AI model processes.

In plain words
What is it for?
Use it to optimise text or documents, reduce tokens, or perform deeper compression.
Why use it?
It helps shorten or compress text when token usage needs to be reduced.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions subagents; reads ~/.codex paths; mentions AGENTS.md.

Good fit Use it to optimise text or documents, reduce tokens, or perform deeper compression.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kochetkov-ma/claude-brewcode/text-optimize
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.

Any agent
npx skills add kochetkov-ma/claude-brewcode --skill text-optimize
Clone the repo
git clone --depth 1 https://github.com/kochetkov-ma/claude-brewcode

Made for: Codex.

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 text-optimize

README.md
[![agentmods](https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/text-optimize/github.svg)](https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/text-optimize)
Your own site
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/text-optimize"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/text-optimize/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 text-optimize

Your own site · 80×15
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/text-optimize"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/text-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,990 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00074 $0.05990
Opus 5.5 $0.00030 $0.02396
Sonnet 5.5 $0.00015 $0.01198
Haiku 4.5 $0.00007 $0.00599

Measured 1mo ago against content hash 989e02018369, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

text-optimize 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 1mo ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/test-optimize.sh, scripts/text-guard.sh, tests/run.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.codex/plugins/brewtools/skills/text-optimize/SKILL.md · 329 lines

How it starts

The opening of the file, as written. The whole thing — 329 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize text for tokens

Compress the requested text while preserving every load-bearing constraint, identifier, example, and safety rule. Measure before and after size, explain material removals, and write only to the requested Codex-owned artifact path. Do not create Markdown agent definitions or unsupported agent calls.

Complete native workflow

Follow every phase below. When a phase delegates work, use Codex collaboration with only task_name and message; treat each "Codex delegation brief" block as role and message content, not executable syntax. Required approval: main presents a concrete, reviewable proposal in chat and waits for an actual user reply before dependent action. Existing authorization for the same scope remains valid; do not ask again. Optional clarification: use request_user_input_async only if exposed, or request_user_input only if available in the current runtime/mode, for optional choices and never approval. Otherwise ask in main chat. Delegated agents return unresolved questions to main. Silence, elapsed time and tool errors are not approval. Resolve <skill-directory>, <plugin-root>, <project-root>, and <arguments> before running commands.

Text & File Optimizer

Prompt contract

<arguments> is one free-form RU/EN prompt; depth flags and paths may sit anywhere in it. The depth flags are the Modes below.

  1. Mode: an explicit flag (-l, -s, -d, -x, --light, --standard, --deep, --max) wins without scoring; else the most distinct whole-word hits from Modes/Context Hints, ties use the earliest keyword. No hit -> medium before Smart Auto-Detection; empty -> medium or per-file auto-detection. Max is opt-in: explicit -x/--max or maximum/extreme compress hint only.
  2. Scope: take paths from the remaining prose; never treat sentence-first words as positional paths. Invoked implicitly mid-task, the invocation text is the prompt and names the target path(s): empty there stops with "no target", never the ALL set an empty user-typed prompt selects. --allow-dirty in the prompt is the explicit authorization Phase 0 needs for uncommitted targets.
  3. Ask: ambiguity -> ONE scoping main-chat user gate; unanswered or headless -> medium on the named targets only, nothing blocks.

Read the full file on GitHub · 329 lines

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. 1mo ago Changed · +3 lines · +47 tokens per session 989e02018369
  2. 1mo ago Changed · -92 lines f937836d0edf
  3. 2mo ago Changed · -64 lines 02aff5643be3
  4. 2mo ago Changed · +3 lines 3075834bd420
  5. 3mo ago First seen · 479 lines · 27 tokens per session scan A 4e759df922a1

Subscribe to this mod's changes

text-optimize is a skill published in the GitHub repository kochetkov-ma/claude-brewcode (41 stars, last pushed 2d ago), licensed MIT. It adds 74 tokens to every session and 5,990 once invoked, about $0.0003 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.

Related

text-optimize compared with skills from other repositories

text-optimize next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
text-optimizekochetkov-ma/claude-brewcodeSkill412d agoMITA74Codex
doc-digestegorfedorov/claude-context-optimizerSkill139yesterdayMITA75Claude Code
token-checkegorfedorov/claude-context-optimizerSkill139yesterdayMITA66Claude Code
sharpen-promptegorfedorov/claude-context-optimizerSkill139yesterdayMITA47Claude Code
skill-creator-plusyaniv-golan/skill-creator-plusSkill820d agoMITA147Claude Code
cpp-reinforcement-learningAznatkoiny/zAI-SkillsSkill1024d agoMITA131Claude Code
deep-researchyachi/claude-skillsSkill31mo agoMITA164Claude Code