Skip to content

Building with agents, lesson 2.1

Prompting techniques, and when each applies

There are only a handful of prompting techniques, and each fixes a different kind of fault. This lesson walks through them from cheapest to dearest, and shows how to match the fault to the fix.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

Before any technique, know what good looks like

A technique is a fix, and you can only fix what you can measure. So first write down what a good answer looks like for answering customers, and collect three to five real cases to test with. Then each technique below is a change you can check.

Anthropic's own prompting guide (read November 2026) starts the same way: have success criteria, a way to test against them, and a first draft, before you start changing the prompt.

Step 2 of 6

Say it plainly

Most bad answers come from missing facts, not a weak model. Say the job, who it is for, the format, the limits and what done looks like. A prompt that would confuse a colleague who has never seen the task will confuse the model too.

The same guide says to treat the model as "a brilliant but new employee who lacks context on your norms and workflows", and to test a prompt by showing it to a colleague.

Step 3 of 6

Say why

A bare rule gets followed to the letter, or bent. A rule with a reason gets applied sensibly. "Never use ellipses" works less well than "never use ellipses, because this is read aloud by a speech program that cannot say them".

Step 4 of 6

Show, then label

Some things are easier to show than describe: a tone, a layout, a way of sorting. Put three to five good examples in the prompt, and make them differ in the ways that do not matter. When the prompt mixes instructions, documents and examples, wrap each in its own named tag, like <policy> or <email>, so nothing is read as the wrong thing.

The GPT-3 paper (Brown et al., 2020) showed a model could pick up a task from a few examples in the prompt, with no extra training. Anthropic suggests three to five, varied, each in its own tag.

All three of your examples happen to be under 50 words. What will its answers be like?

Step 5 of 6

Room to think

For a hard problem, an answer written straight off is often wrong. Letting the model reason first helps. Many current models now think before answering by default, with a setting for how hard. On those, asking it to "think step by step" is ordinary text, not a switch.

Wei et al. (2022) named this chain of thought: showing a model worked reasoning in eight examples lifted its maths scores sharply. Anthropic's docs (November 2026) now treat a written "think it through" as a fallback for when built-in thinking is off.

Step 6 of 6

Split the job

When one prompt does several things, the step you care about most is often the one it rushes. Split the job into separate calls: draft, check against your rules, then fix. You can read what each step produced, and stop the chain when a step fails. For answering customers, that usually means making the check its own call.

Its answers come out in the wrong format. Which technique do you try first?

Which technique fixes it?

Here are four faults in the AI in your business. Sort each one into the cheapest technique that would fix it.

  1. 1Your support agent writes three paragraphs when you wanted two lines and a tracking link.

  2. 2Its replies are correct but stiff. You have five past replies from your best staff that sound exactly right.

  3. 3You paste the returns policy and the customer's email into one prompt. Sometimes it treats a line of the policy as something the customer said.

  4. 4One prompt writes the reply, checks it against the refund rules and translates it. The check is the step that gets skipped.

0 of 4 right so far, 4 to go.

Which technique, when

This is what you keep: each kind of fault and the technique that fixes it, on one card.

Which technique, when

  1. Before any technique: write what good looks like, and gather three to five real cases to test with.
  2. Wrong length, format or scope: say it plainly, with the number, the file or the format, and the reason.
  3. Wrong tone or shape: show three to five examples that differ in the ways you do not care about.
  4. Mixed-up inputs: put each document, email or example in its own named tag.
  5. Hard reasoning: give it room to think, or raise its thinking setting.
  6. A long job that skips a step: split it into separate calls and read the middle one.

Try the cheapest technique that fits the fault, change one thing at a time, and rerun the same test cases after each change.

Next: Lesson 2.2: Research, plan, implement. How to have an agent read first, write a plan you can check, and only then change code.