AI Trends

Lauren Tan Shares Her AI Coding Method for Submitting 3,000 PRs a Month

QbitAIUpdated Nov 22 16:02

AI summary

Grok Bot developer Lauren Tan shared the AI coding method she used to submit 3,000 PRs last month. Its core principle is transforming a low-trust Agent work environment into a high-trust one. She advocates keeping codebases clean, eliminating about 99% of code comments, and turning Agent errors into deterministic checks such as linting rules, type-system constraints, and architectural constraints. This October, the Grok Bot team submitted 11,000 PRs, with a rollback rate of about 0.5%, while shifting much of its code review toward runtime and formal verification.

Why read this

SelectedAI score 79

This approach integrates codebase governance, deterministic checks, and verification processes, offering a transferable engineering framework for preventing agents from repeatedly making the same mistakes.

Topics

Tags

Body · AI translation

Going Viral Across the Internet! Grok’s Top Coder Shows You How to Submit 3,000 PRs a Month

SpaceXSI chief engineer “Potato” (Lauren Tan) took the stage at the AI Engineer CODE conference with this wildly audacious talk title, and the presentation quickly went viral across the internet.

Previously at Cursor and now working on Grok Bot, Potato has been dubbed “the person who knows how to use Grok Bot better than anyone on the internet.”

According to her, she submitted 3,000 PRs by herself last month.

What does that mean in context? Last month, the entire Grok Bot team submitted and shipped 11,000 PRs, with a rollback rate of just 0.5%.

The talk was not long, but Potato shared quite a few AI coding tips.

“When AI makes a mistake, don’t rush to add a rule to AGENTS.md.”

“Just ban 99% of code comments.”

Potato’s AI coding class is now in session (taps the blackboard).

Keep Your Codebase as Clean and Tidy as Possible

The most important job for software engineers today is to find a way to maintain or even improve code quality while dramatically increasing productivity.

Potato believes that rather than calling this the construction of a “software factory,” it is simpler to understand it as a “trust problem.”

In other words, it is a matter of “turning a low-trust Agent working environment into a high-trust one.”

To that end, she proposed the “inverted pyramid of trust model.”

At the broad top of the inverted pyramid is the code itself, including API design, software architecture, and code refactoring. The next layer down consists of deterministic checking tools such as Lint rules, type systems, compilers, and automated tests.

Only below those come runtime verification, formal verification, and natural-language guidance such as Rules, Skills, and AGENTS.md.

Potato believes the top two layers deserve the greatest investment of effort.

She compares a codebase to a garden.

If a codebase is full of temporary patches, deprecated code, anti-patterns, and various forms of technical debt, an Agent will treat them as established conventions, continue imitating them, and take them even further.

Software engineers are therefore becoming increasingly like gardeners, constantly pulling weeds to create a healthy environment in which new code can grow.

So how exactly should you clean things up?

First, simply ban 99% of code comments.

This is a lesson Potato learned the hard way while working at Cursor.

At the time, the Cursor client used an Electron architecture, in which VS Code’s imperative programming style conflicted with React’s declarative programming style.

Agents loved using timers such as setTimeout, requestAnimationFrame, and requestIdleCallback to patch over these architectural problems.

Large numbers of timers were repeatedly created and destroyed, triggering frequent garbage collection and causing the application to stutter.

Not only that, Agents would also write piles of comments beside the code explaining why it absolutely had to be written that way.

When later Agents encountered this code and its comments, they would find the reasoning persuasive and follow the same pattern.

As a result, temporary patches kept proliferating, and application performance suffered.

That is why Potato now simply bans around 99% of code comments in Grok Bot.

Instead, the team uses Lint rules to check the code directly for problems and guide Agents toward fixing the root cause through explicit error messages.

Second, do not let Agents implement features they are prone to getting wrong.

Dune, the client framework developed by the Grok Bot team, incorporates many designs based on this principle.

