After deleting every npm dependency from my static site generator, I went one step further and replaced the web server too. Meet bzot (Built with Zero Overhead & Tracking), a small C static server with built-in full-text search, now serving this very site.

A few weeks ago I wrote about moving away from Eleventy and replacing my entire blog build pipeline with a single zero-dependency build.mjs script.

Once you get rid of node_modules at build time, it is hard not to look at the rest of the stack with the same suspicion. I had a tiny static site sitting on a VPS behind Cloudflare, and yet serving it still meant configuring a general-purpose web server, figuring out how to add full-text search without shipping a heavy JavaScript index to every visitor, managing redirects, and making sure I was not accidentally logging visitor IPs I never wanted in the first place.

That is when I remembered a small C HTTP server I had started back in 2018 as a pet project. I dusted it off, hardened it properly, and turned it into bzot (1.1.0): a single small C binary that is now serving this site in production.

Why build another static web server?

Let's get the obvious question out of the way first: why not just use nginx or Caddy?

If you need HTTP/2, HTTP/3, Keep-Alive, dynamic upstreams, reverse proxying, or built-in Let's Encrypt automation, you should absolutely use Caddy or nginx. bzot is not trying to compete with them.

bzot exists for a narrower, very common setup: hosting personal sites, documentation, or static blogs on a small VPS (often behind Cloudflare) where you want one small, readable C binary that already solves the annoying static-site extras out of the box, without bolting on extra daemons or client-side search bundles.

What is actually inside bzot

Compiled with TLS=0, bzot has zero external dependencies (just libc and libm). With TLS=1 (the default), it links only against OpenSSL. Inside that single binary you get:

  • Static serving with modern basics: conditional caching (ETag, If-None-Match, If-Modified-Since), single-range GET (206/416), automatic pre-compressed .br and .gz companions, and strict path-traversal, symlink, and dotfile protection.
  • Built-in in-memory full-text search (-S): crawls your .html files at startup, builds an inverted index with BM25-inspired ranking, title/heading/body weighting, Latin-1 accent folding, and prefix matching, and exposes JSON results at /search?q=.... On deployment, SIGHUP hot-reloads the index with zero downtime (this blog's search page is powered by it).
  • Static _redirects and 410 Gone (-r): Netlify-style redirect rules (301/302/307/308, exact paths, /* :splat wildcards, query preservation) with O(1) exact-rule lookup, strict startup validation, and SIGHUP hot-reload.
  • Virtual hosts, SNI, and mTLS (bzot.conf): serve multiple domains (or domain-level redirects) from one process, with isolated per-site docroots, search indexes, redirect tables, Basic Auth, and TLS certificates. It also supports mutual TLS (-a / tls_client_ca), which pairs nicely with Cloudflare Authenticated Origin Pulls.
  • IPv4, IPv6, and dual-stack (::): bind a single IPv4 or IPv6 interface, or pass -b :: to serve both IPv6 and IPv4 on one socket (handy on cheap IPv6-only VPSes behind Cloudflare).
  • Privacy by default: no User-Agent, Referer, cookies, or query strings ever hit the logs. Default access logs (-L anon) mask IPv4 addresses to /24 and native IPv6 addresses to /48, and every response sends strict anti-framing and privacy headers (X-Frame-Options, CSP frame-ancestors 'none', Referrer-Policy, Permissions-Policy: browsing-topics=()).

Deliberate tradeoffs (and making C boring on a VPS)

Keeping a C codebase small enough to read end-to-end means saying "no" to a lot of features.

bzot speaks HTTP/1.1 with Connection: close only, and uses a classic fork()-per-connection model capped at 64 concurrent workers. That sounds old-fashioned until you look at what it buys you for a static blog: strict per-connection memory isolation, zero locking, and Copy-on-Write sharing of the in-memory search index and redirect tables across workers. Behind a CDN like Cloudflare, 64 workers is far more than a personal site will ever need.

Writing a network-facing server in C in 2026 also demands taking hardening seriously. bzot is built with _FORTIFY_SOURCE=2, -fstack-protector-strong, and PIE + Full RELRO (on Linux), drops root privileges irreversibly (initgroups/setgid/setuid + verification), enforces hard per-connection deadlines (SIGALRM) against slowloris clients, opens config/auth/redirect/error files with O_NOFOLLOW and bounded sizes, and runs a C unit suite (under ASan and UBSan) plus 69 Python HTTP/HTTPS integration tests in CI on both Linux and macOS.

How it was built: growing an AGENTS.md and adversarial AI reviews

Just like my Eleventy migration, I did not write every line of bzot by hand. The 2018 skeleton was mine, and turning it into 1.1.0 was a long, iterative collaboration with AI coding agents (mostly Google's Gemini Neon, and later Gemini Carbon).

I still catch myself wondering whether it even makes sense to write low-level, foundational software anymore in this era, a doubt I already touched on in The Pedantic Meat Proxy. In this case, though, it was not just an exercise. I had crystal-clear requirements born from my own real needs, and I would never have attempted a project like this alone: the security surface of a public-facing C server is simply too large and too risky to tackle solo in my spare time.

As an experienced software engineer, that actually made bzot the ideal project to build alongside an agent (or more than one): a genuinely useful, non-trivial, complex codebase to build real fluency with a relatively new tool, with the added bonus of dusting off some C and enjoying a healthy dose of nostalgia along the way.

What surprised me most was not how fast features came together, but how much our working relationship had to be shaped explicitly inside AGENTS.md. That file grew organically every time something annoyed me or went wrong:

  • First came basic hygiene: English-only code and comments, keeping README.md in sync with every CLI flag, and a strict boundary on git (the agent can switch branches, never git commit, git merge, or git push).
  • Then came release discipline: single source of truth for the version string across lib/version.h, README.md, tests, and ChangeLog.
  • Most recently, I even told the agent to stop running make and the test suite itself, because compiling and streaming 69 integration test results on every turn was burning tokens I could save in two seconds by compiling locally and pasting any error back.

More importantly, I did not trust a single model to grade its own homework. Every few milestones, I ran adversarial reviews of the codebase using a completely different model: Claude Opus 5.5. Having Opus 5.5 attack code written by Gemini Neon and Carbon turned out to be hugely effective. It caught subtle protocol edge cases (405 precedence, absolute-form Host mismatches, HTML5 non-void tag parsing), security gaps (hiding runtime TLS/auth files over HTTP, bounded O_NOFOLLOW reads), and unnecessary heap allocations in the search engine.

Those reviews also exposed a recurring weakness in AI-written code: quiet code duplication. Even with clean, well-tested features, the same three failure modes kept showing up:

  1. Feature-slice tunnel vision: when asked to add a new feature, the agent builds everything cleanly inside that feature's file without noticing that an existing module already owns that domain.
  2. Bias toward "don't touch existing working files": rather than refactoring a working module to export a helper, the agent prefers copying a static function into the new .c file (sometimes even with a helpful comment like /* matches lib/foo.c */, which is hilarious and terrifying at the same time).
  3. No explicit "promote on second use" rule: unless you tell it explicitly, the agent will happily duplicate validation or formatting logic across CLI flags and config parsing instead of sharing one implementation.

Once we named those three patterns and turned them into concrete rules in AGENTS.md (check module ownership first, promote helpers on second use, run a pre-completion DRY pass before bumping the version), the architecture got noticeably tighter and cleaner.

Try it out

bzot is open source (GPL v3) and available on GitHub: github.com/claudioc/bzot.

git clone https://github.com/claudioc/bzot.git
cd bzot
make
./bzot -p 8081 -d /path/to/site -S

If you run a personal static site or blog and like small, self-contained tools you can actually read from top to bottom, give it a spin and let me know what breaks (or what I missed).