curl Got Better While the Agents Rewrote It
A rewrite is a snapshot, and maintenance is a relationship.
There’s a small program called curl that moves data across the internet. You’ve almost certainly used it without knowing, because it sits inside other software, from cars to espresso machines to a Mars landing mission, and its lead developer Daniel Stenberg puts the rough count at thirty billion installations. On November 11 it turned 30 years old.
This fall, people pointed AI coding tools at curl and had them rebuild it in a different programming language, one designed to rule out a whole family of security bugs, and it mostly worked. In a little over three weeks the tools turned about 185,000 lines of the old code into about 340,000 lines of new code. Over those same three weeks, the people who look after the original fixed more than 200 bugs that the copies don’t have.
So the copy was out of date before anyone could install it. Any team that’s tempted to let an agent “just rewrite it” should sit with that for a minute, because writing the code was always the easy part.
Thirty Years of Small Fixes
Every codebase has a function nobody touches because nobody remembers why it works.
curl started as a little over 100 lines of code in the C programming language, posted on November 11, 1996 by a Brazilian student named Rafael Sagula under the name httpget. Stenberg found it within days, sent patches, and ended up as its maintainer. It became urlget, then curl in 1998, and the reusable library most programs actually load (libcurl) arrived in 2000. Thousands of people have contributed code since, and hundreds of new authors show up every year.
In all that time, nobody rewrote curl. The project has always kept improving and tidying the code while keeping the promise that a program built against libcurl years ago still runs after an upgrade. Three decades of small fixes add up to something no single release captures - every odd server it learned to tolerate, every option somebody depends on, and every bug report that turned into a test. In other words, it’s about as battle-tested as software can get.
Why the Agents Could Do It
Two projects showed up this fall, both written in Rust, a newer language designed to stop most of the memory mistakes C allows. One, urlx, calls itself a memory-safe, from-scratch reimplementation of curl and libcurl. The other, kov/curl, keeps the curl name entirely and says it was written by Claude working in Claude Code, with the repository’s maintainer directing and reviewing the work, starting on October 20 and running to about 2,300 commits.
The agents had a huge head start, because AI models have been training on curl’s code for years. curl is extremely well documented, hundreds of open source programs use its interface (so there’s a mountain of public examples showing correct use), and there are thousands of test cases to check an implementation against. The job boils down to converting the C and then polishing until the tests pass.
curl is simply the best input any code-generating tool could ask for: a public codebase with decades of history, a manual entry for every option, and a giant automated check that answers yes or no.
Tests Are the Only Spec a Machine Can Check
urlx says outright that curl’s own test suite is the spec. It reports passing 1,300 of curl’s first 1,400 tests, with the rest skipped for missing platform features or excluded because they inspect curl’s C source. kov/curl reports 1,992 of 1,996 tests passing on its Linux reference build, and says all 507 installed Linux programs that link libcurl find every function they need in the replacement.
A test suite is the only description of a program precise enough for a machine to check, and those pass rates show how far that gets you. Documentation tells a person what the software is supposed to do. Tests tell a machine what it actually does, and an agent will happily rebuild anything a machine can check.
The tests only capture what curl’s maintainers had thought to check on the day the copy started, though. The next bug report a user files is, by definition, about behaviour no test covered yet - and in a living project that report becomes a fix plus a new test in the original. The copy only gets it if somebody carries it over.
Behind on Day One
While 185,000 lines of C became 340,000 lines of Rust, curl’s maintainers merged over 300 commits, including a little over 200 bug fixes and a few vulnerability fixes. The project averages about 11 commits a day; another 200 fixes are expected in the next month. Can the clones keep up?
Neither project’s page says how it plans to. kov/curl tries to maintain good discipline by keeping a file listing every deliberate difference from the C version, but nothing on either page says how upstream fixes will be tracked or who will answer bug reports next year. The rewrites could port curl’s commits as they land, or ignore the bug reports and go their own way.
Porting is harder than it sounds, because a fix written for the C version has to be understood well enough to find where the same problem lives in a codebase with a completely different shape, eleven times a day, forever. Somebody signing up for that isn’t converting code anymore - they’re maintaining two projects to get the value of one.
curl’s steady stream of fixes comes from a working community of users, contributors and maintainers, and has nothing to do with the language it’s written in.
Memory Safety Fixes One Bug in Six
The “strongest” argument for any of this effort is security. C lets programmers make memory mistakes that attackers love, like reading past the end of a buffer or using memory after it’s been handed back, and Rust is designed so most of those mistakes won’t compile. kov/curl names the language as its whole reason for existing. Being fair to C, it has come a long way even since I tarted using it, and a lot of those memory problems are caught by the compiler now.
Still, of the 81 vulnerabilities curl has confirmed so far in 2026, 14 came from mistakes that a memory-safe language would most likely have prevented. A Rust curl would have dodged those 14, about 17%, and still had the other 67.
Without waving away 14 vulnerabilities (attackers can use every one of them), we have to remember that a rewrite trades them for a different risk. Every logic bug, protocol quirk and bad assumption that the original found and fixed over months and years has to be rediscovered or ported by hand into the new code.
curl Already Tried Rust
About four years before the end of 2024, work started on an optional backend that let curl hand its HTTP work to hyper, a well-regarded HTTP library written in Rust. The first stretch of work had outside funding. The backend shipped marked as experimental for years and got about 95% of the way there, with nearly the whole test suite passing on both branches.
Then curl dropped it in December 2024. Nobody was asking for it, and hardly anyone could write both C and Rust well enough to finish the job. Carrying half-finished code was slowing the project down and adding complexity, so it went. Two other Rust-based pieces, one for encryption and one for HTTP/3, stayed in as experimental options.
The hyper backend is the best preview we have of where the agent rewrites are headed. It had a funder, a skilled lead developer and a curl maintainer who wanted it to work, and it still stalled on people: nobody using it, and almost nobody able to work on it. An agent can produce 340,000 lines of Rust in three weeks. It can’t produce the users who want them or the contributors who understand both thirty years of curl’s behaviour and idiomatic Rust.
Who Is On Call for 340,000 Lines?
Rust rewards people who think in it. Even small idioms, like knowing when a bare block beats a named function, come from time spent in the language rather than reading about it. Imagine getting paged at 2 a.m. for a bug in 340,000 lines of Rust that no human typed, carrying C decisions made over three decades by people you’ve never met.
kov/curl has a maintainer who directed and reviewed the work, which is more than a lot of agent-written code gets, but it’s one name. curl has a whole bench behind it - the mailing lists, the security team, and the hundreds of new authors each year who already know where things live.
When an agent writes a big chunk of your own system, you can’t skip the work of understanding it. Whoever is on call when it breaks will end up doing that work, usually at the worst possible moment.
Where Agent Rewrites Earn Their Keep
Every developer has a rewrite of some working system in their favourite language living rent-free in their head.
The rewrites may not be entirely useless and they showed some things worth knowing:
- They test your tests. If an agent can rebuild your project and pass your suite, the suite is doing its job. If it passes while getting obvious things wrong, you’ve found holes in your tests, and that’s worth knowing whether you ship the rewrite or not.
- They’re cheap experiments. kov/curl reports transfer speeds between about 0.81 and 1.11 times C’s rate across platforms. A few weeks of agent time answered “would Rust be slower?” with benchmarks, a question that used to cost a team months.
- They surface hidden behaviour. Keeping a list of every place the new code behaves differently writes down behaviour the original never documented.
- They fit when you own the next ten years. Converting your own internal tool, with your own team on call and nobody else depending on its interface is a very different bet from forking a project with thirty billion installs and a community you’re not part of.
The most common reason developers want a rewrite: they’d rather be working in their favourite language or framework. If you’re being paid to build features, rewriting working code to scratch that itch is bad stewardship - you’re spending your employer’s time and your users’ patience on something nobody asked for. The new version won’t be as wonderful as it looks in your head, because every line still has to go through the same rigour the team put the first version through before it was ready for the world. The testing, the code reviews, the edge cases customers only find in production and the slow, careful rollout all start over from zero. An agent can make the typing free, but it can’t help you skip any of that.
Polish, Don’t Replace
curl’s answer has always been constant polishing, iterating and refactoring instead of rewriting into any language. I wouldn’t rule out every rewrite, because sometimes the old code is a dead end and the people who understood it have all moved on. But curl is a living project with a community shipping 200 fixes a month, and a rewrite of that kind of project is a fork that starts falling behind the day it’s finished.