Anthropic's Free Prompt Engineering Course Hits 38,000 GitHub Stars
Anthropic's free, nine-chapter prompt engineering course on GitHub has crossed 38,000 stars, offering hands-on Jupyter notebooks with graded exercises against the Claude API.
Takeaways
- Anthropic's Interactive Prompt Engineering Tutorial has crossed 38,000 GitHub stars and 4,200 forks.
- Nine Jupyter chapters plus appendix cover beginner structure through advanced chaining, tool use, and retrieval.
- Every lesson has an Example Playground and graded exercises against expected Claude outputs.
- Free and open source; only cost is API usage, defaulting to cheap Claude 3 Haiku.
- Also available as a Google Sheets version for non-developers.
- Pair with Anthropic's context engineering essay for agent-era techniques not covered here.
Anthropic's prompt engineering tutorial has surpassed 38,000 GitHub stars and 4,200 forks. The course materials teach developers to write, run, and debug prompts against Claude from Jupyter notebooks. Its combination of first-party guidance, executable examples, and checked exercises gives developers a structured way to test prompt revisions.
Nine chapters, tighter constraints
The curriculum groups nine chapters and an appendix into progressively harder tiers:
| Tier | Chapters | Coverage |
|---|---|---|
| Beginner | 1–3 | Prompt structure, clear instructions, and role assignment. |
| Intermediate | 4–7 | Separating instructions from data, formatting responses, assistant prefills, structured reasoning, and few-shot examples. |
| Advanced | 8–9 | Reducing hallucinations and assembling complex prompts for chatbots, legal review, financial extraction, and coding tasks. |
| Appendix | Additional modules | Prompt chaining, tool use, and retrieval of external context. |
Each lesson includes an “Example Playground” where developers can edit prompts and rerun them against Claude. Exercises use grader functions or expected-output criteria to expose failures that a prose-only tutorial would leave hidden.
The repository also links to an answer key and a Google Sheets edition. The notebook version offers direct API experimentation, while the spreadsheet provides another way to follow the course without maintaining a local Jupyter environment.
Cost, license, and model drift
The course files are free to access under the CC BY-NC 4.0 license, which permits sharing and adaptation with attribution for noncommercial purposes. The noncommercial clause applies to reuse of the course materials and warrants review before incorporating them into paid training or commercial products.
Notebook requests incur standard Anthropic API charges. The examples target Claude 3 Haiku, which Anthropic introduced as a lower-cost model, and total spend depends on prompt length, response length, and the number of runs. Model availability changes over time, so developers may need to replace the configured model ID with a supported Claude model. Updated models can also produce different answers and affect exercise graders.
Clone, configure, run
git clone https://github.com/anthropics/prompt-eng-interactive-tutorial
cd prompt-eng-interactive-tutorial
python -m venv .venv
source .venv/bin/activate
python -m pip install anthropic jupyter
export ANTHROPIC_API_KEY=sk-ant-...
jupyter notebook
The activation and environment-variable commands above target macOS and Linux. Windows users need the corresponding PowerShell or Command Prompt syntax. API keys should remain in environment variables or a secrets manager, outside notebooks and source control.
After Jupyter starts, open Anthropic 1P/01_Basic Prompt Structure.ipynb and follow the notebooks in numerical order. Recording the model ID, prompt version, and generation settings will make later results easier to reproduce.
Teams accessing Claude through AWS can use the parallel AmazonBedrock directory. That route requires AWS credentials, Bedrock model access, and the appropriate regional configuration.
The edit-run-check loop
The notebooks turn each concept into a repeatable cycle: inspect an example, modify the prompt, call the model, and compare the response with the lesson's criteria. That loop helps developers connect a wording change to a specific output change.
The built-in checks cover narrow lesson objectives. Production evaluation requires representative test inputs, explicit quality rubrics, regression tracking, and measurements for latency, token use, and cost. Model nondeterminism can also produce reasonable responses that miss a fixed expected string.
Several techniques transfer across model families, including clear task definitions, separation of instructions and input data, few-shot examples, output schemas, and task decomposition. Claude-specific conventions such as XML tags and assistant-prefill patterns require fresh testing when prompts move to GPT, Gemini, Llama, Qwen, or newer Claude releases.
The course's “Precognition” label refers to prompting the model to work through a task in steps. Current reasoning models and APIs may manage internal reasoning differently, so application evaluations should focus on final answers, structured outputs, citations, and observable tool calls.
Delimiters improve prompt clarity; applications processing untrusted content also need prompt-injection defenses, restricted tool permissions, output validation, and human approval for consequential actions.
Where the curriculum ends
The course gives limited treatment to agent loops that repeatedly plan and call tools, context management across long tasks, automated evaluation harnesses, production observability, and deployment safeguards. Its examples teach prompt construction rather than a complete application architecture.
Anthropic's companion agent context guide extends the material to system-prompt specificity, focused tool sets, just-in-time retrieval, context compaction, note-taking, and subagents. Those topics address how an agent selects and preserves information across many steps.
Where the course fits
- Teams building a Claude feature whose prompts fail inconsistently.
- Engineers who understand machine-learning fundamentals but have not written production prompts.
- Developers preparing to work with agent frameworks, evaluation systems, or retrieval-augmented generation pipelines.
- Teams migrating prompts to Claude and testing model-specific patterns such as XML tags, role framing, and assistant prefills.
A survey pass can fit into one or two focused hours, while completing every exercise and adapting the examples to a real application takes longer. The practical result is a tested set of prompting patterns and a clearer method for diagnosing failures.