Incredible! Claude Opus solved a bug that a C++ master had been working on for 4 years in just a few hours

Written by
Iris Vance
Updated on:June-18th-2025
Recommendation

C++ master had been unable to solve the problem for four years, but AI solved it in just a few hours, demonstrating the great potential of AI in solving complex programming problems.

Core content:
1. The background of the bug that C++ master ShelZuuz had been unable to solve for four years
2. How Claude Opus located and solved the problem in a short time
3. AI's unique methods and efficiency in code analysis and problem solving

Yang Fangxian
Founder of 53A/Most Valuable Expert of Tencent Cloud (TVP)


 

There is a C++ master on reddit with the username "ShelZuuz". This guy is not an ordinary person - he has more than 30 years of C++ development experience and has worked as a staff engineer in various major companies (FAANG: Facebook, Amazon, Apple, Netflix, Google). He is a "stabilizing force" who can solve the difficult problems that others in the team can't solve and have troubled for a week.

But such a great player was just taught a lesson by Anthropic's Claude Opus, and even said frankly, "Today I was completely convinced by Claude Opus 4."

Here's what happened: ShelZuuz was facing a "white whale" bug that had been bothering him for four years. The bug stemmed from a large-scale system refactoring four years ago, involving about 60,000 lines of code. The refactoring solved many old problems, but it also introduced this new one - a tricky edge case when a particular shader is used in a particular way. The function that used to work normally, broke after the refactoring.

ShelZuuz spent about 200 hours on and off, trying various methods, but failed to find this "ghost". Although this bug is annoying, it is not urgent enough to stop everything to solve it. He kept dragging it on, and it became a headache for him.

Claude Opus appears and solves the case in a few hours

The turning point came when he decided to try the latest Claude Opus (running in the Claude Code environment). He fed both the old and new versions of the code to Claude and asked it to analyze where the problem was.

As a result, after only a few hours, about 30 rounds of hints and one restart, Claude Opus found the crux!

What’s most amazing is that Claude’s diagnosis goes straight to the point:

The old code can work properly only because of a "coincidence design" under the old architecture; and when the new architecture was refactored, the implicit dependency formed by this "coincidence" was not taken into account. This means that this is not just a simple logic introduction error, but the new architecture design is not compatible with the old edge cases. AI can actually understand this deep-seated architectural problem caused by historical reasons, which is amazing!

“Solving a case” details: AI’s detective workflow

ShelZuuz revealed that the interaction with Claude was also very interesting:

Code context provision : He copies the old code folder next to the new code and lets Claude analyze the common parent directory. Claude can automaticallygrepThe expert suggested that it is best to close all files in VSCode and then start Claude Code, so that AI will not focus too much on the opened files and ignore the global search.

Multiple rounds of prompts and log analysis : some prompts are very brief, but some contain more than 1,000 lines of logs. Claude will ask to addprintfAccording to ShelZuuz, Claude opened about 12 files in the new and old code bases, involving about 10,000 lines of code.

Guidance of human wisdom : When Claude wants to try some paths that he knows are dead ends, ShelZuuz will correct him in time and tell him "This road is blocked because..."

Restart episode : There was a restart in the middle because Claude "went off track" and tried to fix a matrix multiplication problem in a related shader, but ShelZuuz thought this was not the main problem (the problem was that the shader was not executed correctly, not its internal calculation error). After the restart, he fed the previous valid conclusion back, and Claude stopped worrying about the GLSL details.

AI's "confidence" and human verification : Like other AIs, Claude would confidently say from time to time, "I found it! This is the root of the problem!" But ShelZuuz would still test and verify it himself. And after Claude gave the final solution, he had to manually delete some redundant modifications that Claude insisted were useful but actually irrelevant to the core problem.

“The Gods” Failed, Claude Opus Stands Out

ShelZuuz mentioned that he had previously tried to solve this bug with GPT-4.1, Gemini 2.5 pro, and "Claude 3.7," but none of these models made any progress. Only Claude Opus (he used a Claude Max subscription, which costs $100 per month and usually provides the Opus model in Claude Code) finally "solved the case"

Is AI elementary or advanced? The dialectical perspective of the great masters

Interestingly, despite Claude Opus’s incredible performance, ShelZuuz still sticks to his previous point: when it comes to writing new code , AI (including Claude) is still equivalent to a “junior developer”.

But he emphasized that the case this time was not to let AI write code from scratch, but to analyze and debug existing complex systems. The capabilities demonstrated by AI in this scenario, especially the comparative analysis of old and new codes and the understanding of the deep impact of architectural changes, are truly amazing. He believes that the degree of "handholding" required by AI is similar to that of junior developers, but the iteration speed of AI is much faster (a few days versus a few months). If he were asked to choose, for a project of 6 months, should he choose 30 junior developers or an unlimited AI Agent? He thinks both are fine, but if it is 30 senior developers against AI, he will definitely choose the former. This is purely considered from the perspective of the time and energy invested by the technical leader.