OverpayingForAIPricing desk

Lesson 5 of 8 · 10 min read · Beginner

Prompting Claude: the basics that actually matter

Claude responds to clear structure, explicit format and honest context. Three before-and-after examples show the difference, plus the two Claude-specific tricks worth knowing.

In this lesson you will

  • Build a prompt from the five parts that get first-time answers
  • Rewrite a vague request into a precise one (three worked examples)
  • Use XML-style tags and examples the way Anthropic's own guide recommends

Good prompting is cheaper prompting. A precise request costs a few hundred extra tokens and saves the two or three retries that cost thousands — or, on the free tier, the retries that push you into the limit. The structure below is what Anthropic's own prompting guide recommends, compressed to what beginners actually need.

Anatomy of a prompt that works first timeFive parts. Most bad answers are missing two of them.RoleWho the model should be
“You are a pricing analyst…”
TaskThe one thing you want
“Rank these 4 plans by cost per 1K tokens.”
ContextFacts it cannot guess
paste the plan table, your usage
FormatShape of the answer
“a table, then a 2-line verdict”
ConstraintsWhat to avoid
“no marketing language; cite the source”
Cost angleA precise prompt costs a few hundred tokens more and saves the two or three retries that cost thousands.Asking for a short format (“3 bullets”) cuts output tokens — the expensive kind — by half or more.
Figure 1.Role, task, context, format, constraints. Most disappointing answers are missing the context or the format.

Example 1: writing

BeforeAfter
Write an email to my landlord about the broken heater.You are helping a tenant write a firm but polite email. Context: heater has been broken 9 days, two calls unanswered, lease clause 7 requires repair within 7 days (pasted below). Task: request repair within 48 hours and state I will contact the tenancy authority otherwise. Format: under 150 words, no legal threats beyond that one sentence. Constraint: plain language, no exclamation marks.

The 'after' version is longer to write and produces a usable email on the first try. The 'before' version produces a generic draft you then spend three turns fixing — three turns that each re-read the whole conversation.

Example 2: analysis

BeforeAfter
Which AI plan should I get?Here is my last month's usage: about 25 chats a day, mostly short, two long research sessions a week with PDFs, no coding. I am on Claude Free and hit the limit most afternoons. Compare Claude Pro against using the API through a third-party client. Output: a two-column table of monthly cost and friction, then a one-sentence recommendation. Assume the prices in this pasted table.

Example 3: coding

BeforeAfter
Fix this code.The function below should return the cheapest model for a given token count but returns nothing for counts above 100k. Language: TypeScript. Find the bug, explain it in two sentences, then return the corrected function only — no other changes, keep the existing style.

Two Claude-specific tricks

  • Tags for structure. Claude was trained to respect XML-style tags. Wrap pasted material in <document></document> and instructions in <instructions></instructions> and it will stop confusing the two — which matters when the document itself contains instructions.
  • Show, don't describe. One or two examples of the output you want (<example></example>) beat a paragraph describing it. This is the single biggest quality lever for formatting tasks like extraction and rewriting.
textA reusable prompt skeleton for Claude
You are a <role>.

<instructions>
<task in one sentence>
Output format: <table / bullets / JSON / word limit>
Constraints: <what to avoid>
</instructions>

<document>
<paste the material here>
</document>

<example>
<one example of the exact output shape you want>
</example>

Knowledge check

Claude keeps following instructions that were inside a document you pasted, not yours. What is the fix?

Lesson FAQ

Should I be polite to Claude?

It does not change the answer quality, and it costs a few tokens. Clear beats courteous. That said, a natural tone is fine; just do not pad.

How long can a prompt be?

Up to the context window — a million tokens on current Sonnet, Opus and Fable. In practice, put long material in a project or the system prompt so it is not re-sent every turn.

Does the same prompt work on ChatGPT and Gemini?

Mostly. The five-part structure is universal. The XML-tag habit is Claude-specific; other models tolerate it but were not trained on it the same way.

Finished reading?

Mark it done to track your progress through the course.

Compare, calculate, decide — for Claude

If our calculators helped you cut down on hidden AI wallet leaks, consider buying us a coffee. A tiny fraction of your savings keeps our pricing indexes updated daily.

Not sure which AI is cheapest for your use case? Find out in 30 seconds — no signup required.

AI cost intelligence

Stop overpaying for AI tools

Join the OverpayingForAI list for pricing updates, cheaper alternatives, and practical buying guidance.

Now tracking 50+ AI tools, models, platforms, subscriptions, coding tools, and automation products.

We use your email only for OverpayingForAI updates. Unsubscribe anytime.