Module 1, Lesson 1: Chat with Anthropic

What a chat loop is, why the Messages API is stateless and what this module builds.

Published: 11/22/2026

Welcome to Module 1

In this module you build a travel-assistant chatbot with Anthropic's Claude, using the @anthropic-ai/sdk package. Make sure you've followed the Setup reference first.

A prompt is not a chat

A single prompt is one request and one reply. A chat is the same request repeated, with a growing list of earlier messages included each time.

The Messages API is stateless: Claude remembers nothing between calls. Your code keeps a messages array, adds each user message and each assistant reply to it, and sends the whole array on every request. That array is the conversation.

What you'll build

LessonWhat it adds
Lesson 2: Basic chatA multi-turn loop with a system prompt
Lesson 3: Chat with toolsWeather and date tools, adaptive thinking and stop-reason handling
Lesson 4: Showing reasoningSummarized thinking printed next to each answer

The model ID used in this module is claude-sonnet-5-5.

👉 Continue to Lesson 2: Basic chat