Anthropic's interactive tutorial on prompt engineering is an open-source educational course designed to provide a comprehensive step-by-step understanding of writing optimized prompts in Claude. After completing the course, learners will be able to master the basic structure of good prompts, identify common failure modes and learn the "80/20" techniques to address them, understand Claude's strengths and weaknesses, and build strong prompts from scratch for common use cases.
The course structure allows for extensive practice in writing and troubleshooting prompts. The course is divided into 9 chapters with accompanying exercises, as well as an appendix containing more advanced methods. It is recommended to study the chapters in order. At the bottom of each lesson there is an "example playground" area where you can freely experiment with the examples and observe how changing the prompt changes Claude's response. Answers are also provided.
Note: This tutorial uses Claude 3 Haiku, Anthropic's smallest, fastest, and cheapest model. Anthropic also has two other models, Claude 3 Sonnet and Claude 3 Opus, which are smarter than Haiku, with Opus being the smartest. This tutorial also exists on Google Sheets, using Anthropic's Claude for Sheets extension. That version is recommended because it is more user-friendly.
Table of contents: Each chapter contains a lesson and a set of exercises. Chapter 1: Basic prompt structure; Chapter 2: Clear and direct; Chapter 3: Assigning roles; Chapter 4: Separating data from instructions; Chapter 5: Formatting output and speaking for Claude; Chapter 6: Precognition (step-by-step thinking); Chapter 7: Using examples; Chapter 8: Avoiding hallucinations; Chapter 9: Building complex prompts (industry use cases) - Building complex prompts from scratch - chatbots, legal services complex prompts, exercise: financial services complex prompts, exercise: coding complex prompts, congratulations and next steps. Appendix: Beyond standard prompting - chain prompting, tool use, search and retrieval.