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 3d 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 3d 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. 3d ago Changed · +3 lines · +47 tokens per session 989e02018369
  2. 5d ago Changed · -92 lines f937836d0edf
  3. 17d ago Changed · -64 lines 02aff5643be3
  4. 1mo ago Changed · +3 lines 3075834bd420
  5. 1mo 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 (37 stars, last pushed yesterday), 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

Other skills, from other repositories

fresh-start

Continue in a new chat without losing anything — writes a compact handoff to paste into a fresh conversation. Use whenever the user wants to move to a new chat or conversation, hits usage limits, says replies got slow or Claude forgets earlier details, or the conversation has grown long.

egorfedorov/claude-context-optimizer · 60 tokens

token-check

Estimate how many tokens a pasted text, an attached file or the conversation so far takes, what it means for the context window and usage limits, and how to cut it. Use when the user asks how big something is in tokens, why they keep hitting limits, or whether a file is too large to send.

egorfedorov/claude-context-optimizer · 66 tokens

doc-digest

Turn a long document, PDF, transcript, spreadsheet or log into a compact working digest the conversation can continue from. Use when the user shares or pastes something long (several pages or more) and wants to discuss, analyze, compare or use it over more than one message, or asks to summarize a document so they can…

egorfedorov/claude-context-optimizer · 75 tokens

sharpen-prompt

Rewrite a vague request into a precise prompt — goal, context, scope, constraints, what done looks like, output format. Use when the user asks to improve, rewrite, sharpen or check a prompt.

egorfedorov/claude-context-optimizer · 47 tokens

skill-creator-plus

Create, test, evaluate, and improve Claude skills — and answer questions about how skills work. Use for "create a skill", "make a skill for", "write a SKILL.md", "turn this into a skill", "run evals", "test/benchmark my skill", "optimize my skill description", "improve triggering", "A/B test my skill", "blind…

yaniv-golan/skill-creator-plus · 147 tokens

deep-research

Deep Research (/deep-research or /dr) — exhaustive, evidence-based investigation of any topic. Use when the user invokes /deep-research, /dr, asks for deep research, says 'research this thoroughly', wants expert-level analysis on any subject (technical, business, scientific, regulatory, financial, medical, legal…

yachi/claude-skills · 164 tokens