# `ClaudeAgentSDK.Process`
[🔗](https://github.com/nshkrdotcom/claude_agent_sdk/blob/v0.9.2/lib/claude_agent_sdk/process.ex#L1)

Handles 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.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.

# `stream`
[🔗](https://github.com/nshkrdotcom/claude_agent_sdk/blob/v0.9.2/lib/claude_agent_sdk/process.ex#L41)

```elixir
@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 CLI
- `options` - Configuration options (see `t:ClaudeAgentSDK.Options.t/0`)

## Returns

A stream of `t:ClaudeAgentSDK.Message.t/0` structs.

## Examples

    ClaudeAgentSDK.Process.stream(["--print", "Hello"], %ClaudeAgentSDK.Options{})

---

*Consult [api-reference.md](api-reference.md) for complete listing*
