Beginner · Lesson 3 of 6 · 14 min
Prompting basics
Write prompts that work the first time and keep working: clear instructions, a system prompt, a few good examples and a fixed output format.
Be clear and direct
Anthropic's prompting guide suggests treating the model like a brilliant but new employee who lacks context on your norms. It will not guess your audience, your tone or what a good result looks like unless you say so.
Compare 'Summarise this lead' with 'Summarise this lead in one sentence for a sales rep who will call them today. Include what they want and any deadline they mention. If no deadline is mentioned, say none given.' The second prompt states the reader, the purpose, the content and what to do when information is missing.
If you want more than the bare task, such as a suggested next step, ask for it explicitly. Vague prompts get generic answers.
System prompts set the standing rules
A system prompt holds instructions that apply to the whole conversation: the role, the audience, the tone and the rules that never change. In a chat app this is usually called project instructions or custom instructions. In an API call it is a separate system field.
Even one sentence of role helps. 'You are a support triage assistant for a home services company' focuses the model before it sees any ticket. Put stable rules in the system prompt and the changing input, such as the actual ticket, in the user message.
Show it examples
Asking with no examples is called zero-shot prompting. Adding a few worked examples is few-shot prompting, and Anthropic calls examples one of the most reliable ways to steer format, tone and structure. Its guide suggests three to five examples for best results.
Good examples mirror your real inputs, cover edge cases such as an angry customer or a message with no useful detail, and vary enough that the model does not copy one surface pattern. Wrap them in tags such as <example> so the model can tell examples from instructions.
Structure the ask and fix the output
When a prompt mixes instructions, background and input, separate them with descriptive tags such as <instructions>, <context> and <ticket>. This reduces the chance the model treats your data as instructions or the other way round.
Then fix the output shape. If a person reads it, give headings. If an automation reads it, ask for exact fields and a fixed list of allowed values, and include an option for when the model is unsure. That last option is what stops a confused model from forcing a wrong label.
SYSTEM:
You are a support triage assistant for a home services company.
USER:
<instructions>
Classify the ticket into exactly one category: billing, scheduling, complaint, other.
If you cannot tell, use other.
Reply with two lines only:
category: <one category>
summary: <one sentence, under 25 words>
</instructions>
<examples>
<example>
<ticket>I was charged twice for last Tuesday's visit.</ticket>
category: billing
summary: Customer reports a duplicate charge for last Tuesday's visit.
</example>
<example>
<ticket>Can the plumber come Friday instead of Thursday?</ticket>
category: scheduling
summary: Customer asks to move the plumbing visit from Thursday to Friday.
</example>
</examples>
<ticket>
{{ticket_text}}
</ticket>Key points
- ◆State the reader, purpose, content and what to do when information is missing.
- ◆Put stable rules and role in the system prompt and the changing input in the user message.
- ◆Three to five relevant, varied examples are one of the most reliable ways to steer output.
- ◆Separate instructions, context and input with descriptive tags.
- ◆Fix the output format and include an explicit option for uncertain cases.
Terms in this lesson
Try it · exercise
Build a ticket triage prompt, test it zero-shot, then improve it with examples and compare.
- Write five short, realistic support tickets, including one vague ticket and one angry one.
- In a free chat app, run the prompt from this lesson without the <examples> block against each ticket.
- Add the examples block back, plus one example of your own for the vague case, and rerun all five tickets in a fresh chat.
- Record the category and format each version produced for every ticket.
You're done when: You have a five-row comparison, and the few-shot version returns exactly two lines in the category/summary format for all five tickets, with the vague ticket labelled other.
