Learn how to structure prompts to get clearer, more useful responses from Claude.
Build AI-powered chatbots by understanding how to assign roles and control output format.
Reduce hallucinations and false information in AI responses using proven techniques.
Develop industry applications like legal document analysis or financial report generation.
Requires Anthropic API key and Claude 3 Haiku access to run notebook cells.
This repository is Anthropic's official interactive tutorial for learning prompt engineering, the skill of writing clear, effective instructions for AI language models like Claude. Prompt engineering matters because the way you phrase a question or task to an AI has a dramatic effect on the quality of the response; understanding how to structure prompts separates people who get frustrating or generic outputs from those who get precise, useful results. The tutorial is structured as a series of Jupyter Notebooks (interactive documents that mix explanatory text with runnable code) organized into nine chapters. The chapters progress from beginner to advanced topics: the basics of prompt structure, how to be clear and direct, how to assign the AI a specific role, how to separate data from instructions, how to control formatting, how to prompt the AI to think step by step before answering, how to provide examples, how to reduce hallucinations (when an AI confidently states false information), and finally how to build complex prompts for real industry use cases like chatbots, legal services, and financial analysis. An appendix covers more advanced patterns like prompt chaining and tool use. Each chapter includes an "Example Playground" section where you actively experiment by running prompts yourself and observing how small changes to the wording change Claude's output. This hands-on approach is central to the design, you learn by doing rather than just reading. You would use this tutorial if you are new to working with Claude or AI models and want a structured foundation for writing better prompts, or if you are an experienced developer building AI-powered products and want to understand Anthropic's recommended techniques more deeply. The tech stack is Jupyter Notebook, running Python to call the Anthropic API (using Claude 3 Haiku as the model by default). An alternative Google Sheets version is also available for users who prefer a spreadsheet interface.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.