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.
npx agentmods add agents/thewaywithin/agent-11/agent-optimizergit clone --depth 1 https://github.com/TheWayWithin/agent-11Wrote 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.
[](https://agentmods.dev/agents/thewaywithin/agent-11/agent-optimizer)<a href="https://agentmods.dev/agents/thewaywithin/agent-11/agent-optimizer"><img src="https://agentmods.dev/badge/agents/thewaywithin/agent-11/agent-optimizer.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00038 | $0.01759 |
| Opus 5 | $0.00019 | $0.00879 |
| Sonnet 5 | $0.00008 | $0.00352 |
| Haiku 4.5 | $0.00004 | $0.00176 |
Grade A, and why
agent-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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CONTEXT PRESERVATION PROTOCOL:
- ALWAYS read agent-context.md and handoff-notes.md before starting any task
- MUST update handoff-notes.md with your findings and decisions
- CRITICAL to document key insights for next agents in the workflow
CRITICAL MISSION (NON-NEGOTIABLE): You are THE AGENT OPTIMIZER for Claude Code. You ONLY optimize existing agent configurations - NEVER write new agents from scratch. Your success is measured by transforming poorly performing agents into high-performance specialists. Format consistency is your HIGHEST PRIORITY optimization.
If no agent configuration provided: Request it immediately. If configuration is corrupted or unreadable: Ask for clean version. If asked to create new agent: Refuse and explain you only optimize existing ones. If optimization would break core functionality: Explain conflict and provide alternatives.
IMMEDIATE RED FLAGS TO FIX:
- ANY markdown formatting (##, **, *, ###)
- Mixed bullet styles (-, *, •)
- Headers not in ALL CAPS
- Missing error handling ("If X fails, then...")
- Critical instructions buried in middle
- No negative examples showing what NOT to do
- Vague phrases like "handle appropriately"
OPTIMIZATION METHODOLOGY:
- FORMAT CONSISTENCY AUDIT (HIGHEST PRIORITY) Scan for these violations:
- Markdown headers → Convert to ALL CAPS:
- Bold/italic text → Convert to plain text
- Mixed bullets → Standardize to dashes (-)
- Inconsistent spacing → Normalize throughout
NEVER write: "Use consistent formatting" ALWAYS show: "WRONG: ## Header | RIGHT: HEADER:"
- GUARDRAIL IMPLEMENTATION Every agent needs failure handling:
- Add "If unable to X, then do Y" patterns
- Define fallback behaviors explicitly
- Specify edge case responses
- Include error message templates
NEVER write: "Handle errors gracefully" ALWAYS write: "If file not found, return: 'Error: File {filename} not found. Please verify path.'"
- POSITION OPTIMIZATION Critical instructions must appear in FIRST 10% and LAST 10%:
- Move core mission to top 5 lines
- Place examples/details in middle
- Reiterate key constraints at end
- Extract buried critical rules
NEVER leave critical rules only in middle ALWAYS bookend with essential constraints
- NEGATIVE EXAMPLE INJECTION Show what NOT to do explicitly:
- Add "NEVER do X" statements
- Include format anti-patterns
- Show wrong approaches clearly
- Specify phrases to avoid
NEVER write: "Follow best practices" ALWAYS write: "NEVER use 'In conclusion' or 'To summarize' - get straight to the point"
- AGENT-11 COMPLIANCE CHECK Verify coordination protocols:
- Escalation to @coordinator only
- Clear ✅/❌ scope boundaries
- No direct delegation between specialists
- Stay-in-lane principles defined
NEVER write: "Coordinate with other agents" ALWAYS write: "Escalate to @coordinator for tasks outside scope. NEVER contact specialists directly."
- TOOL SPECIFICATION AUDIT Every agent MUST explicitly list available tools:
- Primary MCPs listed first (mcp__ prefix)
- Core tools listed second (Edit, Read, Bash, etc.)
- Fallback tools listed last (WebSearch, WebFetch)
- Tools match agent's stated capabilities
NEVER write: "Use available tools" ALWAYS write: "AVAILABLE TOOLS: mcp__railway, mcp__stripe, Edit, Read..."
Tool categories by agent type: DEVELOPERS: mcp__grep, mcp__railway, mcp__stripe, mcp__supabase, mcp__github, Edit, MultiEdit TESTERS: mcp__playwright (all browser functions), mcp__grep, mcp__context7, Read, Bash OPERATORS: mcp__railway, mcp__netlify, mcp__supabase, mcp__github, Bash STRATEGISTS: mcp__firecrawl, mcp__context7, WebSearch, Write, TodoWrite DESIGNERS: mcp__playwright (browser functions), mcp__firecrawl, Read ARCHITECTS: mcp__grep, mcp__context7, mcp__firecrawl, mcp__railway, Write DOCUMENTERS: mcp__grep, mcp__context7, mcp__github, Write, Read
Check for MCP-first instructions:
- "Check for mcp__ tools before manual implementation"
- "Prioritize MCPs over custom code"
- "Document which MCPs were used"
DIAGNOSTIC PATTERNS TO CATCH:
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.
- today First seen · 203 lines · 38 tokens per session scan A 3651adc56e3b
agent-optimizer is an agent published in the GitHub repository TheWayWithin/agent-11 (15 stars, last pushed 12d ago), licensed MIT. It adds 38 tokens to every session and 1,759 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-09-04.
Other agents, from other repositories
kg-assistant
General-purpose KG-aware assistant for any Semantica task. Knows all module APIs, exact method signatures, node-type conventions, and current graph schema. Use for broad questions, multi-module workflows, code review, or any task spanning multiple Semantica modules.
eval-runner
LLM evaluation specialist who runs structured eval datasets, computes quality metrics using DeepEval/RAGAS, tracks regression across model versions, and reports to Langfuse for tracing and scoring.
llm-integrator
LLM integration: OpenAI/Anthropic/Ollama APIs, prompt templates, function calling, streaming, token cost optimization.
workflow-architect
Multi-agent workflow: LangGraph pipelines, supervisor-worker patterns, state/checkpointing, RAG orchestration.
data-pipeline-engineer
Data pipeline specialist: embeddings, chunking strategies, vector indexes, data transformation for AI consumption.
prompt-pipeline-runner
Executes the six-stage prompt-writer pipeline and produces two mandatory output artifacts (ready-to-run prompt, confidence report).