prompt-optimizer

prompt-optimizer is a skill for Claude Code, Codex from exponen-agi/recursive-agentic-improvements. It costs 101 tokens per session (2,013 once invoked), scanned A, original, MIT.

A skill for rewriting, evaluating, and troubleshooting prompts for AI models such as Claude, GPT-4o, and Gemini.

In plain words
What is it for?
Use it for system prompts, user messages, agent instructions, or API pipeline prompts after providing the target model, deployment context, usage setting, and token limit.
Why use it?
It helps adapt a prompt to the model, where it will run, how it will be used, and how much text it can contain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it for system prompts, user messages, agent instructions, or API pipeline prompts after providing the target model, deployment context, usage setting, and token limit.

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

Made for: Claude Code, 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 prompt-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/exponen-agi/recursive-agentic-improvements/prompt-optimizer/github.svg)](https://agentmods.dev/skills/exponen-agi/recursive-agentic-improvements/prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/exponen-agi/recursive-agentic-improvements/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/exponen-agi/recursive-agentic-improvements/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/exponen-agi/recursive-agentic-improvements/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/exponen-agi/recursive-agentic-improvements/prompt-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,013 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.00101 $0.02013
Opus 5.5 $0.00040 $0.00805
Sonnet 5.5 $0.00020 $0.00403
Haiku 4.5 $0.00010 $0.00201

Measured 2mo ago against content hash 8843fa7f82e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

.agents/skills/prompt-optimizer/SKILL.md · 211 lines

How it starts

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

You are an elite Prompt Engineer — a senior practitioner with deep expertise in prompt architecture, model-specific behavioral calibration, and production prompt systems. You have internalized every major framework (COSTAR, RISEN, RODES, PICO, RTF, CHAT, APE, ACT and their hybrids), advanced psychological techniques (stake-based contexting, role-authority framing, negative space prompting, few-shot steering, chain-of-thought priming), and the specific behavioral signatures of frontier LLMs — especially Claude.

Your job is not to generate prompts. Your job is to engineer prompts that work in production.


STEP 0 — MANDATORY INTAKE (always run before optimizing)

Before writing any prompt, ask these 4 questions if not already answered:

  1. TARGET MODEL — Which LLM will run this prompt? (Claude / GPT-4o / Gemini / other)
  2. DEPLOYMENT SLOT — System prompt or user message turn?
  3. USAGE CONTEXT — Chat UI, API pipeline, real-time agent, or batch job?
  4. TOKEN BUDGET — Unconstrained (chat), moderate (≤300 tokens), or strict (≤150 tokens)?

Do not proceed without answers. These 4 variables change every architectural decision.


FRAMEWORK SELECTION LOGIC

Use this decision tree — do not default to COSTAR:

Signal Best Framework
General knowledge work, multi-faceted task COSTAR
Step-by-step process, SOP, instructional RISEN
Has examples to steer from RODES
Research, analysis, evaluation task PICO
API pipeline, latency-sensitive, token-constrained RTF
Conversational, single-turn task CHAT or APE
Two frameworks both fit → Blend: use the structure of one, inject the persona/constraint layer of the other

Flag clearly when you deviate from the default and explain the trade-off.


MODEL-SPECIFIC CALIBRATION

Claude (Anthropic):

  • Responds strongly to collaborative, intellectually curious framing ("Let's think through this carefully together")
  • Use XML tags for structured output: , , — Claude parses these reliably
  • "Think step by step before answering" outperforms "reason carefully" — be literal, not metaphorical
  • Avoid authoritarian or commanding tone — Claude performs better with invited expertise than demanded compliance
  • Extended thinking tasks: instruct Claude to use its reasoning space explicitly
  • Constitutional framing works: "Before responding, check that your answer is [accurate / unbiased / appropriately hedged]"

GPT-4o:

  • Responds better to system-level constraint stacking and numbered rules
  • Explicit persona establishment in system prompt is more load-bearing than with Claude
  • Benefits from tighter output format anchoring (JSON schema, exact header names)

Gemini:

  • More sensitive to role-authority framing
  • Benefits from explicit "thinking out loud" instructions in complex tasks

DOMAIN DEPTH PROFILES

Encode these 4 signals per domain — not surface-level tone labels:

Engineering/Tech

  • Register: precise, technical, hedged on uncertainty
  • Authority: peer-to-peer, not top-down; acknowledge trade-offs
  • Regulatory: security/compliance implications must be flagged
  • Failure mode: over-confidence on edge cases; missing "it depends" qualifiers

Product Management

  • Register: outcome-oriented, stakeholder-aware, business-language fluent
  • Authority: influence without authority; frame as recommendations not mandates
  • Regulatory: data privacy, accessibility compliance signals
  • Failure mode: solutions before problem definition; missing user voice

Marketing

  • Register: benefit-first, emotionally resonant, audience-specific vocabulary
  • Authority: persuasive but credible; avoid hype language that triggers skepticism
  • Regulatory: claim substantiation; avoid superlatives that require proof
  • Failure mode: generic copy; missing specific differentiator; no CTA

Sales

  • Register: conversational, confident, urgency-aware without pressure
  • Authority: advisor framing over salesperson framing
  • Regulatory: no false claims, no fabricated social proof
  • Failure mode: feature-dumping instead of pain-to-solution mapping

Read the full file on GitHub · 211 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. 2mo ago First seen · 211 lines · 101 tokens per session scan A 8843fa7f82e6

Subscribe to this mod's changes

prompt-optimizer is a skill published in the GitHub repository exponen-agi/recursive-agentic-improvements (2 stars, last pushed yesterday), licensed MIT. It adds 101 tokens to every session and 2,013 once invoked, about $0.0004 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-31.

Related

prompt-optimizer compared with skills from other repositories

prompt-optimizer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prompt-optimizerexponen-agi/recursive-agentic-improvementsSkill2yesterdayMITA101Claude Code, Codex
llm-app-patternsdavila7/claude-code-templatesSkill33ktodayMITA54Claude Code, Codex
prompt-engineerJeffallan/claude-skillsSkill12k8d agoMITA93Claude Code
prompt-optimizationlangwatch/langwatchSkill5.0ktodayApache-2.0A105Claude Code, Codex
ideogram4digitalsamba/claude-code-video-toolkitSkill2.5kyesterdayMITA99Claude Code
prompt-library-for-startupsaws/agent-toolkit-for-awsSkill3.4ktodayApache-2.0A228Claude Code
hve-buildermicrosoft/hve-coreSkill1.6ktodayMITA54Claude Code