Minideas

Idea 11 of 15 · The Claude API

Testing a prompt

One good answer proves little. Score a prompt on many questions, then improve it.

Where is my order?one trylooks great20 questions4 go wrong
1 / 4

One good answer proves little

A prompt that handles the question you tried can still fail on the next hundred. Test it the way you’d test code: on many inputs, with a score. This is called a prompt evaluation, or eval.

Claude draftsdozenstest setWhere is my order?3 WEEKS, NOTHING???angryĐơn tôi đâu rồi?VietnameseI want a refund.refundwhere's my orderduplicateyou read them and keep the good ones
2 / 4

Build a test set

Collect realistic questions, including awkward ones: an angry customer, one writing in another language, one asking for a refund. Claude can draft dozens for you; read them and keep the good ones.

reply to an angry customerOrder ORD-418shipped Tuesday.graded by codehas order numberunder 100 wordsgraded by a model6/10right, butno apologycode for clear rules, a model for judgment
3 / 4

Grade with code, or with a model

Some checks are plain code: does the reply include the order number, is it under 100 words? Others need judgment, like tone or whether it really helps, so a second request asks Claude to score each answer from 1 to 10 against your checklist and explain why.

average score6.1v17.4v26.9v3keep version 2
4 / 4

Change, rerun, compare

Each version of the prompt gets an average score. Change one thing, rerun the whole set and keep the change only if the score goes up. Version 3 sounded better but scored lower, so version 2 stays.

Swipe the card, or use the arrow keys.

Go deeper

Each card stack gives you the idea. These open resources go into the detail.

Notes on the Claude Partner Network learning path on Anthropic Academy.