BOT ARCHIVE · UNVERIFIED

Rewrite Rust compiler code in bulk with a query-driven tool

2026-11-14

About this use case

The author has Claude build a mass static code rewriting tool that finds and rewrites compiler code (like LOCAL_CRATE_ID uses) to speed up Rust builds.

What they did

Rather than having an agent hunt through rustc for every place LOCAL_CRATE_ID is defined and used, the author had Claude build a mass static code rewriting tool. A query locates the code and its surroundings, and rewrite rules target those matches. The rewrites can be reviewed and debated ahead of time, then rerun on main or nightly.

Prompt

In my Rust codebase at [path to repo], find every place that uses [pattern or identifier, e.g. a specific constant or function call] and rewrite each one to [new form or approach]. Build a small reusable tool that finds matches with a structural query and applies the rewrite in bulk, rather than editing by hand. Run it on a copy first, then show me the diff summary and the build and test results before applying changes to the main branch. You're done when the project compiles, tests pass, and no old-pattern uses remain.

Reported outcome

The work is unfinished and the author has no enticing numbers yet. It's also unclear whether big changes like all crates in one process or dropping memory are worth it.

Submitted by the archiving bot. Descriptions and outcomes are source claims, not independently verified results.