Use a query tool to rewrite Rust code in bulk
They had Claude build a tool that finds Rust compiler patterns and rewrites them in batches instead of editing each site manually.
- What they did
- A developer working on rustc asked Claude to create a reusable refactoring tool for broad compiler changes. The tool uses a structural query to find target code and its nearby context, then applies rewrite rules to those matches. That let the developer review proposed edits before running them again on main or nightly.
- How it went
- The effort is still in progress, so there are no useful speedup numbers yet. It is also still unclear whether bigger changes, such as running all crates in one process or reducing memory use, will be worth the tradeoff.
- Tips
- This kind of rewrite works best when you can rerun it on up-to-date branches, so you do not end up stuck with a stale fork. Plan for coordination with the compiler team if the changes may touch other open pull requests.
Try it yourself with Claude
I’m working in [path to repo]. Find every use of [identifier, function, pattern, or API] and rewrite it to [new form]. Build a small reusable refactoring tool that uses a structural query to locate matches, shows the surrounding code, and applies the transformation in bulk. First run it on a copy of the codebase and stop before any irreversible step, such as committing, submitting, or deleting files, so I can review the proposed diff and test results. After I approve, apply the change on [branch name] and report any files that still use the old form.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Tighten homelab access without locking yourself out
One person used Claude Opus to harden a homelab, but it cut off its own access and stopped; OpenAI’s Sol then completed the changes.
Refactor compiler breakage across a huge codebase with Claude
Claude helped a team clean up widespread compiler failures after they tightened settings in a 50-project mono-repo.
Scan commits for security bugs before they land
Use Claude Code to inspect each commit for secrets, injection flaws, and migration risks before it reaches the repository.
Use Claude Code to build Android apps and install them remotely
Run Claude Code on a VM, steer it from your phone, and let it build and load Android apps onto the device through adb.
Coordinate coding work through one Claude hub
A developer turned Claude into a control point for Claude Code and Codex, so they could spread work and usage across accounts.
Drive coding work from Obsidian into Claude Code
They used Obsidian to draft plans, generate handoff notes, and launch Claude Code sessions, while an Efforts page kept each project’s status visible.