Linus Torvalds Turns to Claude Code for New Linux Kernel Patches

Linus Torvalds Turns to Claude Code for New Linux Kernel Patches

Linus Torvalds, the creator of Linux, has published a set of kernel patches that were largely written with Claude Code, Anthropic’s AI coding assistant. The Torvalds Claude Code experiment targets a stubborn slowdown in how Linux reads cached files when many threads hit the same data. It’s a big moment for AI-assisted programming, because few developers are more careful about code quality than Torvalds.

The work is still an experiment, not part of an official Linux release. But the fact that he openly credits an AI assistant tells you a lot about how fast attitudes are shifting.

What Torvalds Built With Claude Code

The new code is an eight-patch series published on a branch in Torvalds’s own repository. The branch name, noref-filemap-read-with-llm, even signals that a large language model was involved.

In his Git submission, Torvalds said the code, the test programs, the review and the first draft of the write-up were all produced with Claude Code “under my direction.” In other words, he steered the work and checked the results, while the assistant did much of the typing and drafting.

The quick facts

DetailWhat we know
WhoLinus Torvalds, creator and lead maintainer of Linux
AI tool usedClaude Code from Anthropic
Size of the workAn eight-patch series on a separate branch
Problem targetedSlow small reads from the page cache under heavy multi-thread use
Best reported resultAbout 30 to 33 million reads per second, up from about 10 million
StatusNot merged into mainline Linux as of October 13

The Linux Page Cache Problem the Patches Target

Linux keeps recently used file data in memory in what’s called the page cache. When several threads keep reading tiny chunks from the same cached file, each read briefly grabs and releases a reference to the memory holding that data.

Those reference updates all touch one shared spot in the processor’s cache. That forces CPU cores to fight over it, which can slow some workloads a lot. The issue has been known since 2024, and earlier attempts to fix it didn’t succeed.

On his four-core Intel laptop, Torvalds measured eight threads making tiny 16-byte reads of the same page. He found that one shared cache line accounted for 99.92% of the cross-core traffic he measured.

How the fix works

The patches change when the kernel is allowed to reuse memory that has been removed from the page cache. Instead of handing it back right away, the kernel waits for a safety window known as an RCU grace period.

That delay lets a reader copy data straight into a program’s buffer without taking a reference at all. The trade is simple: memory gets reclaimed a little later, but the busy shared counter stops being a bottleneck.

How Big Are the Speed Gains?

The reported numbers are striking, but they come from one specific test on one laptop. Here is what Torvalds measured:

  • Eight-thread throughput rose from about 9.9 to 10.4 million reads per second to about 30 to 33 million.
  • Kernel cycles per read dropped from roughly 2,950 to about 725 in that same test.
  • Single-thread reads improved only a little, from about 453 cycles to about 408.

Torvalds said machines with more CPUs or more than one socket should gain even more, though nothing bigger has been tested yet. This does not mean Linux suddenly runs three times faster overall.

What still needs work

The patches are far from finished. Torvalds himself called the delayed memory reclamation “the part of this series that is least solved,” since pages can sit unavailable while the kernel waits.

There is also a small slowdown when a read targets user memory that isn’t mapped yet. As of October 13, the branch remained outside mainline Linux 7.3-rc6, and there’s no timeline for whether it will ever be merged.

Why the Torvalds Claude Code Moment Matters

Torvalds has moved toward AI gradually over the past few years. In late 2023 he described AI as a tool that could help developers do better work, mostly by spotting bugs. By late 2025 he was calling himself a big believer in AI as a tool for maintaining and reviewing code.

In January 2026, he tried AI-assisted coding on a hobby project. Speaking at Open Source Summit Europe in Prague earlier this month, he said he now really likes using AI, while warning that people need to be very careful when the work is real and important.

That balance shows in this project. He used an assistant for the heavy lifting, then measured, reviewed and openly listed the weak spots. If you’ve been following Anthropic’s tool, our guide on Claude Code permissions covers one common setup question.

What This Means for You

You don’t need to be a kernel developer to take something away from this. Here are a few practical lessons:

  1. AI coding assistants are now trusted for serious systems work, not just quick scripts, as long as a skilled human stays in charge.
  2. Disclose AI help. Torvalds stated plainly what the assistant did, which makes review easier and builds trust.
  3. Measure everything. His benchmarks, not the AI’s claims, decide whether the change is worth keeping.
  4. List the open problems. Naming the weakest part of a change helps reviewers focus where it counts.

If you want to try this style of work yourself, start with tools that help you understand legacy code before asking them to write it. You can also compare popular options in our AI code assistants directory or read more about Anthropic’s Claude itself.

For more developments like this, browse our latest AI news updates.

Sources

This article is based on reporting and Git submission quotes published by ZDNET.

Conclusion

Linus Torvalds using Claude Code to write Linux kernel patches marks a real shift in how top developers view AI coding tools. The page cache work shows big gains in one narrow test, but it still has unsolved memory and speed trade-offs. Whether it lands in Linux or not, the way Torvalds handled it is the lesson. He directed the AI, checked every result and was honest about the gaps. That’s a model any developer can follow.

Submit AI
Scroll to Top