Have Claude Code write a performance fix with tests
Linus Torvalds used Claude Code on a page cache bottleneck in Linux that developers had struggled with for more than two years. The agent wrote the code, the tests and the first draft of documentation under his direction, and he ran the benchmarks himself.
Done with Claude CodeModerate
What was done
Linus Torvalds used Claude Code on a page cache bottleneck in Linux that developers had struggled with for more than two years. The agent wrote the code, the tests and the first draft of documentation under his direction, and he ran the benchmarks himself. In a synthetic test, reads ran 23 times faster on a Threadripper, but he warned the real-world gain would be smaller. Other developers later found a race condition.
How to do it
- Paste the prompt into the tool, and replace the text in brackets with your own.
- Read the answer through. Do not send, delete or publish anything until you have seen it yourself.
- Check the original before you trust a figure, a name or a date.
Try it with Claude Code
Find out why [function or code path] in [project] is slow. First write a test that measures performance, and save the numbers from before the change. Propose a fix and explain its risks for concurrency and memory. Do not change anything outside [folder], and show me the diff before anything is merged. You are done when tests pass, the before and after numbers are in the report and I have read the diff.
Replace text in brackets with your own.
Done when. Tests pass, the before and after numbers are in the report and you have read the diff.
The New Stack ·