Rewrite Rust compiler code in bulk with a query-driven tool
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. ·
Done withClaude
- 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.
- How it went
- 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.
- Worth knowing
- Rewrites can be rerun on current main and applied to other people's open PRs, so you avoid maintaining a stale hard fork, though it takes some coordination with the compiler team.
Try it yourself with Claude
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.
Want help getting this working? Join the Vibe Coding Academy ↗ Run by Alex Finn, who also runs this site.
Source: HN · Nov 13, 2026
Related use cases
Build a C compiler with a team of parallel agents
Anthropic's engineering write-up on tasking Opus 4.6 agent teams with building a C compiler.
Find fitting job postings and tailor resumes
People use Claude to search for job postings that fit and tailor the resume for the ones the user picks.
Fill lengthy web forms from spreadsheet data
An agent fills long forms from Google Sheets or Excel data; one commenter used Playwright MCP with Claude and had it screenshot and verify fields.
Turn tickets into merged pull requests
Pulls tasks from GitHub Issues or Linear, then runs Claude Code or Codex in isolated Kubernetes pods to carry each one through to a PR.
Build an AI to-do list web app in 9 hours with Replit Agent
The poster used Replit Agent V2 to build a fully functional AI to-do list web app in about nine hours.
Publish four Android apps to Google Play built with Replit
A user built four apps with Replit and published them to Google Play, with Replit writing the GitHub workflow YAML files for builds.
Get 5 like this every morning
The best things people got an AI agent to do, each with the prompt to try it.