Potato describes Dune as “Next.js for Electron apps.” It turns the team’s accumulated development experience into enforceable architectural constraints and Lint rules.

For example, the team found that features requiring careful judgment to use correctly were easily misused by Agents.

React’s useEffect is a classic example. This Hook can be used to handle side effects, but using it correctly requires careful consideration of dependencies, cleanup logic, and other issues—to the point that “you practically need a PhD to use useEffect well.”

The Grok Bot team’s solution is therefore simple: ban useEffect outright in product code and allow it only within specific APIs inside the Dune framework. Problem solved once and for all.

Finally, whenever an Agent makes a mistake, turn the lesson into an automated check wherever possible.

Potato emphasized—and this is important—that when many people encounter incorrect code written by an Agent, their first instinct is to open AGENTS.md and add a line saying, “Don’t do xxx again.” But natural-language rules require the Agent to interpret and follow them on its own, so this is not very effective.

Her approach is to convert these requirements into deterministic checks wherever possible.

△ The team continually accumulates engineering constraints targeting Agent errors

For example, they add Lint rules for incorrect code references and use the type system to prevent invalid calls. If a particular API is repeatedly misused, they redesign it to eliminate that possibility at the architectural level. They then clean up any existing instances of the same problem throughout the codebase.

By repeating this cycle, the number of recurring mistakes an Agent can make becomes smaller and smaller.

Let the Agent Verify Its Own Work

Once the top two layers of the inverted pyramid are sufficiently clean and tidy, it is time to consider verification.

Tan explained that the Grok Bot team has shifted a large portion of its code review work to the verification stage.

Their reviews now focus primarily on screenshots, screen recordings, state diagrams, and formal verification results.

More specifically, they begin with Runtime Verification.

The Grok Bot team gives Agents the ability to run applications, along with debugging tools commonly used by human developers, such as the Chrome DevTools Protocol (CDP).

This means the Agent no longer has to guess what you mean by “that thing below the left sidebar.”

The team has also packaged certain operational capabilities into custom CLIs and drivers and incorporated them into verification Skills. This allows Agents to reuse the same toolset whenever they perform verification tasks, saving Tokens while also enabling the tools themselves to be tested independently.

Next comes Formal Verification.

Tan explained that the Grok Bot team recently began introducing two mathematical verification tools: TLA+ and Lean.

TLA+ is primarily used for model checking, analyzing whether a system satisfies the expected constraints across different states. Lean, meanwhile, can verify the correctness of specific algorithms through formal proofs.

In addition, they have introduced Bombadil to conduct Property-Based Testing of user interfaces.

Rather than merely checking the results of predefined operations, this approach tests a wider range of possible inputs and states based on the properties the program is expected to satisfy.

Tan said that some developers around her spend 70% of their Tokens on verification, and her own proportion is currently about the same.

△ Various testing and verification methods used throughout the software lifecycle, from development to post-release

In her view, static analysis, automated testing, and formal verification are nothing new; in the past, however, the cost of understanding, writing, and maintaining these tools was simply too high.

Now, “the golden age of software testing and verification is arriving.”

One More Thing

So, after adopting this series of clever, streamlined techniques, how efficient is the Grok Bot team’s development process now?

This October, the entire team submitted 11,000 PRs, averaging more than 350 per day. And even as development continued to accelerate, the team’s PR withdrawal rate actually declined and has now stabilized at around 0.5%.

The client’s release cadence has increased accordingly, with a new stable version now being released almost every day.

△ The Grok Bot team’s PR delivery volume continues to grow

The team has now implemented a remarkably ambitious automated development workflow. Whenever a new version of Grok Bot is released, the system automatically launches a new Cursor project and invokes cloud-based Agents to fuzz-test the entire application.

These Agents run and operate the software like real users to find Bugs. Once they identify an issue, they automatically create a fix PR and may even merge it directly.

It took Tan a full six months to make this possible.

According to her, most of the product code the team now merges no longer requires in-depth code review by humans.

References:

Source

QbitAI