ClaudeCodeSDK.Process (claude_code_sdk v0.0.1)
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
ClaudeCodeSDK.Message
structs - 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()], ClaudeCodeSDK.Options.t(), String.t() | nil) :: Enumerable.t(ClaudeCodeSDK.Message.t())
Streams messages from Claude Code CLI using erlexec.
Parameters
args
- List of command-line arguments for the Claude CLIoptions
- Configuration options (seeClaudeCodeSDK.Options.t/0
)
Returns
A stream of ClaudeCodeSDK.Message.t/0
structs.
Examples
ClaudeCodeSDK.Process.stream(["--print", "Hello"], %ClaudeCodeSDK.Options{})