πŸ“ Blog

How to Write Claude Prompts That Actually Work (2026 Guide)

πŸ—“οΈ Published ⏱️ 14 min πŸ‘€ By Promptolis Editorial

Most "how to write prompts" content treats all LLMs as interchangeable. They're not. Claude responds to prompts differently than ChatGPT, Gemini, or Llama β€” enough that the same prompt can produce dramatically different outputs across models. If you're defaulting to Claude for complex reasoning (and you probably should be for many tasks), the prompting techniques in this guide will measurably improve your output.

This isn't a generic rehash. It's the Claude-specific patterns that Anthropic's own documentation emphasizes, plus the ones we've seen produce 2-3Γ— better output over months of building Promptolis Originals.

Why Claude is different

Claude (particularly Sonnet 4.5 and Opus 4) has three quirks worth understanding:

1. It responds strongly to structure. XML-tagged input performs measurably better than unstructured text. Where ChatGPT is fine with "please summarize this," Claude produces better output with ...summarize....

2. It takes instructions literally. If you say "think step by step," it will show its work. ChatGPT often skips this even with the same instruction. Claude's compliance to instructions is generally tighter.

3. It handles long context better. Claude's 200K+ context window isn't just bigger β€” it's more usable. The "lost in the middle" problem that plagues GPT is less severe. You can paste full documents and get accurate retrieval.

These three differences drive everything in the rest of this guide.

The XML structure method

Why XML works

LLMs are trained on vast amounts of XML-tagged content (HTML, technical docs, etc.). When you wrap your prompt components in XML tags, the model parses them as distinct semantic units rather than one continuous text blob. For Claude specifically, Anthropic has published research showing XML-tagged prompts produce better output on complex tasks.

The basic structure

```

You are a senior software engineer specializing in backend performance.

Review the Python function below. Identify performance issues.

def process_orders(orders):

result = []

for o in orders:

user = db.query(User).filter_by(id=o.user_id).first()

result.append({'order': o, 'user': user.name})

return result

  • Primary performance issue (what and why)
  • Severity (critical / high / medium)
  • Suggested fix with code example

```

This structure beats plain-text framing by ~30-50% on complex technical tasks based on A/B testing in prompt libraries.

Tags that matter most

  • β€” who Claude is (primes vocabulary, tone, reasoning style)
  • β€” what to do
  • or β€” relevant situation
  • or specific input tags β€” the content to process
  • β€” hard rules
  • β€” expected structure of response
  • β€” few-shot examples (dramatically improves consistency)

Tags are arbitrary β€” works too. Claude uses them as parsing hints, not as a schema it requires.

Chain-of-thought (the Claude way)

Most chain-of-thought (CoT) tutorials teach you to say "think step by step." That works. But Claude-specific CoT works better when you give it an explicit thinking space:

```

Determine whether the following argument is valid.

All birds can fly. Penguins are birds. Therefore, penguins can fly.

Before answering, work through this in the tag below.

Don't show the thinking to the user β€” I'll strip it. Just use it to reason.

```

The tag explicitly gives Claude a reasoning space. The tag indicates where the user-facing output belongs. Claude has been shown to produce measurably better answers when the thinking is scaffolded like this vs. asking for one-shot answers.

This is the technique behind many of our Promptolis Originals β€” every Original that requires structured reasoning uses this pattern.

The "show, don't tell" principle

Claude is exceptional at pattern-matching from few-shot examples. If you want a specific output style, show it:

```

Convert the following job titles into humble-brag LinkedIn headlines.

Input: "Software Engineer at Google"

Output: "Shipping what you use daily @ Google Β· Writing code that runs at 2B-user scale"

Input: "Marketing Manager"

Output: "Turning marketing budgets into revenue Β· B2B SaaS $5M-$50M segment"

Accountant at KPMG

```

Three examples usually out-perform any amount of verbal instruction about tone. This matters for: brand voice consistency, specialized formats (legal, medical, technical writing), and anything where "generic" isn't good enough.

Common Claude-specific mistakes

Mistake 1: Polite fluff

Claude was trained heavily on instruction-following + RLHF. "Please," "could you," "I'd appreciate" add tokens and don't improve output. Say the task directly.

Mistake 2: Too much role

"You are an expert software engineer with 20 years of experience at FAANG companies specializing in distributed systems and..." β€” Claude extracts the first 3-5 relevant descriptors and ignores the rest. Use 1-2 specific role descriptors, not a mini-bio.

Mistake 3: Confused constraints

"Write a blog post. Make it short. Actually make it long. Use headers. No wait, use bullets." β€” Claude tries to satisfy all constraints, resulting in output that satisfies none cleanly. Resolve conflicts before prompting.

Mistake 4: Asking Claude to self-evaluate

"Is this a good prompt?" β€” Claude's self-evaluation is almost always positive (training bias). If you need evaluation, use a separate session with fresh context.

Mistake 5: Over-stacking in one prompt

"Summarize this document AND translate it to Spanish AND find inconsistencies AND rate it 1-10." β€” Split into sequential prompts. Each task is cleaner, each output is better, and you can iterate on weak spots.

Claude vs. ChatGPT: when to use which

  • Long-document analysis (up to 200K+ tokens)
  • Complex reasoning (multi-step logic, math, strategy)
  • Code review and refactoring
  • Careful, nuanced writing (fiction, legal, medical)
  • Anything where you want instructions followed exactly
  • Fast, short-form tasks (emails, quick answers)
  • Multimodal (images + text together)
  • Real-time information (when web-enabled)
  • Tool use (function calling, browsing, code interpreter in ChatGPT Pro)
  • Voice interaction
  • Large multimodal reasoning (long videos, multi-document)
  • Google ecosystem integration (Sheets, Docs, Workspace)
  • Cost-sensitive bulk work (Gemini Flash is cheap)

If you're doing serious knowledge work, Claude is likely your daily driver. If you're doing breadth with occasional depth, ChatGPT. If you're embedded in Google infrastructure, Gemini.

5 copy-ready Claude prompts

```

[paste text]

Produce a summary in three parts:

  • One-sentence thesis
  • Three key arguments
  • Strongest counter-argument the author didn't address

```

```

Senior Python engineer focused on production readiness.

[paste code]

Review for: correctness, performance, security, maintainability.

Rank top 3 issues by severity. Suggest specific fixes with code.

```

```

I'm deciding whether to [X] vs [Y].

Context: [background].

Constraints: [time, money, relationships].

Run a pre-mortem: imagine it's 2 years from now and I chose [X] and it failed.

Write the 3 most plausible failure stories.

Then do the same for [Y].

Then compare which failures are more survivable.

```

```

[paste draft]

Edit for concision. Cut 30% of words without losing meaning.

Flag any sentence that's vague or unclear.

Suggest 2 stronger openings.

```

```

[describe situation]

Write a 1-page brief answering:

  • What's the core decision I'm avoiding?
  • What are my real options (3-5)?
  • What's the 30-day version of each option?
  • What would change my answer?

```

The meta-principle

Claude rewards specificity. Every additional constraint, example, or format instruction that you add typically improves output β€” up to a point. The point of diminishing returns is usually around 200-400 words of prompt for complex tasks.

Below that, you're under-specifying. Above that, you're confusing the model.

If you want to see these principles applied professionally, browse the Promptolis Originals β€” every one is built with Claude-optimized XML structuring, chain-of-thought scaffolding, and explicit output formatting. The Originals are MIT-licensed so you can copy their structure and adapt for your use cases.

Tags

Claude Anthropic Prompt Engineering XML Guide

Related articles

← Back to blog