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

Mock process implementation that returns predefined responses instead of spawning a CLI.

This module serves as a drop-in replacement for `ClaudeAgentSDK.Process` when
the mock system is enabled. Instead of spawning actual Claude CLI processes,
it retrieves predefined responses from the `ClaudeAgentSDK.Mock` server and
converts them into a stream of `Message` structs.

## Behavior

- **Prompt extraction**: Intelligently extracts the relevant prompt from CLI arguments
- **Response retrieval**: Fetches appropriate mock responses from the Mock server
- **Stream conversion**: Converts raw mock data into proper `Message` structs
- **Type preservation**: Maintains the same message types and structure as real CLI output

## Message Types Supported

- `:system` - System initialization and status messages
- `:assistant` - AI assistant responses with content
- `:user` - User input messages (for conversation context)
- `:result` - Final results with cost and performance metrics

## Integration

This module is automatically used when `Application.get_env(:claude_agent_sdk, :use_mock, false)`
returns `true`. The main SDK seamlessly switches between real and mock processing
without requiring code changes in client applications.

## Mock Response Format

Raw mock responses are converted to structured `Message` structs following the same
patterns as the real CLI output, ensuring compatibility across mock and live modes.

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

```elixir
@spec stream([String.t()], ClaudeAgentSDK.Options.t(), String.t() | nil) ::
  Enumerable.t()
```

Streams mock messages instead of running the actual CLI.

---

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