aiwithgrant
about me
aiwithgrant›Guides›Anthropic
Anthropic
Anthropic
Official Docs
Beginner

Prompt Improver

Use Anthropic's automated prompt improver to optimize your prompts with chain-of-thought and XML structure.

Official Anthropic docs →
Content sourced from official Anthropic documentation
1

What the prompt improver does

Enhances prompts in 4 automated steps: 1) Example identification, 2) Structured template with XML tags, 3) Chain of thought refinement, 4) Example enhancement with step-by-step reasoning.

šŸ’”You can watch each step happen in real-time in the improvement modal in the Anthropic Workbench.
2

What you get

The improved prompt includes: detailed chain-of-thought instructions, clear XML tag organization, standardized example formatting, and strategic prefills that guide Claude's initial responses.

3

How to use it

1) Submit your prompt template, 2) Add feedback about current issues (e.g., 'summaries are too basic for expert audiences'), 3) Include example inputs and ideal outputs, 4) Review the improved prompt.

šŸ’”Don't have examples? Use the Test Case Generator to generate sample inputs, get Claude's responses, edit them to match your ideal, then feed them back in.
4

When to use it

Best for: complex tasks requiring detailed reasoning, situations where accuracy matters more than speed, and problems where current outputs need significant improvement.

šŸ’”For latency or cost-sensitive applications, consider simpler prompts — the improver creates templates that produce longer, more thorough, but slower responses.
5

Classification prompt improvement

See how the improver transforms a basic classification prompt into a structured, high-accuracy version.

Article classification
You are an intelligent text classification system specialized in matching sentences to Wikipedia article titles.

First, review the following list of Wikipedia article titles:
<article_titles>
{{titles}}
</article_titles>

Now, consider this sentence that needs to be classified:
<sentence_to_classify>
{{sentence}}
</sentence_to_classify>

Your goal is to determine which article title best matches the given sentence. Follow these steps:

1. List the key concepts from the sentence
2. Compare each key concept with the article titles
3. Rank the top 3 most relevant titles and explain why
4. Select the most appropriate article title

Wrap your analysis in <analysis> tags. After your analysis, output only the chosen article title.
The improved version adds: a clear role, XML tags for structure, step-by-step reasoning, and clean output formatting. Dramatically more accurate at matching sentences to articles.

Key topics covered

Prompt optimization
Automated improvement
Chain of thought
XML structure
Workbench tool
Iteration
Read the full guide
View the complete Anthropic documentation
Official docs →

More guides