fully-automated-prompt-optimization: Agent for Claude Code

.claude/agents/optimization.md

optimization is an agent for Claude Code from cisco-foundation-ai/fully-automated-prompt-optimization. It costs 127 tokens per session (2,978 once invoked), scanned A, original, Apache-2.0.

An agent for improving prompts and multi-step AI workflows by studying evaluation results and trying revised versions. It can work on the wording, settings, or structure of the workflow.

In plain words
What is it for?
Use it to improve prompts, investigate failed evaluations, compare prompt versions, adjust retrieval or model settings, and revise the structure of an AI workflow.
Why use it?
It helps identify why an AI workflow fails tests and guides repeated changes toward better scores. It also keeps optimization within the limits defined for the project.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md; mentions subagents.

This is cisco-foundation-ai/fully-automated-prompt-optimization's own configuration. It tells Claude Code how to work on fully-automated-prompt-optimization itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fully-automated-prompt-optimization configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cisco-foundation-ai/fully-automated-prompt-optimization. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cisco-foundation-ai/fully-automated-prompt-optimization/main/.claude/agents/optimization.md
Clone the repo
git clone --depth 1 https://github.com/cisco-foundation-ai/fully-automated-prompt-optimization

Made for: Claude Code.

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 optimization

README.md
[![agentmods](https://agentmods.dev/badge/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization/github.svg)](https://agentmods.dev/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization)
Your own site
<a href="https://agentmods.dev/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization"><img src="https://agentmods.dev/badge/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization/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 optimization

Your own site · 80×15
<a href="https://agentmods.dev/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization"><img src="https://agentmods.dev/badge/agents/cisco-foundation-ai/fully-automated-prompt-optimization/optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 127 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,978 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.00127 $0.02978
Opus 5.5 $0.00051 $0.01191
Sonnet 5.5 $0.00025 $0.00596
Haiku 4.5 $0.00013 $0.00298

Measured 24d ago against content hash 972d50f976e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimization 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 24d 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.

.claude/agents/optimization.md · 151 lines

How it starts

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

Optimization Agent

You optimize eval quality for a FAFO tenant across all optimization granularities: micro (prompt text), meso (strategy/parameters), and macro (chain structure). You have full autonomy over your approach — analyze results, classify failure modes, route to the right optimization level, create variants, run evals, and iterate until you hit the target.

Core Principles

  1. Scope Contract (Hard Gate) — Your very first action, before any analysis or variant creation, is to read the tenant playbook at tenants/<tenant_id>/docs/iteration-playbook.md and produce a scope contract: a list of allowed optimization levels and forbidden optimization levels. The "Chain-Level Optimization Scope" section (if present) is authoritative. Write the scope contract into your first message so it is visible and auditable. All subsequent work must satisfy this contract. If step-attribution identifies failures that are only addressable by a forbidden level, acknowledge the ceiling in your report — never propose, discuss, or reason about acting on those forbidden levels. Do not mention specific forbidden parameters or structural changes even as hypotheticals.

  2. Pre-Variant Scope Check — Before creating any variant (prompt, parameter, or structural), verify it only touches levels listed as allowed in the scope contract. If a proposed change would touch a forbidden level — even partially — discard it silently and try a different approach within allowed levels. This check is mandatory and non-negotiable; no rationale justifies bypassing it.

  3. Strategy Ladder for Plateau-Breaking — When performance plateaus within an allowed level, exhaust the following escalating strategies before declaring the level exhausted. Always branch from the current best variant (never diverge to an older or parallel variant).

    • Module isolation: change one module at a time to isolate impact
    • Technique diversity: try distinct techniques — chain-of-thought, step-by-step decomposition, output format constraints, few-shot with synthetic examples, negative examples, role framing, constraint tightening
    • Web research: search for novel prompting techniques from published guides and benchmarks
    • Ablation: remove recent additions from the best variant to test whether they actually helped
    • Require at least 3 distinct techniques tried on the best variant before declaring plateau at any level

Read the full file on GitHub · 151 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. 24d ago Changed 972d50f976e5
  2. 2mo ago First seen · 151 lines · 127 tokens per session scan A de63182fa965

Subscribe to this mod's changes

optimization is an agent published in the GitHub repository cisco-foundation-ai/fully-automated-prompt-optimization (112 stars, last pushed today), licensed Apache-2.0. It adds 127 tokens to every session and 2,978 once invoked, about $0.0005 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 agents, from other repositories

Prompt Builder

Expert prompt engineering and validation system for creating high-quality prompts - Brought to you by microsoft/edge-ai.

github/awesome-copilot · 24 tokens

token

Token and context management — context window optimization, token counting, truncation strategy, chunking design.

tonone-ai/tonone · 21 tokens

security-ai-code

HUGIN, código gerado por IA e apps com LLM na squad Security. Varre o repositório inteiro e o histórico do git atrás de segredo exposto, servicerole no cliente, RLS aberta e auth por usermetadata, e audita apps com LLM — injeção de prompt, tools sem confirmação, saída do modelo confiada, vazamento pelo prompt.…

joaoguirunas/team-os · 94 tokens

prompt-engineer

Expert in prompt engineering for Claude, GPT, Gemini, and Llama models. Specializes in chain-of-thought prompting, structured outputs, few-shot learning, system prompt architecture, and prompt optimization. Use for designing effective prompts, imp...

SteveGJones/ai-first-sdlc-practices · 52 tokens

prompt-coach

Reviews prompts, scores prompt quality, identifies anti-patterns, and guides iterative refinement. USE FOR: prompt reviews, quality scoring, anti-pattern detection, refinement coaching, and prompt evaluation feedback. DO NOT USE FOR: production prompt deployment, model fine-tuning, or application feature coding.

ivegamsft/basecoat · 61 tokens

hyv-veo-prompt-smith

The generative-prompt writer for HearYourVOICE (Phase 4). Looks at the shots still MISSING a source in the shotlist (after CC scouting) and writes copy/paste generation prompts to fill exactly those gaps — no more. Builds each prompt from the measured durations and the veo-prompt guide, applying subject-lock and…

killernay/HearYourVOICE · 124 tokens