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 commands/zsutxz/claudelearning/prompt-optimizegit clone --depth 1 https://github.com/zsutxz/ClaudeLearningWrote 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/commands/zsutxz/claudelearning/prompt-optimize)<a href="https://agentmods.dev/commands/zsutxz/claudelearning/prompt-optimize"><img src="https://agentmods.dev/badge/commands/zsutxz/claudelearning/prompt-optimize.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.1 | $0.00000 | $0.03143 |
| Opus 5 | $0.00000 | $0.01571 |
| Sonnet 5 | $0.00000 | $0.00629 |
| Haiku 4.5 | $0.00000 | $0.00314 |
Grade B, and why
prompt-optimize scanned grade B with 1 finding 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.
Strips warnings and disclaimersmediumAnti-refusal
Omitting safety caveats hides risk from the user and is a common jailbreak preamble.
- No speculation without disclaimers This is a copy
100% identical to prompt-optimize — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 588 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Optimization
You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimization.
Context
Transform basic instructions into production-ready prompts. Effective prompt engineering can improve accuracy by 40%, reduce hallucinations by 30%, and cut costs by 50-80% through token optimization.
Requirements
$ARGUMENTS
Instructions
1. Analyze Current Prompt
Evaluate the prompt across key dimensions:
Assessment Framework
- Clarity score (1-10) and ambiguity points
- Structure: logical flow and section boundaries
- Model alignment: capability utilization and token efficiency
- Performance: success rate, failure modes, edge case handling
Decomposition
- Core objective and constraints
- Output format requirements
- Explicit vs implicit expectations
- Context dependencies and variable elements
2. Apply Chain-of-Thought Enhancement
Standard CoT Pattern
# Before: Simple instruction
prompt = "Analyze this customer feedback and determine sentiment"
# After: CoT enhanced
prompt = """Analyze this customer feedback step by step:
1. Identify key phrases indicating emotion
2. Categorize each phrase (positive/negative/neutral)
3. Consider context and intensity
4. Weigh overall balance
5. Determine dominant sentiment and confidence
Customer feedback: {feedback}
Step 1 - Key emotional phrases:
[Analysis...]"""
Zero-Shot CoT
enhanced = original + "\n\nLet's approach this step-by-step, breaking down the problem into smaller components and reasoning through each carefully."
Tree-of-Thoughts
tot_prompt = """
Explore multiple solution paths:
Problem: {problem}
Approach A: [Path 1]
Approach B: [Path 2]
Approach C: [Path 3]
Evaluate each (feasibility, completeness, efficiency: 1-10)
Select best approach and implement.
"""
3. Implement Few-Shot Learning
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.
- 5d ago First seen · 588 lines · 0 tokens per session scan B b8620d529ed8
prompt-optimize is a command published in the GitHub repository zsutxz/ClaudeLearning (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,143 tokens. A static security scan graded it B with 1 finding (strips warnings and disclaimers). It is 100% identical to prompt-optimize, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
prompt
System instructions for writing effective prompts. Apply when generating commands, skills, agents, or any LLM instructions.
prompt-show
Display full details of a saved prompt by ID.
prompt-optimize
Present the efficiency-versus-effectiveness frontier as labelled variants and let the user pick. TRIGGER WHEN: the user wants to review or optimize a prompt, system message, or agent instructions for clarity/tokens/reliability.
music-suno-prompt
Grounded Suno prompt synthesis from local knowledge corpus + persona canon + label canon. No vibes-prompting.
ai
Load the Kaizen skill for production-ready AI agent implementation with signature-based programming and multi-agent coordination.
audit-prompt
Evaluate an existing prompt for clarity, effectiveness, and edge cases.