Common Prompt Engineering Mistakes
Independent educational resource, not an official Anthropic course. Facts about the API, prices and limits were checked against Anthropic's documentation on 15 November 2026 and the code was run against a local mock of the API, not the live service. Check the linked official pages before relying on a number, and test with your own key.
This is a field guide to the prompt mistakes that keep showing up, many of them left over from tutorials written for older models. Each one comes with what goes wrong, why, and what to do instead. It ends with a small script that flags a few of them automatically, with an honest note about how little a script like that can prove.
What you'll learn
- How to recognise the most common prompt problems on current Claude models.
- Which advice from older models now causes errors or odd behaviour.
- How to run a quick review of a prompt before you test it.
Before you start
This lesson ties together the whole module, so it helps to have read at least 3.1, 3.3 and 3.8.
The mistakes
1. Vague instructions
"Make it better" and "be professional" leave every important choice to the model. Say what better means: shorter, warmer, in two paragraphs, for beginners. If a new colleague would need to ask questions, the model needs the answers up front.
2. Rules with no reasons
"NEVER use ellipses" works worse than "this will be read aloud by a speech engine, so avoid ellipses". The reason lets the model handle similar cases. A rule stated in capitals with no explanation gets applied rigidly or inconsistently.
3. Only saying what not to do
Anthropic's example: instead of "Do not use markdown", write "Your response should be composed of smoothly flowing prose paragraphs." A target is easier to hit than a list of things to miss.
4. Turning up the volume
Capital-letter commands (CRITICAL, YOU MUST) were common with older models. Anthropic's migration notes say current models are more proactive and can overreact to anti-laziness prompting that older models needed: if your prompts told the model to be more thorough or to use tools more aggressively, reduce that guidance. A line like "If in doubt, use the tool" can make a model call tools it doesn't need. Write "use the search tool when the answer depends on information after your knowledge, or when a source is requested", and mean it.
5. Using prefill on new models
Starting the assistant turn with { or "Here is the summary:" returns a 400 error from Claude 4.6 on. Use direct instructions, answer tags, structured outputs, or for classification a tool with an enum.
6. Old thinking and sampling settings
Copying request options from an older tutorial is how a working prompt starts failing. On Claude 4.7 and later, budget_tokens returns a 400 error (use adaptive thinking and the effort setting), and temperature, top_p and top_k aren't supported either. If a request fails after you change the model, check these first.
7. Untrusted text in the system prompt
Putting a customer's email, a web page or a retrieved document into system gives it your authority. Keep third-party text in the user message, inside tags, and say it's data (lesson 3.3).
8. Question first, documents after
For long inputs, Anthropic recommends the documents at the top and the question at the end, reporting up to a 30 percent quality improvement in tests on complex multi-document inputs.
9. A single example, or all-alike examples
One example gets copied, and similar examples teach accidental rules. Use three to five relevant, diverse examples in tags, with an edge case (lesson 3.4).
10. Writing the prompt in a style you don't want back
A prompt full of bullets and bold text tends to get bullets and bold text. If you want flowing prose, write the prompt in flowing prose. Anthropic suggests exactly that adjustment when formatting won't behave.
11. Trusting a prompt to enforce a measurable rule
Word counts, allowed labels, valid JSON and banned words can be checked in code. Check them, and retry with a specific message (lessons 3.1 and 3.6).
12. Rewriting history between requests
This one is newer and easy to miss. Anthropic's migration notes say that on several current models, editing earlier messages, rebuilding the system prompt or tools, or summarising older turns in place between requests can invalidate thinking blocks already in the history. Keep the conversation append-only and pass assistant turns back exactly as the API returned them. Make changes with a mid-conversation system message or server-side context management instead.
13. No evaluation
This is the root cause of half the others. Without a test set you can't tell whether a change helped, so mistakes survive for months (lesson 3.8).
14. Carrying a prompt to a new model unchanged
Each model has its own prompting page, and the guide says to re-check model-specific techniques against your own evals. A prompt tuned for one model can be too wordy, too cautious or too eager on another. Re-run your set when you switch.
A rough pre-flight check
This script scans a prompt for a handful of the smells above: shouting, no output instruction, mostly negative rules, placeholders in the system prompt, blanket tool rules and very long untagged prompts:
import re
# A tiny heuristic checker. It finds smells, not bugs: a clean result does not mean the prompt is good,
# and a warning is a reason to look, not a verdict. Real quality is measured with an eval set.
def review(prompt: str, system: str = "") -> list[str]:
notes = []
words = len(prompt.split())
shouting = re.findall(r"\b(?:NEVER|ALWAYS|MUST|DO NOT|CRITICAL|IMPORTANT)\b", prompt)
if len(shouting) >= 4:
notes.append(f"{len(shouting)} capitalised commands. Explain the reason instead of raising your voice.")
if not re.search(r"\b(format|json|list|paragraph|words?|sentences?|one of|exactly|only)\b", prompt, re.I):
notes.append("No obvious output instruction. Say what the reply should look like.")
negatives = len(re.findall(r"\b(?:don't|do not|never|avoid|without)\b", prompt, re.I))
if negatives >= 4 and negatives > words / 25:
notes.append("Mostly 'don't' rules. Add what the model should do instead.")
if "{{" in system or re.search(r"\{[a-z_]+\}", system):
notes.append("A template placeholder appears in the system prompt. Keep untrusted variables out of `system`.")
if re.search(r"if in doubt,? use|always use the .* tool|default to using", prompt, re.I):
notes.append("A blanket 'always use the tool' rule can over-trigger on current models; say when it helps.")
if words > 1500 and not re.search(r"<\w+>", prompt):
notes.append("Long prompt with no tags. Separate instructions, documents and data with descriptive tags.")
return notes
Please read the comment at the top of that file, because it's the important part. A checker like this finds smells, not bugs. A prompt can pass every check and still be wrong, and a flagged prompt can be fine. We tested that a deliberately bad prompt triggers four specific warnings (capitalised commands, no output instruction, a placeholder in the system text, the over-trigger tool rule) and that a clear prompt triggers none. That shows the checks do what they say. It doesn't show that passing them makes a prompt good. Only your evaluation set can show that.
Real-world use case (illustrative scenario)
This scenario is an invented example to show how the ideas fit together. It is not a case study and its details are not measured results.
A developer upgrades a working integration to a newer model and it starts returning 400 errors. The cause is a pair of leftovers: a prefilled { in the assistant turn and a manual thinking budget. Both were correct for the old model. Removing them, and moving the format request into the prompt with validation (lesson 3.6), fixes the errors. Then the team's evaluation set shows the new model is also a little wordier than the old one, so one sentence about length goes into the system prompt.
Security notes
The biggest security mistake in this list is number 7, and the biggest quiet one is believing a prompt is a lock. Prompts guide behaviour. Real protection comes from limited permissions, validated outputs, human review of risky actions and tests with hostile inputs.
Cost and speed
Several mistakes cost money directly: bloated prompts, too many examples, retries from badly specified formats, and the wrong model for the job. Tighten the prompt first, then measure (lessons 1.4 and 2.9).
Key takeaways
- Be specific, give reasons, and say what to do rather than only what to avoid.
- Drop old habits: shouting, prefill,
budget_tokens, sampling parameters, blanket "always use the tool" rules.
- Keep untrusted text out of
system, put documents before questions, and check measurable rules in code.
- Keep history append-only, and test every prompt change, especially when the model changes.
Lesson recap: four families of prompt mistakes and how to avoid them.
Quick quiz
- What happens if a request to Claude 4.6 or later ends with a prefilled assistant message?
- Why can "If in doubt, use the tool" backfire on current models?
- Which two request settings from older tutorials can return a 400 on Claude 4.7 and later?
- Why is it risky to rebuild or summarise earlier messages in place between requests on some current models?
- Does passing the prompt-review script mean a prompt is good?
Answers and explanations
- A 400 error: prefill on the last assistant turn isn't supported there.
- Current models are more proactive, so a blanket rule can make them call tools they don't need. State when the tool helps instead.
budget_tokens for manual thinking, and non-default temperature, top_p or top_k values.
- It can invalidate the thinking blocks already in the history. Keep it append-only and use mid-conversation system messages or server-side context management for changes.
- No. It only flags some smells. Quality is measured with an evaluation set.
Official references and further reading
Related tutorials