AI NewsProductivityReported

Iurii Krasnoshchok had AI rewrite his 65,000-line Go editor in Rust

Iurii Krasnoshchok reports that he rewrote his 65,000-line Go terminal editor "rune" in Rust using Claude Fable, for a token cost of about $400, by treating the code as data and orchestrating subagents rather than editing files directly.

AI News

Editorial2 min read

LinkedInX

Why it mattersA single-author account with a real cost figure suggests that large language-to-language rewrites are cheap enough for one person to attempt on a personal project, provided the code can be represented as a data structure the agent operates on.

The engineer Iurii Krasnoshchok published an account on 1 September of rewriting his own 65,000-line Go terminal editor, called rune, into Rust using Claude Fable 5. He reports the token cost at "about $400" and links a specific reference point: the Bun team's earlier "Rewriting Bun in Rust" write-up, which he cites at 535,496 lines for $165,000. Iurii's post is a single-author claim about a personal project, not a controlled study, and the code is his own to check.

The method he describes

The core idea is to stop asking the model to edit code directly and instead ask it to represent the code as a data structure first. Iurii lists the forms he asked for: graphs, ontologies, hierarchical state machines, UML process charts, constraints, or math formulae. He then operates on that representation, simplifying state machines or removing hidden channels of communication, before asking the model for the code back, in the new language. He credits the idea to a Fred Brooks quotation on flowcharts and tables.

The prompt change that kept the cost down

Iurii's second point is about how the top-level agent uses its context window. He writes that Fable "traces the data flow with insane precision" during long runs, but only if it is not spending its context reading and editing files itself. He gives the exact prompt lines he added to make Fable orchestrate subagents rather than run tools directly: avoid extensive Glob, Grep, WebSearch and Bash calls at the top level, delegate to Explore agents; avoid extensive Edit and Bash at the top level, delegate to general-purpose sonnet or haiku subagents; use Read sparingly, only to verify critical claims. He notes that Glob, Grep and WebSearch are the built-in tool names inside Claude Code.

What the numbers do and do not say

The 65,000 lines and $400 are the author's own figures for one project he owns, moved between two languages he chose, on a code base whose tests he wrote. He does not publish a token count, a wall-clock time, or a pass rate on a fixed test suite, and the target project, rune, is not a widely-run piece of software. The Bun comparison is another team's published figure, and the two projects have different scale, different tests, and different languages of origin, so the ratio should not be read as a general "four hundred times cheaper" claim about the method.

Two techniques worth trying on one module

The two techniques behind the cost figure are the interesting part. Representing a target module as a data structure the agent operates on, and constraining the top-level agent to orchestrate subagents rather than run tools itself, are both patterns a team can try inside a large refactor without committing to a full language rewrite. Any team using an agent on a legacy module this quarter can measure the difference between prompt-and-edit and represent-then-regenerate on one component, and see whether the ratio holds true for its own code.

Source

Primary source: Iurii Krasnoshchok, "I used Fable to rewrite 65kLoC to Rust. It cost $400", 1 September 2026. Community discussion: Hacker News.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project