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).

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/exponen-agi/recursive-agentic-improvements/prompt-optimizer
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.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.svg" alt="Measured on agentmods" 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. 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.1 $0.00101 $0.02013
Opus 5 $0.00051 $0.01007
Sonnet 5 $0.00020 $0.00403
Haiku 4.5 $0.00010 $0.00201

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

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

llm-app-patterns

Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.

davila7/claude-code-templates · 54 tokens

prompt-optimization

Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…

langwatch/langwatch · 105 tokens

enhance-prompt

Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.

google-labs-code/stitch-skills · 41 tokens

prompt-engineer

Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…

Jeffallan/claude-skills · 93 tokens

omh-model-optimization

This is a Hermes-native model-optimization workflow skill.

rlaope/oh-my-hermes · 82 tokens

hve-builder

Author, review, or validate Copilot prompt-engineering artifacts through independent review, behavior testing, and host checks.

microsoft/hve-core · 27 tokens