ClaudeAgentSDK.Process (claude_agent_sdk v0.6.9)
View SourceHandles spawning and communicating with the Claude Code CLI process using erlexec.
This module manages the lifecycle of Claude CLI subprocess execution:
- Starting the CLI process with proper arguments
- Capturing and parsing JSON output from stdout/stderr
- Converting the output into a stream of
ClaudeAgentSDK.Messagestructs - Handling errors and cleanup
The module uses erlexec's synchronous execution mode to capture all output at once, then converts it to a lazy stream for consumption.
Summary
Functions
Streams messages from Claude Code CLI using erlexec.
Functions
@spec stream([String.t()], ClaudeAgentSDK.Options.t(), String.t() | nil) :: Enumerable.t(ClaudeAgentSDK.Message.t())
Streams messages from Claude Code CLI using erlexec.
Parameters
args- List of command-line arguments for the Claude CLIoptions- Configuration options (seeClaudeAgentSDK.Options.t/0)
Returns
A stream of ClaudeAgentSDK.Message.t/0 structs.
Examples
ClaudeAgentSDK.Process.stream(["--print", "Hello"], %ClaudeAgentSDK.Options{})