Entry point for querying the Claude Code CLI with ZIO.
query streams messages as the CLI produces them; querySync and queryResult are convenience collectors. session opens a scoped multi-turn conversation. All operations fail with a typed CLIError.
Execute a query and stream messages from the Claude CLI as they arrive.
Execute a query and stream messages from the Claude CLI as they arrive.
When archive is set, the transcript the run leaves behind is mirrored into the archive directory once the stream is finished with — best-effort, so a mirror failure is logged and never breaks the query. The session mirrored is the one the run reported in its result, falling back to the resumed id when the run died before reporting one (see QueryCustody). Finishing the stream waits for that mirror, bounded by works.iterative.claude.zio.internal.cli.SessionArchiveHook.CloseMirrorTimeout — the same bound closing a session waits under.
Open a scoped session backed by a long-lived CLI process.
Open a scoped session backed by a long-lived CLI process.
When archive is set, the session mirrors the vendor transcript tree after each real result and on close — best-effort, so a mirror failure is logged and never breaks the session. Closing the session waits for the final mirror, bounded by works.iterative.claude.zio.internal.cli.SessionArchiveHook.CloseMirrorTimeout (after which it logs a warning and moves on). eventsBufferSize sizes the lossy events Hub (see Session.events); the default is conservative.