How to write prompts for Claude using XML tags to get scary-good...

@JafarNajafov
Jafar Najafov@JafarNajafov
24 views Aug 04, 2025 ~2 min read
Advertisement
1
How to write prompts for Claude using XML tags to get scary-good results:
Media image
2
Why XML?

Claude was trained on structured, XML-heavy data like documentation, code, and datasets.

So when you use XML tags in your prompts, you’re literally speaking its native language.

The result? Sharper, cleaner, and more controllable outputs.

(Anthropic says that XML tag prompts gets best results)
Media image
3
Why it works:

✅ Clarifies intent
✅ Mimics Claude's training structure
✅ Boosts reasoning + structure
✅ Reduces hallucination

Now let’s dive into 5 🔥 real-world use cases:
4
AI Research Assistant

Plain prompt:

Find the top 3 recent papers on retrieval-augmented generation and summarize each in 2 sentences.

XML version:

Research and summarize
Retrieval-Augmented Generation (RAG)
3 research summaries
2 sentences per paper
5
LinkedIn Post Writing

Plain prompt:

Write a LinkedIn post about how AI freelancers are changing traditional employment.

XML version:

Write
LinkedIn post
Rise of AI freelancers
Highlight disruption of traditional work
Insightful and engaging
6
Code a Simple App

Plain prompt:

Build a Python script that takes a URL, extracts all links on the page, and saves them to a CSV.

XML version:

Code
Python
Extract all links from a URL and save to CSV

Use requests and BeautifulSoup
CSV
7
Create a Slide Outline

Plain prompt:

Create a 5-slide outline for a presentation on the business impact of generative AI.

XML version:

Create slide outline
Business impact of generative AI
5 slides
Executives
Professional and persuasive
8
Here's the prompt template you can use:

[What to do]
[Optional subject]
[Output type: Email, Code, Slides]
[Casual, Formal, etc]
[Optional speaker]
[Who it's for]
[Your content or request]
[Length, style, language, rules]
9
Claude isn't just "another LLM".

When you use XML-style prompts, you unlock:

- Multi-step thinking
- Cleaner output
- Modular control
- Fast personalization

Stop prompting like it's 2022.

Start structuring like a prompt engineer.
10
P.S.

Want to master AI and build a thriving business for free?

I have a newsletter that helps over 140,000 people learn AI and monetize their skills.

Subscribe here for free: newsletter.nextool.ai/subscribe

You'll receive 7 of our best courses for free when you subscribe.
11
I hope you've found this thread helpful.

Follow me @JafarNajafov for more.

Like/Repost the quote below if you can:
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • LinkedIn & Instagram Carousel Maker
Create Free Account

Includes 7-day Premium trial

Advertisement