Prompt engineering

The practice of writing and structuring prompts to reliably get the output you want from an AI model. For agentic tools like Claude Code, prompt engineering is less about magic wording and more about giving the model clear goals, relevant context, concrete constraints, and examples of what good output looks like. Breaking a large goal into smaller, well-scoped tasks - rather than asking Claude to 'build my whole app' - is the single most reliable prompt engineering technique for getting quality results.

Prompt engineering is the practice of writing and structuring your instructions so an AI reliably produces the output you want. It is not about secret phrases or magic words; for an agentic tool like Claude Code it is about communication discipline - stating a clear goal, supplying the context the model needs, naming the constraints that matter, and showing an example of what good looks like. A well-engineered prompt removes ambiguity, and removing ambiguity is most of the battle.

The single most reliable technique is task decomposition: breaking a big goal into smaller, well-scoped pieces instead of asking Claude to 'build my whole app' in one shot. A large vague request gives the model too many decisions to make and too many ways to go wrong; a sequence of concrete tasks - 'create the database schema', then 'build the signup form', then 'wire it to the API' - keeps each step checkable and keeps you in control. Each small win also gives you something runnable to react to, which makes the next prompt sharper.

Good prompt engineering also leans on the rest of the system rather than cramming everything into one message. Standing context belongs in CLAUDE.md, not repeated in every prompt. Repeated workflows belong in slash commands. And when a first attempt misses, the fastest fix is usually to give the model more specific feedback - paste the exact error, point at the exact file, describe the exact behavior you wanted - rather than rewording the original request. Iteration with concrete feedback beats trying to write one perfect prompt.

Related terms

Put it to work

Learn it by building it

Definitions get you oriented. The club gets you shipping. Join Claude Code Club for $9/month.

Related: the full glossary, the learn hub, and our guides.