[DOCS] Outdated UserMessage Class Definition in Python SDK Reference
Documentation Type
Unclear/confusing documentation
Documentation Location
https://platform.claude.com/docs/en/agent-sdk/python#usermessage
Section/Topic
The UserMessage class definition under the Message Types section in the Python SDK Reference.
Current Documentation
@dataclass
class UserMessage:
content: str | list[ContentBlock]
What's Wrong or Missing?
The documentation for the UserMessage class is missing two fields (uuid and parent_tool_use_id) that exist in the actual source code (src/claude_agent_sdk/types.py).
Crucially, the uuid field is required to use the rewind_files() feature, which is documented elsewhere in the SDK guide. Without knowing that UserMessage objects contain a uuid, developers cannot correctly implement file checkpointing and rewinding.
Suggested Improvement
Update the class definition to match the source code:
@dataclass
class UserMessage:
content: str | list[ContentBlock]
uuid: str | None = None
parent_tool_use_id: str | None = None
Impact
High - Prevents users from using a feature
Additional Context
- Source Code:
src/claude_agent_sdk/types.py - Related Feature:
ClaudeSDKClient.rewind_files(user_message_uuid: str)requires the UUID from aUserMessage. - Changelog: Use of
uuidwas highlighted in the SDK changelog (v0.1.17) but not reflected in the API reference docs.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