Master Claude's literal instruction-following, Extended Thinking, and XML-based prompting style.
Claude threw me off when I first switched from ChatGPT. I'd write prompts that worked fine in GPT, and Claude would give me... exactly what I asked for. Nothing more. At first I thought it was broken. Turns out, that's the point.
Claude from Anthropic works differently. Claude 4.5 Opus hit 82% on SWE-bench - best in the industry for coding tasks. But to get that kind of performance, you need to understand how it thinks.
Here's what I figured out.
Claude does exactly what you ask. Literally. Not more, not less.
With ChatGPT, if you ask for a summary, it might add suggestions, caveats, related ideas. Claude won't. If you didn't ask for suggestions, you're not getting suggestions.
This sounds limiting, but it's actually powerful. You get predictable, controllable outputs. The catch? You have to be explicit about everything you want.
Ask for a list of 5 items, you get exactly 5 items. Ask for analysis without recommendations - no recommendations. This isn't a bug, it's the design.
What this means in practice:
Claude has built-in reasoning. When you enable Extended Thinking, the model "thinks" internally before responding.
Important: if you're using Extended Thinking, don't add stuff like "think step by step." It's already doing that. Adding it manually can actually make things worse.
Anthropic's official documentation explicitly recommends XML tags for structuring prompts. Not Markdown, not plain text - XML.
This is unique to Claude. You can pre-fill the start of the response to force a specific format.
{"role": "assistant", "content": "{"}
This makes Claude continue in JSON format. You can do similar things with other formats.
Here's what Anthropic recommends:
<role>
You are a senior data analyst specializing in sales analytics.
</role>
<instructions>
Analyze the provided dataset.
Focus on:
1. Revenue trends
2. Anomaly detection
</instructions>
<documents>
<document index="1">
<source>sales_q4_2025.csv</source>
<document_content>{{DATA}}</document_content>
</document>
</documents>
<constraints>
- Use only provided data
- Cite specific evidence
- Be concise
</constraints>
<output_format>
1. Executive Summary (2-3 sentences)
2. Key Findings with evidence
3. Recommendations (prioritized)
</output_format>
<query>
What are the main drivers of revenue decline in EMEA region?
</query>
Claude won't guess what you meant. Tell it.
Bad:
Analyze the data
Good:
<instructions>
Analyze the sales data and provide:
1. Top 3 performing products by revenue
2. Month-over-month growth rate
3. Seasonal patterns if any
Include specific numbers and percentages.
</instructions>
This one surprised me. Putting your documents at the start of the prompt and your question at the end improves quality by up to 30%. Not sure why, but it works.
<documents>
[Long document here]
</documents>
<query>
[Your question at the very end]
</query>
If Extended Thinking is on, remove all of these:
The model already does this. Adding more just adds noise.
For guaranteed JSON:
{"role": "assistant", "content": "{"}
For structured response:
{"role": "assistant", "content": "## Analysis\n\n"}
<instructions>
Answer ONLY based on the provided document.
First quote relevant passages, then provide your answer.
If the information is not in the document, say "Not found in the provided document."
</instructions>
<document>{{CONTENT}}</document>
<output_format>
<quotes>Relevant quotes from the document</quotes>
<answer>Your answer based on the quotes above</answer>
</output_format>
<instructions>
Create a function based on the requirements below.
Include:
- Type hints for all parameters and return values
- Comprehensive docstrings
- Error handling for edge cases
- Unit tests with pytest
</instructions>
<requirements>
{{REQUIREMENTS}}
</requirements>
<examples>
<example>
<input>{{SAMPLE_INPUT}}</input>
<output>{{SAMPLE_OUTPUT}}</output>
</example>
</examples>
<constraints>
- Follow PEP 8 style guide
- Handle edge cases explicitly
- Log errors appropriately
</constraints>
<role>
You are a senior business analyst with expertise in e-commerce metrics.
</role>
<instructions>
Analyze the provided sales data and identify:
1. Key performance trends
2. Anomalies or outliers
3. Actionable recommendations
</instructions>
<data>
{{CSV_DATA}}
</data>
<output_format>
Structure your response as:
1. Executive Summary (2-3 sentences)
2. Detailed Findings (with specific numbers)
3. Recommendations (prioritized by impact)
</output_format>
| Aspect | Claude 4.5 | ChatGPT | Gemini |
|---|---|---|---|
| Recommended format | XML (gold standard) | Markdown + XML | XML or Markdown |
| Reasoning | Extended Thinking | reasoning_effort param | Thinking levels |
| Chain-of-Thought | Built-in (don't add) | Needs explicit instruction | Built-in |
| Instruction following | Literal | Interpretive | Moderate |
| SWE-bench | 82% (best) | ~75% | ~70% |
Adding CoT to Extended Thinking - redundant, can hurt performance
Vague instructions - Claude won't fill in the gaps for you
Documents at the end - put them at the top
Ignoring prefilling - powerful tool for format control
Using Markdown for complex tasks - XML structures better
<constraints> for restrictions and prohibitions<examples> - few-shot works greatClaude requires more explicit instructions than GPT, but that makes responses more predictable and controllable. XML tags are your main tool for structuring complex tasks.
Key points: