Johnny Tian-Zheng Wei: https://johntzwei.github.io/

https://x.com/johntzwei

Introduction

BREAKING NEWS - Linus Torvalds said he does "no coding anymore"! https://linux.slashdot.org/story/20/07/03/2133201/linus-torvalds-i-do-no-coding-any-more But he didn't say this in 2026, he said this back in 2020! He stated that he mostly merges pull requests, and he mainly writes code in email, where he gives high level pointers to others contributing to the linux codebase. Staying in control of a large codebase that you didn't write yourself is not a new problem. If Linus can manage this for the most important piece of software of all time, you can manage the use of AI coding agents in your work as well. As David Bau puts it, AI coding to human coding is like driving to walking https://davidbau.com/archives/2025/12/16/vibe_coding.html. By speed and effort, you simply cannot outrun a car. With coding agents, every codebase is about to get considerably more complex, and software engineering becomes more important than ever.

This post focuses on the SWE principles you need to know to use coding agents for ML research. First, you should adopt a software engineering mindset. For reference, look at what SWEs like to watch on Youtube: https://www.youtube.com/@Fireship https://www.youtube.com/@kantancoding there's news, but most of the educational content is on tools, libraries, design patterns, editor configs, and meta-thinking about how to build. My summary is that SWE is generally about managing complexity, reducing friction, and increasing agency. When these challenges arise in your own work, think like a software engineer.

A quick detour: my setup

Tabs. I use VS Code, and I set my keybinding for tabs to be the same as those for Chrome. I also keep a tab limit and pin the files I reference frequently. To enable this, set workbench.editor.limit.enabled to true, then set workbench.editor.limit.value to your preferred max (default is 10). You can do whatever works for you, but I suggest that you take a distinct style to your setup (mine is: everything is Chrome).

Remote development. I use VS Code's Remote SSH extension to develop remotely on our Slurm-based university cluster. I have a script that allocates resources and properly sets up my ssh configs to directly connect to the compute node, using a ProxyJump through the login node.

Claude Code. I use the CC extension on VS Code, and I find it to be better than the CLI because it has parallel scrolling for the before and after of suggested edits. Use whatever you prefer, although I think VS Code will be best for most people. There are plenty of tutorials on the basics of Claude Code: https://www.youtube.com/watch?v=Ffh9OeJ7yxw https://www.youtube.com/watch?v=gv0WHhKelSE&t=1119s. My goal is to teach the relevant software engineering skills to use CC well.

SWE for research code:

Design patterns. Design patterns are ways of thinking about how to structure a task. As you code with AI, it is important that you (the human) are identifying the necessary design patterns and architecting the high level structure of your codebase. This is for you, not just for Claude. I find that Claude can navigate a messy codebase, but you the human, cannot. By being involved on the high level architecture, you stay in control of the codebase.

There are a lot of SWE design patterns (https://www.youtube.com/watch?v=tv-_1er1mWI) but for research you mostly just need these two: dataclass https://docs.python.org/3/library/dataclasses.html, and abstract class https://docs.python.org/3/library/abc.html. In designing the architecture for your own codebase, you can refer to the patterns of other well-established libraries: