Categorical Examples
Show examples of what to report and what to ignore.
Why Categorical Examples Matter
When you give Claude a job that has a fuzzy boundary, vague instructions like "be more precise" rarely work. The model can't read your mind about where the line sits.
The reliable fix is categorical examples: a small set of 2-4 few-shot examples that show concrete cases of what to report and what to ignore. The model generalizes from these examples to new, unseen inputs — it does not merely repeat them.
This lesson shows how to build those examples for a classic architect task: deciding what is worth flagging and what is noise.
Explicit Criteria Beat Vague Adjectives
Before you even reach for examples, state an explicit criterion. Explicit rules consistently beat vague adjectives.
- Vague: "Review the code carefully."
- Explicit: "Flag a comment only when it contradicts the code it describes."
The explicit version draws a sharp line. Categorical examples then make that line unmistakable by pinning it to concrete cases on each side.
system = (
"You review code comments. "
"Flag a comment ONLY when it contradicts the code it describes. "
"Ignore style, tone, and outdated-but-harmless notes."
)