D4 · Prompt Engineering › Cluster 8 · Reliability, Hallucination & Iteration

8.5 · The Prompt Improver & Templates

Console tools for better prompts

CONCEPT Three Console tools, used in order

The Claude Console ships a suite of prompt-building tools you typically use in sequence: the prompt generator to draft, prompt templates & variables to parameterize, and the prompt improver to refine.

ToolWhat it doesWhen
Prompt generatorGenerates a first-draft prompt template tailored to your task, following best practicesSolving the "blank page problem"
Templates & variablesSeparates fixed content from dynamic {{variables}}Any prompt reused across calls
Prompt improverAnalyzes and enhances an existing template (adds CoT, XML, examples)Making a prompt more robust for complex, accuracy-critical tasks
🔑 The prompt generator also decides what variables your prompt needs and emits them in the template; the improver preserves your existing variables in its output.

CONCEPT Templates & variables, and how the improver works

A prompt template combines fixed content (static instructions) with variable content (user input, RAG-retrieved context, conversation history, tool results). In the Console, placeholders use {{double brackets}}. The payoff is consistency, efficiency (swap variables without rewriting), testability, scalability, and version control — you track the stable core separately from the dynamic inputs.

Tip: wrap variables in XML tags for clearer structure, e.g. <text>{{text}}</text>. (Note: claude.ai does not support templates/variables — this is a Console/API capability.)

The prompt improver takes your template (plus optional feedback and example input/output pairs) and enhances it in four steps:

  1. Example identification — locates and extracts examples from your template.
  2. Initial draft — builds a structured template with clear sections and XML tags.
  3. Chain-of-thought refinement — adds and refines detailed reasoning instructions.
  4. Example enhancement — updates examples to demonstrate the new reasoning process.

The result is a template with detailed CoT instructions, XML-organized sections, standardized step-by-step examples, and strategic prefills.

⚠️ The improver is built for complex, accuracy-over-speed tasks — it produces longer, more thorough, but slower responses. For latency- or cost-sensitive apps, prefer a simpler prompt.

DIAGRAM Console workflow: draft → template → improve

flowchart TD B["Blank page"] --> GEN["Prompt generator
drafts a template + variables"] GEN --> TPL["Template with {{variables}}
fixed vs. variable content split"] TPL --> IMP{"Complex, accuracy-
critical task?"} IMP -->|"yes"| PI["Prompt improver (4 steps):
find examples → draft →
CoT → enhance examples"] IMP -->|"no / latency-sensitive"| SIMPLE["🟠 Keep the simpler prompt"] PI --> OUT["🟢 Robust template:
CoT + XML + step-by-step examples"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef gate fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; class OUT ok; class SIMPLE gate;

CODE A template, and what the improver adds

A minimal template is just fixed text plus a {{variable}}:

# Prompt template — {{double brackets}} mark variable content
Translate this text from English to Spanish: {{text}}

# Better: wrap the variable in XML tags for clearer structure
Translate the text below from English to Spanish.
<text>{{text}}</text>

Feeding a bare classification prompt to the improver adds CoT reasoning, XML organization, and explicit output formatting — while keeping the original {{variables}}:

# BEFORE — the improver's input
From the list of Wikipedia titles, identify which article this sentence
came from. Respond with just the title.
Article titles: {{titles}}
Sentence to classify: {{sentence}}

# AFTER — the improver's output (abridged)
You are a text classification system matching sentences to Wikipedia titles.
<article_titles>{{titles}}</article_titles>
<sentence_to_classify>{{sentence}}</sentence_to_classify>

Follow these steps:
1. List the key concepts from the sentence
2. Compare each concept with the article titles
3. Rank the top 3 most relevant titles and explain why
4. Select the best-matching title

Wrap your analysis in <analysis> tags. Then output ONLY the chosen title.

TRADE-OFFS Improved prompt vs. simple prompt

✅ Prompt-improver output

  • Higher accuracy on complex, reasoning-heavy tasks
  • Structured CoT + XML + step-by-step examples
  • Preserves your variables; standardized formatting

⚠️ Simple prompt

  • Faster, cheaper — better for latency/cost-sensitive apps
  • Improver output is longer & slower by design
  • Overkill when the current prompt already works
Use the improver where accuracy beats speed; keep prompts simple where latency or cost is the binding constraint.

EXAM TRAPS

Trap: Reaching for the prompt improver on a latency-sensitive endpoint. → The improver deliberately makes prompts longer, more thorough, and slower. For latency/cost-sensitive apps, prefer a simpler prompt.
Trap: Confusing the prompt generator (drafts a new prompt from scratch — the blank-page tool) with the prompt improver (refines an existing template).
Trap: Expecting template variables to work in claude.ai. → Templates and {{variables}} are a Console/API feature; claude.ai does not support them.
Trap: Naming the improver's four steps as "just formatting." → They are example identification → initial draft → chain-of-thought refinement → example enhancement — the CoT and reasoning-example work is the substance, not cosmetics.

PRACTICE

Q1 · What are the four steps of the prompt improver, in order?

(1) Example identification — extract examples from your template; (2) initial draft — structured template with sections and XML tags; (3) chain-of-thought refinement — add and refine reasoning instructions; (4) example enhancement — update examples to show the new reasoning process.

Q2 · When should you not use the prompt improver?

On latency- or cost-sensitive applications. The improver produces longer, more thorough, slower responses — great when accuracy matters more than speed, wrong when speed/cost is the constraint. Use a simpler prompt there.

Q3 · Why separate fixed content from {{variable}} content in a template?

It gives you consistency, efficiency (swap inputs without rewriting), testability (change only the variable to probe edge cases), scalability, and version control (track the stable core apart from dynamic inputs). It's also what powers the Console's generator, improver, and evaluation tooling.