Skip to content

Examples

Interactive example runner with 9 demos covering every major feature.

Setup

bash
git clone https://github.com/pivanov/claude-wire
cd claude-wire
bun install

Requires Claude Code CLI installed and authenticated.

Run

bash
bun run examples

This opens an interactive menu where you pick which example to run. After each example, you can run another or exit.

Available Examples

#NameWhat it demonstrates
01One-shot askclaude.ask() with typed result, cost, tokens, duration
02Event streamingclaude.stream() with for await loop, event timeline
03Multi-turn sessionclaude.session() with two turns, cumulative cost
04Tool controltoolHandler.allowed, toolHandler.blocked, custom onToolUse handler
05Cost budgetmaxCostUsd limit with onCostUpdate callback
06Abort with timeoutAbortSignal.timeout() cancellation
07System promptCustom systemPrompt to change Claude's behavior
08Resume sessionCreate a session, then resume it by ID
09Ask JSONclaude.askJson() with a Zod schema for typed, validated output

All examples use model: "haiku" for fast, cheap responses.

Not affiliated with or endorsed by Anthropic. Supported by LogicStar AI.