Skip to content
Beginner short courseUses the Anthropic API

Build Your First Claude AI Agent: A Beginner Step-by-Step Guide

Many people have chatted with an AI assistant. Far fewer have seen what happens when a program lets that assistant ask for help from the outside world, such as looking up a record, and then uses the answer. This course shows you that step by step, in six short lessons, using Python and Anthropic's official SDK.

You will build a small order-status helper for a fictional outdoor-gear shop. It answers questions using a local file of invented orders and a single read-only lookup function. Along the way you will learn how to get API access, keep your key safe, write instructions that keep the assistant on task, and understand the one idea that matters most: your application, not the model, runs the function.

Nothing here assumes you have built an agent before. Each lesson defines its terms, explains why each step is needed, shows what you should see when it works, and lists the mistakes beginners usually make. PromptFable is an independent education site, and this course is not affiliated with or endorsed by Anthropic.

What you will build

Brightwater Order-Status Helper

A command-line assistant for a fictional outdoor-gear shop that answers questions about sample orders by asking your program to run one read-only lookup function.

Outcome: Create and test a simple Claude-powered assistant that can call one safe, clearly defined tool.

It will

  • A system prompt that gives the assistant a clear job, limits and reply format.
  • One read-only tool, get_order_status(order_id), that validates the order ID before looking it up.
  • A tool-use loop in which your application receives Claude's request, runs the function and returns the result.
  • Error handling, input limits and a token usage tally.
  • A human confirmation step before a demonstration hand-off note is 'sent'.
  • Offline tests for the tool and a publishing checklist that keeps the API key out of the repository.

It deliberately will not

  • Uses invented sample data only: no real customers, no personal data and no real orders.
  • The tool never updates, cancels or refunds an order.
  • The hand-off step is a stub that prints a message. Nothing is emailed or stored.
  • It is a learning project for a local terminal, not a production service or a public web chatbot.

Course outline

6 lessons

About 3 h of lessons. Six short lessons, one guided practical project and a final knowledge check.
  1. 1

    What Is a Claude AI Agent?

    Understand, in everyday language, how a Claude agent differs from a normal chat and how the model, instructions, tools and your application fit together.

    20 min
  2. 2

    Get Ready: Accounts, API Access and Safety

    Set up developer access to Claude, create a project folder with a virtual environment, and store your API key safely so it never reaches a repository.

    25 min
  3. 3

    Create Your First Claude-Powered Assistant

    Write agent.py, make a first request to Claude with the official Python SDK, print the reply and understand every part of the code.

    30 min
  4. 4

    Give the Assistant a Job

    Write a clear system instruction, define what the assistant should and should not do, ask for a predictable reply format and test normal, unclear and out-of-scope requests.

    30 min
  5. 5

    Let the Agent Use One Tool

    Define one read-only order-lookup tool, receive Claude's tool request in your application, run the function yourself and return the result so Claude can answer.

    40 min
  6. 6

    Test, Improve and Finish Your Claude Agent

    Test correct, incorrect and missing inputs, add error handling and a human confirmation step, review key security, usage and cost, take the final quiz and publish the project safely.

    35 min

Frequently asked questions

Do I need to know how to program before starting?

You should be able to read basic Python: functions, dictionaries and loops. Every command and code file is shown in full and explained, but the course does not teach Python from scratch.

Is a Claude chat subscription enough to build the project?

No. The Claude chat app and the developer platform are separate. API requests are set up and billed through the developer platform, separately from a chat subscription. Check Anthropic's current pages for how access and billing work for your account.

How much will it cost?

Pricing and any free credits are set by Anthropic and can change, so this course does not quote figures. The project makes only short requests, and lesson 6 shows how to track token usage and cap steps and message length so you can keep spending predictable.

Which Claude model does the course use, and what if it is retired?

The code keeps the model ID in a single constant with a comment telling you to check Anthropic's models page. If the model name changes or is retired, you edit that one line and nothing else.

Does the model run my function?

No. Claude produces a structured request asking for a tool. Your application receives that request, decides whether to honour it, runs the function and sends the result back. That separation is what lets you validate inputs and require human approval for risky actions.

Can I use the finished project with real customer data?

Not as it stands. The course uses invented data and a read-only tool, and it is designed for learning. Using real customer data would need authentication, privacy review, logging, stronger validation and human approval for any action. Those topics are covered in the wider AI Agent Development program rather than in this short course.

Official documentation

Anthropic’s own pages for the setup and APIs this course uses. If something here differs from what you see, the official page wins.

Written by
PromptFable Editorial
Last updated 13 Nov 2026
Review
Reviewed by Waseem Nadir, Technical Reviewer
Last reviewed 27 Nov 2026