# UserMessage

> The message that takes a tool's result, or your own words, back to Claude.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** SDK user message, tool result message, Claude Agent SDK UserMessage

## Think of it like

It is like the note a helper gets back once they check.

## Definition

UserMessage is the Agent SDK message type for what goes back to Claude. After each tool runs, the SDK yields one with the tool's result, such as the output of a command. It also carries any message you stream in while the agent works. Reading it shows you what Claude saw before its next step.

## Example

Leo's tests fail inside the agent. He prints each UserMessage and sees the exact error Claude was given.

## Why it matters

When the agent does something odd, the tool result is often why.

## Common mistake

Thinking it only holds what a person typed. Most UserMessages hold tool results.

## Three principles

- **Tool results.** After each call.
- **Your streamed input.** Too.
- **What Claude saw.** Before acting.

## Related terms

- [AssistantMessage](https://learn.benibix.com/term/ai/sdk-assistant-message)
- [Streaming Input Mode](https://learn.benibix.com/term/ai/streaming-input-mode)
- [Tool Use (Function Calling)](https://learn.benibix.com/term/ai/tool-use)

---

Source: https://learn.benibix.com/term/ai/sdk-user-message
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
