Get 2–20x faster Rust by iterating “make it faster”

Max Woolf’s guarded loop: ask agents to make Rust (PyO3) code faster, forbid unsafe, benchmark each step.

by Max Woolf22 Sep 2026

Prompt for your agent

Goal: Iteratively make a Rust implementation faster with benchmarks as the judge.
Setup: agents used in source: Claude, Codex; tools/MCPs stated: Rust, PyO3.
Steps:
1. Pick a target (e.g. reimplementing ML algorithms in Rust with PyO3 bindings).
2. Set guardrails: forbid unsafe code whenever possible; keep correctness tests.
3. Ask the agent repeatedly to make the code faster, benchmarking every iteration.
4. Publish prompts and benchmark results so the gains are checkable.
Rules: ask me before anything irreversible (sending, posting, paying, deleting); don’t invent data, results or tools I haven’t given you; tell me what you couldn’t verify.
Based on: Max Woolf — https://minimaxir.com/2026/09/agentic-iteration/ (summarised from source; the source has no explicit step list)

Steps are our summary of the source (it has no explicit step list). Includes a “Based on” credit line.

I tried this

Tell the next builder. One anonymous answer each; click again to undo.

Agents, models and tools only what the source states

Agents
Claude Codex
Tools
  • Rust
  • PyO3

Sources & credit