Show HN: Claude Hot Path, one-file Claude clients in 7 languages, no SDK A Show HN benchmark by Andy Cross, published at stepinto.dev, measured hand-written one-file Claude API clients in seven languages and found a C client added 2.81 ms of client time per request, versus 592.47 ms for the official Python `anthropic` SDK used as a reference row. The C client started cold in 1.3 ms with 6.1 MB peak memory, while the Python SDK took 464.62 ms to cold start at 84.1 MB; Rust (3.16 ms), tuned C# (3.35 ms), Zig (3.67 ms) and Go (4.42 ms) followed, with bash and curl at 35.3 ms and standard-library Python at 140.37 ms. Each client implements one HTTPS POST to /v1/messages and a stream of six Server-Sent Event types by hand, and the harness checks required behaviors such as reading ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL and posting with anthropic-version 2023-06-01, measuring a median of 100 cold starts under Docker against a mock server that replays recorded exchanges. The fastest way from your code to Claude. One file, no SDK. The hot path to Claude is one HTTPS POST and a stream of six Server-Sent Event types. Each client here writes it by hand in one source file, in one language, and the harness measures what it adds on top of the API: cold start, the turnaround between the two requests of a tool call, memory, and size. The leaderboard sorts by the milliseconds added, fastest first. Posts about each one are at https://stepinto.dev/claude-hot-path/ https://stepinto.dev/claude-hot-path/ . Median of 100 cold starts for each client, under Docker, against the mock server. Client time is every millisecond the mock was not streaming: cold start, turnaround and exit added together. | Client | Client time | Cold start | Turnaround | Peak memory | Ships | Lines | Post | |---|---|---|---|---|---|---|---| | C https://github.com/AndyCross/claude-hot-path/blob/main/clients/c | 2.81 ms | 1.3 ms | 0.67 ms | 6.1 MB | 2.1 MB | 271 | | | Rust https://github.com/AndyCross/claude-hot-path/blob/main/clients/rust | 3.16 ms | 1.14 ms | 0.73 ms | 3.0 MB | 3.3 MB | 184 | read https://stepinto.dev/hot-path/a-claude-client-in-one-rust-file-and-the-first-dependency/ | | C , tuned https://github.com/AndyCross/claude-hot-path/blob/main/clients/csharp-tuned | 3.35 ms | 1.67 ms | 0.73 ms | 4.3 MB | 10.4 MB | 344 | read https://stepinto.dev/hot-path/a-faster-c-claude-client-by-breaking-the-rules/ | | Zig https://github.com/AndyCross/claude-hot-path/blob/main/clients/zig | 3.67 ms | 1.39 ms | 0.99 ms | 2.3 MB | 488 KB | 179 | read https://stepinto.dev/hot-path/a-claude-client-in-one-zig-file-under-half-a-megabyte/ | | Go https://github.com/AndyCross/claude-hot-path/blob/main/clients/go | 4.42 ms | 1.73 ms | 1.1 ms | 6.4 MB | 5.8 MB | 156 | read https://stepinto.dev/hot-path/a-claude-client-in-one-go-file/ | | C , ahead-of-time https://github.com/AndyCross/claude-hot-path/blob/main/clients/csharp | 7.09 ms | 3.01 ms | 1.4 ms | 7.1 MB | 7.8 MB | 102 | read https://stepinto.dev/hot-path/a-claude-client-in-one-c-file-compiled-ahead-of-time/ | | bash and curl https://github.com/AndyCross/claude-hot-path/blob/main/clients/bash | 35.3 ms | 6.98 ms | 19.09 ms | 11.8 MB | 23.7 MB | 75 | read https://stepinto.dev/hot-path/the-hot-path-to-claude-is-a-shell-script/ | | Python, standard library https://github.com/AndyCross/claude-hot-path/blob/main/clients/python | 140.37 ms | 123.78 ms | 1.9 ms | 21.2 MB | 35.5 MB | 90 | | | Python, official SDK https://github.com/AndyCross/claude-hot-path/blob/main/clients/python-sdk | 592.47 ms | 464.62 ms | 8.65 ms | 84.1 MB | 71.9 MB | 55 | | "Ships" is the artefact plus any runtime it needs. The Python SDK row is the reference and is not an entry: it uses the official anthropic package the way its documentation says. The full board, with p95 figures, toolchain versions and the commit each row was measured at, is results/leaderboard.csv https://github.com/AndyCross/claude-hot-path/blob/main/results/leaderboard.csv . ./bench/bench.sh bash build the bash client, check it, measure 100 cold starts ./bench/bench.sh all every client, then results/leaderboard.csv You need Docker and Python 3. You do not need an API key: the mock server in mock/ replays recorded exchanges with their original timing. The only step that talks to Anthropic is recording, which proxies one real exchange through the mock and saves it: ANTHROPIC API KEY=... ./bench/bench.sh record bash The key is read from your shell by the proxy. The client under test is given a placeholder and never sees it, and nothing writes it to disk. Every client must do the following, and the bench checks each point rather than trusting the code. 1. Read the key from ANTHROPIC API KEY and the base URL from ANTHROPIC BASE URL default https://api.anthropic.com . Nothing else from the environment. 2. Read the prompt from stdin. 3. POST /v1/messages with headers x-api-key , anthropic-version: 2023-06-01 and content-type: application/json , and a body with model , max tokens , stream: true , messages and tools . 4. Print each text delta as it arrives. The bench checks that the first visible byte reached stdout before the mock finished sending the stream that carried it, so buffering the reply, or flushing only on newlines, fails. 5. Declare one tool, local time , taking an IANA timezone . When the stream ends with stop reason: "tool use" , assemble the input json delta fragments, run the tool, send the tool result in a second request with the assistant turn echoed back, and stream that reply too. 6. On a non-2xx response, print the body's error.message to stderr and exit non-zero. 7. One source file. HTTP and TLS from the platform where it has them. Where it does not, one named library, which counts towards size. clients/csharp-tuned/ is the same spec written for speed rather than the way the templates say: libc's socket calls and hand-written HTTP/1.1 in place of HttpClient , Utf8JsonReader in place of JsonNode , bare file descriptors in place of Console , exit in place of runtime shutdown, and a static musl build from scratch . It bends rule 7, so it sits on the board as its own row next to the stock csharp client rather than replacing it. | Column | Meaning | |---|---| | artefact bytes | The stripped binary, or the source file for an interpreted language. | | runtime bytes | Zero for a static binary. The interpreter and any shared runtime otherwise, measured inside the image. | | cold start ms | Process spawn to the mock receiving the first request. Median and p95. | | turnaround ms | First reply finished to second request received: parse the stream, run the tool, build and send the next request. | | tail ms | Second reply finished to exit. | | client ms | The sum of the three: every millisecond the mock was not streaming. Median and p95. | | max rss kb | Peak resident memory, from the kernel's rusage for the child. | | source lines | Non-blank, non-comment lines in the one source file. Manifests Cargo.toml, the csproj are not counted. | | build s | Clean image build, reported and not ranked. | The streaming check uses the same clocks: the runner notes when the first non-whitespace byte reached stdout and the mock notes when it wrote each chunk, and the first must come before the last. On the recorded fixture a streaming client has about 11 ms in hand and a buffering one is 0.3 to 1 ms late, which the check catches. All timings are differences between timestamps the mock recorded and the runner's spawn and exit times, which share a clock because the containers share a kernel. Nothing is subtracted, so the mock's own sleep overshoot never counts against a client. The leaderboard sorts by client ms , fastest first. Nothing is measured over the network: the one real exchange is for conformance, and no timing from it is published. Make clients/