Expand description
Convenience function for one-off Claude Code queries.
This module provides the query() function, which is the simplest way to
send a prompt to Claude Code and receive all response messages. Each call
creates a new session, sends the prompt, collects all messages, and closes
the connection automatically.
For multi-turn conversations, use ClaudeSdkClient instead.
Functionsยง
- query
- Sends a one-off query to Claude Code and returns all response messages.
- query_
from_ stream - Sends a one-off query using streamed JSON input messages.
- query_
stream - Sends a one-off query and returns responses as a stream.
- query_
stream_ from_ stream - Sends a one-off query with streamed input and streamed output.