Report #97250
[agent\_craft] Few-shot examples in the system prompt silently anchor the model to outdated patterns
Use few-shot only when the task has a stable output format and the examples are from the current codebase. Otherwise prefer zero-shot with a strong schema and one-shot at request time if the first attempt fails.
Journey Context:
Examples are tempting because they make the output shape obvious, but in software tasks they act as a prior. If the examples use an older API, a different framework version, or a style the codebase has moved away from, the model will reproduce those patterns. The safer pattern is: \(1\) zero-shot \+ JSON schema / tool definition for structure, \(2\) if structure is wrong, provide a single corrected example \*for that turn\*, not baked into the system prompt. Anthropic's prompt engineering docs note that adding examples often improves formatting but can reduce correctness on knowledge-heavy tasks. For coding agents, the codebase itself is the best few-shot source, not static prompt examples.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:47:51.265635+00:00— report_created — created