prompt-optimizer

prompt-optimizer is a skill for Claude Code from claude-hangar/claude-hangar. It costs 46 tokens per session (1,381 once invoked), scanned A, original, MIT.

An advisory tool that analyzes a coding task or draft prompt and recommends how to run it. It detects project context, clarifies the intended work, and matches the request with available skills, agents, and workflow steps.

In plain words
What is it for?
Use it with a written task, such as adding authentication to an application, or with the latest user message. It can provide a full analysis or a shorter version, but it does not perform the work.
Why use it?
It helps choose an appropriate approach before execution when a task is vague or could be handled in several ways.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md.

Part of the claude-hangar plugin — 35 skills, 22 agents shipped together

Good fit Use it with a written task, such as adding authentication to an application, or with the latest user message. It can provide a full analysis or a shorter version, but it does not perform the work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/claude-hangar/claude-hangar/prompt-optimizer
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 claude-hangar/claude-hangar --skill prompt-optimizer
Clone the repo
git clone --depth 1 https://github.com/claude-hangar/claude-hangar

Made for: Claude Code.

Or install claude-hangar, the plugin that ships this one along with the rest of its 35 skills, 22 agents.

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/claude-hangar/claude-hangar/prompt-optimizer/github.svg)](https://agentmods.dev/skills/claude-hangar/claude-hangar/prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/claude-hangar/claude-hangar/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/claude-hangar/claude-hangar/prompt-optimizer/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 prompt-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/claude-hangar/claude-hangar/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/claude-hangar/claude-hangar/prompt-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,381 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.00046 $0.01381
Opus 5 $0.00023 $0.00691
Sonnet 5 $0.00009 $0.00276
Haiku 4.5 $0.00005 $0.00138

Measured 10d ago against content hash ec68a0f7a081, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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.

core/skills/prompt-optimizer/SKILL.md · 182 lines

How it starts

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

/prompt-optimizer — Prompt Analysis Pipeline

Six-phase advisory skill that takes a user's draft prompt or task description and produces an optimized version with the right skills, agents, and workflow.

Advisory only — this skill never executes the task. It produces an optimized prompt the user can then run.

Usage

/prompt-optimizer "Add authentication to my SvelteKit app"
/prompt-optimizer                # Analyze the last user message
/prompt-optimizer --quick        # Short version for experienced users

The Six Phases

Phase 1: Detect Project Context

Gather project metadata without reading the full codebase:

# Quick project detection
cat CLAUDE.md 2>/dev/null | head -30
cat package.json 2>/dev/null | node -e "const p=require('/dev/stdin'); console.log(p.name, Object.keys(p.dependencies||{}).slice(0,10))"
ls -d src/ app/ lib/ pages/ routes/ components/ 2>/dev/null
git remote -v 2>/dev/null | head -1

Output: Tech stack, framework, project type, repo context.

Phase 2: Detect User Intent

Parse the prompt to identify:

  • Primary goal: What does the user want to achieve?
  • Implicit requirements: What's assumed but not stated?
  • Scope boundaries: What should NOT change?
  • Success criteria: How will we know it's done?

Phase 3: Assess Scope

Classify the task:

Size Criteria Recommended Approach
Small Single file, < 30 min Direct implementation
Medium 2-5 files, clear scope Plan then implement
Large 6+ files, architectural Full planning phase with planner agent
Ambiguous Unclear scope or requirements Brainstorming first

Phase 4: Match Hangar Components

Scan available skills and agents for the best match:

# List available skills and their descriptions
for skill in core/skills/*/SKILL.md; do
  head -5 "$skill" | grep "description:"
done

# List available agents
for agent in core/agents/*.md; do
  head -5 "$agent" | grep "description:"
done

Read the full file on GitHub · 182 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 182 lines · 46 tokens per session scan A ec68a0f7a081

Subscribe to this mod's changes

prompt-optimizer is a skill published in the GitHub repository claude-hangar/claude-hangar (1 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 1,381 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

agent-team

A guide for coordinating a team of coding agents working on one task. It covers when to split work into parallel assignments, how a lead agent coordinates them, and how to record shared knowledge.

Dannykkh/skill-olympus · 132 tokens

clio

A final-review and document-production workflow. It checks whether a process is ready to proceed, extracts source-based diagrams, and creates documents such as product requirements, technical documentation, and manuals.

Dannykkh/skill-olympus · 107 tokens

frontend-design

A frontend design and implementation guide for turning a visual design plan into a working web interface. It also provides fallback guidance when an official design plugin is unavailable.

Dannykkh/skill-olympus · 92 tokens

zephermine

Creates a persisted, sectionized implementation artifact suite through research, stakeholder interviews, domain analysis, database and API design, and multi-LLM review. Use for feature or product plans consumed by downstream implementation and QA. Prefer lightweight native plan/interview workflows for small tasks; on…

Dannykkh/skill-olympus · 97 tokens

design-plan

A design-system planning and implementation guide for frontend projects. A design system is a shared set of visual rules, reusable components, and accessibility practices for building consistent user interfaces.

Dannykkh/skill-olympus · 108 tokens

social-login

An implementation guide for letting users sign in with accounts from Google, Apple, Kakao, or Naver. It explains the frontend and backend steps, including checking the sign-in token before creating a session for your app.

Dannykkh/skill-olympus · 80 tokens