Anthropic Prompt Engineering Documentation
Anthropic's official, free guide to prompting Claude, written by the team that trains the model and updated as new models ship. It covers clarity, context, examples, XML structure, roles, long documents, output format, thinking, tool use and agentic systems. It suits developers building on any large language model who want techniques that work on current models rather than tricks from two generations ago.
Free
platform.claude.com docs · Sept 2026
38.3k GitHub stars
GitHub (anthropics/prompt-eng-interactive-tutorial) · Sept 2026
Guide
AI & Machine Learning
Anthropic
A few hours
All
Free
How the documentation is organised
There are two pages to know. The overview is short and sets conditions before any technique: you should have clear success criteria, a way to test against them, and a first draft prompt. If you lack those, it points you to guidance on defining success criteria and building evaluations, and to a prompt generator notebook in the Claude Cookbook for a first draft. It also makes a useful point: not every failure is a prompting problem. Latency and cost are often better fixed by choosing a different model.
The techniques themselves live on one long page, Prompting best practices, which Anthropic calls the living reference. It is organised into three parts:
- Model-specific guidance, where a particular model behaves differently and what to change in your prompt.
- Techniques for all current models: general principles, output and formatting, tool use, thinking and reasoning, and agentic systems.
- Migration considerations, for prompts moving from earlier model generations.
The techniques that fix most problems
- Be clear and direct. Say exactly what you want, including format and scope, as you would to a capable new colleague with no context.
- Add context. Explain why a rule exists, not only what it is. The model generalises better from reasons.
- Use examples. A few varied examples of the output shape beat paragraphs of description.
- Structure with XML tags to separate instructions, documents and data.
- Give a role when the task needs a particular perspective.
- Long context: put long documents near the top, before the question.
- Control output format by describing what you want rather than listing what to avoid.
The sections most guides do not cover
Later sections go well beyond basic prompting, and they are the main reason developers building real products keep coming back:
- Tool use, including getting the model to call tools in parallel.
- Thinking and reasoning, including how to rein in overthinking on simple tasks.
- Agentic systems: long tasks with state tracking, balancing autonomy with safety, research, orchestrating subagents, chaining prompts, and avoiding code that hardcodes answers just to pass tests.
- Capability tips for vision and frontend design work.
Why the vendor version matters
Prompting advice ages quickly. A clear example: prefilling the start of the assistant's reply was a standard trick, and the documentation now states that prefilled responses on the last assistant turn are no longer supported starting with the Claude 4.6 models, returning an error instead. It has a dedicated section on migrating away from prefill for each common use. Third party guides written earlier still recommend it. Reading the source keeps you current, and the page names the specific models its advice applies to.
How to work through it
- Read the overview and the general principles in one sitting, about an hour.
- Take one real prompt you use and apply the techniques one at a time, checking the output against your success criteria after each change.
- Build a small set of test inputs before you tune anything, so improvements are measured rather than guessed.
- Return to the tool use, thinking and agentic sections when you start building with them.
If you learn better by doing, Anthropic also links an interactive prompting tutorial on GitHub (about 38k stars as of September 2026) and a lighter version as a Google Sheets tutorial.
Common questions
Is it only useful for Claude? No. Most principles, such as clarity, examples, structure and context, transfer to other models. The model-specific sections are the Claude-only part.
Is it free? Yes. The documentation and the tutorials are free to read.
Do I need to code? Not for the general principles. The tool use and agentic sections assume you are building with the API.
How often does it change? It is updated as new models are released, which is why it is worth rereading when you switch models.
Best for: anyone building on a large language model, whichever provider they use, since most of the principles transfer.
Ready to start?
Opens on Anthropic in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.