Using Claude Code to modernize a 25-year-old kernel driver
TL;DR Highlight
Claude Code ported a 25-year-old kernel 2.4 ftape driver to modern Linux in two evenings.
Who Should Read
Backend or systems developers who need to port legacy code to modern frameworks or APIs
Core Mechanics
- Compiler output feedback drove the port
- Claude Code read compiler errors and fixed them in a loop until the driver built cleanly.
- It found the functions and structs that changed between kernel 2.4 and 6.8 and replaced them with modern equivalents.
- Only a few manual touch-ups were needed.
- Out-of-tree build came without extra prompting
- The author asked if the module could be built without copying it into the kernel tree.
- Claude created a standalone build system that produced a loadable .ko module.
- Humans relayed logs for sudo steps
- Loading and unloading modules needs sudo, so Claude was not allowed to run them.
- The author pasted dmesg output and had Claude compare it with a saved known-good log.
- After a few rounds Claude found the cause: I/O base addresses defaulted to -1 (0xffff), producing ENXIO.
- It worked in two evenings
- The module loaded, detected the tape drive, and dumped a test tape.
- It also worked with both floppy-based and parallel-port drives.
- The OS went from CentOS 3.5 to Xubuntu 24.04.
- The author says it was not three prompts
- It took many back-and-forth conversations and manual code fixes.
- He had C and kernel module experience and says it would not have been possible without that baseline.
- The author's tips for agents
- Treat it like an overconfident junior engineer: you set guardrails and make design decisions.
- Be specific with domain keywords and learn which tasks suit an agent.
- Use it to onboard onto new frameworks faster (he built a Flutter app this way).
Community Reactions
- Commenters said it boosts productivity in frameworks they know and helps explore new ones
- One said you need about 100 hours with Claude Code and Claude 4.0 to judge its capabilities accurately.
- Commenters reported a Langroid Pydantic V1 to V2 upgrade and a legacy JS printer driver port to TypeScript done with Claude
- Both said they already understood the languages and patterns involved.
- One commenter said it worked because working code already existed as an example, and the same approach fits other legacy codebases
- Another said upgrades and 'collateral evolution' suit Claude since logic does not change.
- One commenter warned that vague prompts let the LLM fill gaps itself, which is where bugs hide
- Another said the most underrated trick is giving agents an automatic way to check their work.
- One commenter suggested piping dmesg to a UDP port and having Claude run a listener to remove the manual paste step
How to Apply
- Have Claude Code build one legacy module
- Today, clone an old internal library and ask Claude Code to make it build on the latest version.
- Give it the build and test commands and let it read errors and iterate itself.
- Split human-approval steps into a log relay loop
- Run risky operations like sudo or production-device access yourself.
- Paste a known-good log and the failing log together and ask for a diff-based diagnosis.
- Put domain keywords and explicit gaps in the prompt
- Describe the structure in domain terms and specify only the parts to fill in.
- Give existing working code as an example to improve modernization accuracy.
- Add automatic verification
- Capture tests or a known-good log before porting.
- After changes, read the diff and test it yourself.
Try It
# Paste into Claude Code at the root of a legacy repo (the article's method turned into a prompt)
This repo is legacy {{language/platform}} code that only builds on {{old version}}. Modernize it so it builds on {{new version}}.
Rules:
1. Run `{{build command}}` yourself, read the error output, and fix in a loop until there are no errors.
2. Replace deprecated or changed APIs with modern equivalents, and explain each change in one line.
3. Do not change behavior (logic).
4. Do not run commands that need sudo or affect real hardware; tell me the commands to run instead.
5. When I paste logs, compare them to the known-good log {{known-good log}} and find the cause.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques