Libcage
A 21KB zero-dependency pure-C LLM agent that fixes broken code on its own — then compiles and tests until it's green. No Python. No Node. No venv. Runs anywhere cc exists.
Zero dependencies
Single static binary. Only libc + POSIX sockets. No curl, no jansson, no runtime to provision.
Works where others can't
Air-gapped CI, embedded boxes, minimal containers, bare metal. Python agents can't reach these.
Any model
OpenAI-compatible /chat/completions. Point it at Ollama, OpenAI, or your local EPYC inference lane.
Self-healing loop
Applies the fix, compiles, runs your test. On failure it feeds the error back and retries up to N times.
How it works
libcage "Fix the off-by-one in parse()" broken.c \ "cc -o out broken.c" "./out" # iteration 1/5 # compiling... # testing... # SUCCESS after 1 iteration(s)
Why pure C?
- No supply chain. One file, auditable by eye. No npm, no pip, no transitive CVEs.
- Portable. Compiles with
cc -O2 -std=c11on Linux, macOS, BSD, and minimal containers. - Fast to deploy.
curl | sha 21KB binary onto a box and it's running — no install step. - Future-proof. C outlives every language trend. This binary will run in 2035.
Built with Antigravity, ships as C
Libcage was scaffolded and iterated using an LLM code-edit IDE (Google Antigravity / Gemini), proving the dogfood loop: the agent writes the C, the C agent runs the agent. The runtime itself is dependency-free C — so you get the leverage of LLM edits without the runtime baggage.
What you get
- The
libcagestatic binary (Linux x86-64). agent.csource +Makefile(build it yourself, audit it, fork it).- Self-test harness that verifies the repair loop against a deliberately broken file.