Skip to main content

Module client

Module client 

Source
Expand description

The core Client struct — multi-turn, bidirectional Claude Code sessions.

§Architecture

On connect(), the client spawns a background task that:

  1. Reads JSON values from the transport
  2. Routes permission requests to the configured callback
  3. Routes hook requests to registered hook matchers
  4. Applies the message callback (if any)
  5. Forwards resulting messages through a flume channel

Callers consume messages via send() (which returns a stream), or via receive_messages().

Structs§

Client
A stateful Claude Code client that manages a persistent session.