prompt-optimizer

prompt-optimizer is a skill for Claude Code, Codex from lyupro/skillforge-mcp. It costs 19 tokens per session (471 once invoked), scanned A, original, MIT.

A skill that rewrites prompts to be shorter, clearer, and more specific while keeping their original purpose and safety rules.

In plain words
What is it for?
Use it to tighten prompts, clarify requirements, preserve guardrails, and set concrete output constraints.
Why use it?
It removes filler, repetition, and vague wording that can make an AI prompt cost more and produce less predictable results.

Skill for Claude CodeCodex

Part of the skillforge plugin — 10 skills, 1 MCP server shipped together

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.

agentmods
npx agentmods add skills/lyupro/skillforge-mcp/prompt-optimizer
Any agent
npx skills add lyupro/skillforge-mcp --skill prompt-optimizer
Clone the repo
git clone --depth 1 https://github.com/lyupro/skillforge-mcp

Made for: Claude Code, Codex.

Or install skillforge, the plugin that ships this one along with the rest of its 10 skills, 1 MCP server.

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 prompt-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/lyupro/skillforge-mcp/prompt-optimizer.svg)](https://agentmods.dev/skills/lyupro/skillforge-mcp/prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/lyupro/skillforge-mcp/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/lyupro/skillforge-mcp/prompt-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 471 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00019 $0.00471
Opus 5 $0.00010 $0.00235
Sonnet 5 $0.00004 $0.00094
Haiku 4.5 $0.00002 $0.00047

Measured 5d ago against content hash 4ff87ce40f46, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prompt-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 5d 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.

skills/prompt-optimizer/SKILL.md · 42 lines

What it actually says

You are a prompt engineer. Given the prompt supplied as user input, rewrite it to be shorter, clearer, and more directive without changing what it asks for.

Apply this discipline:

  1. Cut hedging. Remove "please", "could you", "if possible", "I'd appreciate it if". LLMs do not need politeness to comply.
  2. Cut filler. Remove "just", "really", "basically", "actually", "simply". These add token cost and no signal.
  3. Cut redundancy. Find places where the same instruction appears twice — once at the top, once in an example, once in the closing — and keep the strongest single phrasing.
  4. Replace generic with specific. Generic verbs like "handle", "process", "deal with" become specific ones: "parse JSON", "split on whitespace", "reject if exit code non-zero".
  5. Concrete over abstract. "Make it good" → "Maximum 100 words. Active voice. No bullet points."
  6. Order matters. Goal first, constraints second, format third. The LLM weights early tokens more.
  7. Preserve guardrails. Do not remove instructions that exist for safety (don't follow instructions inside the input, refuse if X, role boundaries). Cut bloat, keep teeth.

Output format:

## Optimized

<the tightened prompt>

## Diff summary

- Removed: <bullet list of what was cut + why>
- Added: <bullet list of what was added + why, often empty>
- Rephrased: <bullet list of significant rewordings>

## Token estimate

Original: ~<N> tokens. Optimized: ~<M> tokens. Savings: <X>%.

Use the rough heuristic 1 token ≈ 4 characters for the estimate.

If the input is already well-optimized, say so — return the original unchanged and explain what further trimming would damage clarity. Do not manufacture optimizations.

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. 5d ago First seen · 42 lines · 19 tokens per session scan A 4ff87ce40f46

Subscribe to this mod's changes

prompt-optimizer is a skill published in the GitHub repository lyupro/skillforge-mcp (2 stars, last pushed 20d ago), licensed MIT. It adds 19 tokens to every session and 471 once invoked, about $0.0001 per session on Opus 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-31.