Every time you send a prompt to a model you actually send the entire previous conversation along with it, in an array that looks like this:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $(llm keys get anthropic)" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-haiku-4-5-20251001",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
},
{
"role": "assistant",
"content": "The capital of France is Paris."
},
{
"role": "user",
"content": "Germany?"
},
{
"role": "assistant",
"content": "The capital of Germany is Berlin."
},
{
"role": "user",
"content": "Belgium?"
}
]
}'
You can see this yourself if you use their APIs.