According to ZDONGXI on August 25th, today, Andrej Karpathy, the former director of AI at Tesla and a co-founder of OpenAI, shared his exclusive tips for AI-assisted programming.
▲ Screenshots of some tweets by Andrej Karpathy
His AI-assisted programming doesn’t focus on a single tool. Instead, he “employs” multiple tools and assigns them roles as needed.
In summary, Karpathy’s use of AI-assisted programming can be divided into four stages. He uses the Cursor editor for automatic code completion in 75% of the cases. Secondly, he uses large language models to modify specific code segments. Thirdly, he uses independent AI programming tools like Claude Code and Codex to implement larger functional modules. Finally, he uses GPT-5 Pro to solve the most difficult problems. He calls GPT-5 Pro “the last line of defense”.
▲ Flowchart of Andrej Karpathy’s AI-assisted programming
This is because currently, developers can’t meet all development needs with a single programming tool, and these tools have different strengths. For example, the Cursor editor is good at automatic code completion but needs to be restarted frequently. Independent AI programming tools can program for content that developers are not familiar with, but they require regular code cleaning, style adjustment, and handling of “code aesthetics”. GPT-5 Pro can handle the most difficult problems and can analyze and find hidden bugs that humans, Cursor, and Claude Code can’t find in 10 minutes.
From Karpathy’s shared AI programming workflow, it can be seen that current AI programming tools have their own advantages and disadvantages, and developers achieve efficient assisted programming by combining different tools.
01. Cursor is the main tool, independent AI programming tools assist, and GPT-5 Pro solves the most difficult problems
Karpathy mentioned the following specific workflow in his tweet:
In his process of using large language models for assisted programming, 75% of the time is spent on the automatic code completion function triggered by the Tab key in the Cursor editor.
This is because Karpathy found that writing specific code snippets or comments at the correct positions in the code is an efficient way to convey “task requirements” to the large language model. That is to say, the key lies in accurately conveying task details. If he describes the desired effect in words, it not only requires a lot of description but also causes obvious delays. However, demonstrating the requirements directly in the code at the correct position is much faster.
Occasionally, this automatic code completion function needs to be frequently turned on and off to work well.
▲ Description of Karpathy’s use of the Cursor editor in his tweet
The second way of using is: Karpathy selects a specific code segment and asks the large language model to make certain modifications to it.
▲ Description of Karpathy’s use of the large language model to modify code in his tweet
The third way of using is that outside the Cursor editor, he runs independent AI programming tools like Claude Code and Codex. This usually happens when he encounters a scenario where he needs to implement a larger functional module and the requirements can be easily explained with prompt words.
Regarding these tools, Karpathy said that they have really helped a lot, but the overall experience is mixed, and they can be a bit annoying at times. He doesn’t use the “no-confirmation-needed mode” (YOLO mode) because these tools are prone to going off track and writing redundant content that he doesn’t want or need at all. So he often needs to press the ESC key to interrupt the generation.
Karpathy complained that he hasn’t learned to use multiple tools simultaneously to improve efficiency because just using one well is already quite difficult.
The problems include that he can’t efficiently maintain and update the CLAUDE.md document and has to spend a lot of time on “code cleaning”, adjusting code style, or handling issues related to “code aesthetics”.
For example, these AI tools are overly defensive when writing code and abuse try/catch statements. They complicate abstract logic and write bloated and redundant code. Many problems that can be solved with list comprehensions or a single line of if-else statements are written as nested if-else structures. They also repeat writing several similar code segments instead of encapsulating them into a concise auxiliary function.
This proves that AI tools don’t have the concept of “code aesthetics”.
However, Karpathy mentioned that in some scenarios, these tools are indispensable. For example, when he needs Vibe Coding and is not very familiar with the relevant field. He mentioned that when he recently wrote Rust code, SQL commands, or other content that he rarely contacts, these AI programming tools can be very useful.
He also tried to let Claude Code teach him some knowledge while writing code, but this tool only wants to write code and is not willing to spend time explaining anything during the process. He also asked Claude Code to help with hyperparameter tuning before, and the process was quite interesting, but the result was not good.
Karpathy also mentioned some scenarios where these tools are very useful, such as when he needs various low-risk, one-time custom visual charts, small tools, or debugging code. Because these tools are very time-consuming. He gave an example that to locate a specific bug, Claude Code can quickly write 1000 lines of dedicated visual code or debugging code, and these codes can be deleted after the bug is found.
He believes that we are now in an era of code surplus, and developers can write thousands of lines of highly customized, disposable code. Code is no longer something that is “precious and costly to write”.
▲ Description of Karpathy’s use of independent AI programming tools in his tweet
The last line of defense is GPT-5 Pro. Karpathy said that he uses it when he encounters the most difficult problems to solve.
He mentioned that many times, he, the Cursor editor, and Claude Code were all stuck on a bug and made no progress for 10 minutes. But when he copied and pasted the complete code to GPT-5 Pro, it analyzed the code in 10 minutes and found a very hidden bug. Karpathy believes that GPT-5 Pro is really powerful and can retrieve various obscure documents and academic papers.
Regarding other uses of GPT-5 Pro, Karpathy said that he also uses it to handle more complex tasks. For example, he asks it to give suggestions for optimizing the abstract logic of the code, but the results are mixed. Sometimes it can give good ideas, but not all suggestions are useful. Or he asks it to conduct a complete literature review on “the implementation method of a certain technology”, and it will finally return highly relevant reference materials and information sources.
In short, Karpathy believes that with the support of many tools with their own advantages and disadvantages, the possibilities in the programming field have been fully opened up. However, this also easily makes people feel anxious, worried that they can’t keep up with the cutting-edge level that the industry can achieve. That’s why a bunch of ideas suddenly popped up in his mind while taking a shower this Sunday, and he is also very curious about what others have discovered in practice.
▲ Description of Karpathy’s use of GPT-5 Pro in his tweet
02. Developers combine programming tools, and the comment section gives suggestions to Karpathy
Many netizens in the comment section agreed with Karpathy’s workflow. They mentioned that although some tools may be different, they basically choose the strategy of combining different AI tools for assisted programming.
In the comment section, many netizens also gave suggestions for the problems Karpathy encountered. For example, creating an agent for Context Engineer to help developers update Claude.md, or asking Claude Code to provide a detailed but concise problem summary to be solved by Grok to avoid it going off track repeatedly. Or trying voice transcription to give instructions.
03. Conclusion: Developers achieve efficient assisted programming by combining tools
More and more developers are using AI tools to write code more efficiently and conveniently. Specific use cases include automatic code line completion, fixing code errors, and testing code.
However, in actual experience, AI programming tools may encounter problems such as writing errors and code redundancy. From Karpathy’s shared AI-assisted programming workflow and the interaction in the comment section, it can be seen that since the development of AI programming tools is still in its early stage and users’ needs can’t be met with a single tool, developers are combining different tools to take advantage of their strengths in different programming stages to achieve efficient and accurate assisted programming.
This article is from the WeChat official account “ZDONGXI” (ID: zhidxcom) , author: Cheng Qian, published by 36Kr with authorization.