Autoresearch, Claude and Constrained Optimization

Get the Tech newsletter
Daily tech — startups, AI labs, chips, the launches that shape the next decade. Free.
- The developer scaffolded a Rust file compression project and let Claude Code (Sonnet 4.6) autonomously optimize it over 10 iterations spanning roughly two weeks, with a bit-perfect round-trip and a 300-second timeout as hard constraints.
- The agent's first iteration produced a custom LZSS implementation; the next nine iterations extended it with entropy checks and encoding techniques, averaging about $4 USD per iteration on default Claude Code settings.
- Claude never made more than one set of changes per iteration, forming a hypothesis, coding it, running the benchmark, and calling itself complete — a pattern the author attributes to not using Claude Code's
/goalcommand. - Final benchmarks against existing compression tools showed the custom algorithm excelled on audio and video files but was on par or slightly worse elsewhere, because the metric it optimized was pure compression ratio.
- The author concluded that a robust, measurable, well-constrained objective is the key requirement for this auto-research style, and that models need an explicit looping mechanism because they otherwise race to be 'done' as quickly as possible.
- A second-order insight: the 300-second time cap was too loose to matter — the model only ever optimized for size, never for speed, a trade-off pattern Mitchell Hashimoto recently captured in a separate X thread.
- The supply-chain angle: the author frames the experiment as a data point on when in-house AI-generated solutions could displace external dependencies, given that a few-week, ~$40 unsupervised run produced a working algorithm competitive with installed tools on some file types.
Why it matters: Roughly $40 of Claude compute produced a custom compression tool competitive with installed utilities on audio and video — a proof point that unsupervised agent loops can substitute for external libraries when the objective is tight and measurable. The author's deeper finding is structural: without an explicit cycling mechanism, models self-terminate after one hypothesis, which is the actual bottleneck for 'dozens-of-people' AI productivity claims.




