The Claude Code Prompting Playbook
Prompt like an engineer: start from evals, clean up before you optimize, give tools instead of pleas, state both sides of every trade-off, and decompose hard tasks into a generate-evaluate-repair loop.
Guillaume Rufenacht
AI Product Manager · Lisbon
Most prompting advice is a list of do’s and don’ts you can’t verify. The version Anthropic’s own engineers use is different: it starts from evals, treats a prompt like code you debug one failure at a time, and knows when the answer isn’t a better prompt at all. Here’s that playbook, the way I apply it to production LLM work.
Two situations cover almost everything: you’re maintaining a prompt that’s drifting (often after a model migration), or you’re building a new agent from scratch. The techniques overlap, and they’re the same ones behind the pipelines at Geonimo.
Key takeaways
- Start from evals: a control case, edge cases you've failed before, and capability boundaries (hand off or refuse). Without them you're guessing.
- Apply hygiene first: structure with XML tags, separate policy from tone from data, delete redundant junk and stale patches.
- Instructions don't add capability. Telling the model to 'calculate correctly' won't help, give it a tool.
- State both sides of a trade-off. One-sided instructions make the model overfit; modern models judge well when given the full picture.
- When one prompt can't do it all, split into a generate, evaluate, repair loop, often cheaper and more reliable than a bigger model.
Start from evals, not opinions
You can’t tell whether a prompt change helped unless you measure it. So before touching the wording, build a small eval suite. It needs three kinds of cases: a control that should always pass (unambiguous, the model handles it easily), edge cases where you’ve seen the model fail before (so regressions can’t sneak back), and capability boundaries, where the right move is to hand off to a human or refuse outright. With that suite, every change becomes a measurable experiment instead of a vibe.
Clean up before you optimize
Most underperforming prompts improve just from hygiene. Real prompts accumulate cruft: instructions copied from a website, a line telling the bot it’s human, patches for three models ago, all mashed into one paragraph. Fix the structure first. Use XML tags to separate role, guidelines, policy, tone, and data. Remove the redundant text. The rule I keep coming back to: if you’re reading a prompt and can’t tell the guidelines from the policy from the data, the model can’t either. Then add an output contract, define the output format, and enforce it in the harness with a stop sequence or structured outputs when the schema is complex.
Target failure modes one at a time
With a clean prompt and a failing eval, fix one failure mode at a time. Three patterns come up constantly:
The model withholds information it actually has
The model does shaky mental math
The model optimizes for the wrong side of a trade-off
The mental model
Building new: it’s prompt, model, and harness
From scratch, the prompt is only one of three levers, the model and the harness matter just as much. Hill-climb across all three. A real example: a scheduling agent failed every case on a small model with a simple prompt. A larger model reduced the errors but still failed. The larger model with adaptive thinking finally passed, but tripled tokens and latency. A smaller model with a much better prompt got partway. What won was going agentic: splitting the job into three simple prompts, a generator, an evaluator that reports specific violations, and a repairer that fixes them, which solved every case with lower cost and latency than brute force.
That generate-evaluate-repair loop has a bonus: you can inject soft constraints at runtime (“keep Harry and Sally on different shifts”) without rewriting the backend. Choosing among prompt, model, and harness is a cost / latency / quality decision, exactly the kind of trade-off I make daily on production pipelines, and the through-line of how I build.
The takeaway
This pairs with the habits Anthropic’s team uses and how to decide between tools, skills, and subagents. If you want help making your AI systems reliable in production, let’s talk.
Frequently asked questions
What's the first step to improving a prompt?
Build an eval suite: a control case, edge cases you've failed before, and capability boundaries. You can't tell whether a wording change actually helped without measuring it against fixed cases.
Why won't telling the model to do it correctly work?
Because instructions don't add capability. Telling a model to always calculate correctly doesn't make it better at mental math. The fix is to give it a tool that performs the task reliably and let the model decide when to call it.
Why does my prompt withhold information it has?
Often a stale defensive patch from an older model that newer, better instruction-following models overfit to. Remove the outdated patch, give a balanced instruction, and keep defensive changes under version control so you know why each exists.
When should I split one prompt into multiple?
When a single prompt can't reliably do everything, decompose into a generate-evaluate-repair loop: one prompt drafts, one reports specific violations, one fixes them. It's often cheaper and more reliable than reaching for a bigger model.
Work with me
Want a system like this built for your pipeline?
I help teams take AI from a clever prototype to dependable production, outbound engines, lead intelligence, and the LLM pipelines underneath. See what I have shipped or get in touch.