Series
Claude Hot Path
The fastest way from your code to Claude. One file, no SDK.
- clients measured
- 8
- posts
- 7
- fastest, c
- 2.81 ms
The hot path to Claude is one HTTPS POST, one JSON body, and a stream of six Server-Sent Event types. Every SDK wraps that in thousands of lines, and the wrapping costs you: in cold start, in memory, and in the milliseconds between the model finishing a thought and your code acting on it. Every client on this page writes the path by hand in a single file, with no SDK, and the same harness measures what each one adds.
The numbers come from a mock that replays a recorded exchange with its original timing, so they are about the client and not the network, and you can reproduce them without an API key.
Leaderboard
The API took about 1.5 seconds to answer the recorded exchange. These are the milliseconds each client added, fastest first. The hand-written clients are ranked. Below the line, the official SDKs run the same spec as the reference. Cold start is process spawn to the first request arriving at the mock. Turnaround is the first reply finishing to the second request arriving: parse the stream, run the tool, send the next request. Client total adds the tail after the last reply, so it is every millisecond the mock was not streaming. Medians over the runs, from timestamps the mock recorded, with nothing subtracted. Lines are non-blank, non-comment lines of the one source file.
| # | Client | On the path | log scale | Cold start | Turnaround | Peak RSS | Ship | Artefact | Runtime | Lines | Toolchain | Post |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | c | 2.81 ms | 1.3 ms | 0.67 ms | 6 MB | 2.1 MB | 2.1 MB | 0 | 271 | gcc (Debian 14.2.0-19) 14.2.0 | read | |
| 2 | rust | 3.16 ms | 1.14 ms | 0.73 ms | 3 MB | 3.3 MB | 1.4 MB | 2.0 MB | 184 | rustc 1.99.1 (58cf8f9c3 2026-10-13) | read | |
| 3 | csharp-tuned | 3.35 ms | 1.67 ms | 0.73 ms | 4 MB | 10.4 MB | 10.4 MB | 0 | 344 | dotnet SDK 10.0.403 | read | |
| 4 | zig | 3.67 ms | 1.39 ms | 0.99 ms | 2 MB | 488.3 KB | 488.3 KB | 0 | 179 | zig 0.17.0 | read | |
| 5 | go | 4.42 ms | 1.73 ms | 1.1 ms | 6 MB | 5.8 MB | 5.8 MB | 0 | 156 | go version go1.27.3 linux/arm64 | read | |
| 6 | csharp | 7.09 ms | 3.01 ms | 1.4 ms | 7 MB | 7.8 MB | 5.4 MB | 2.4 MB | 102 | dotnet SDK 10.0.402 | read | |
| 7 | bash | 35.3 ms | 6.98 ms | 19.09 ms | 11 MB | 23.7 MB | 3.7 KB | 23.7 MB | 75 | GNU bash, version 5.2.37(1)-release (aarch64-unknown-linux-gnu) | read | |
| 8 | python | 140.37 ms | 123.78 ms | 1.9 ms | 21 MB | 35.5 MB | 4.0 KB | 35.5 MB | 90 | Python 3.14.8 | read | |
| The official SDKs, used the way their documentation says, running the same spec. Not ranked. | ||||||||||||
| – | python-sdk official SDK | 592.47 ms | 464.62 ms | 8.65 ms | 84 MB | 71.9 MB | 2.4 KB | 71.9 MB | 55 | Python 3.14.8 | read | |
Apple M4 Max under Docker, linux/arm64. Download the data (CSV). Rows appear as their posts publish, one Thursday at a time.
The spec
Every client must do all of this, and the bench checks each point rather than trusting the code.
- Read the key from
ANTHROPIC_API_KEYand the base URL fromANTHROPIC_BASE_URL. Nothing else from the environment. - Read the prompt from stdin.
POST /v1/messageswithx-api-key,anthropic-version: 2023-06-01andcontent-type: application/json, and a body withmodel,max_tokens,stream: true,messagesandtools.- Print each
text_deltaas it arrives. The bench checks the first visible byte reached stdout before the stream finished, so buffering the reply, or flushing only on newlines, fails. - Declare one tool,
local_time. When the stream ends withstop_reason: "tool_use", assemble theinput_json_deltafragments, run the tool, send thetool_resultback with the assistant turn echoed, and stream that reply too. - On a non-2xx response, print the body's
error.messageto stderr and exit non-zero. - One source file. HTTP and TLS from the platform where it has them. Where it does not, one named library, which counts towards size.
The posts
- The Hot Path to Claude Is a Shell Script The fastest way from your code to Claude is one POST and one stream, and this is it in bash and curl, no jq. It launches a series: one language a week, one file each, measured for what it adds on top of the API.
- A Claude Client in One Go File The second client on the hot path: net/http, encoding/json and a bufio scanner for Server-Sent Events, in a static binary from a scratch image. What the standard library gives you, and the one thing it does not.
- A Claude Client in One C# File, Compiled Ahead of Time The third client on the hot path: HttpClient, System.Text.Json nodes and a StreamReader loop, published with Native AOT on .NET 10. The binary is smaller than Go's. The C library it links is not free.
- A Faster C# Claude Client, by Breaking the Rules The C# client on the hot path was written the way the templates say and sat at 7.1 ms against Go's 4.4. This one throws out HttpClient, JsonNode and Console, links static on musl and ships from scratch. It lands at 3.35 ms, well under Go. The cost is 344 lines that read like C.
- A Claude Client in One Rust File, and the First Dependency The fourth client on the hot path. Rust has no HTTP in its standard library, so this one pays for ureq and serde_json on the leaderboard. It takes the lead on every timing column: 3.3 MB shipped, 1.1 ms cold start, 0.7 ms turnaround, 3 MB of memory.
- A Claude Client in One Zig File, Under Half a Megabyte The fifth client on the hot path. Zig 0.17's standard library has HTTP, TLS, JSON and a TZif parser, and the static binary it produces is 488 KB with 2 MB of peak memory. Why that is a tenth of Go's size, and what the new Io interface asks of you.
- A Claude Client in One C File, and the Library It Pays For The sixth client on the hot path. C has no HTTP, so this one links libcurl and writes its own JSON scanner. The same 271 lines produced three very different leaderboard rows depending on how the library was built, and the smallest of them is the fastest client on the board: 2.1 MB static, 1.3 ms cold start, 2.8 ms total.