Both Codex/Claude Code are terrible with C++. Not sure why that is, but they just spit out nonsense that creates more work than it helps me.
Have you tried to do any OpenGL or Vulkan work with it? Very frustrating.
React and HTML, though, pretty awesome.
Which models?
It's possible Opus 4.5 and GPT-5.2 are significantly less terrible with C++ than previous models. Those only came out within the past 2 months.
They also have significantly more recent knowledge cut-off dates.
In what scenarios are they terrible? I hope not every scenario. I've found Codex adequate for refactoring and unit tests. I've not used it in anger to write any significant new code.
I suppose part of the problem is that training a model on publicly available C++ isn't going to be great because syntactically broken code gets posted to the web all the time, along with suboptimal solutions. I recall a talk saying that functional languages are better for agents because the code published publicly is formally correct.
I use ChatGPT with C++ but in very limited manner. So far it was overall win. I watch the code very closely of course and usually end up doing few iterations (mostly optimizing for speed, reliability, concurrency).
Also to generate boilerplate / repetitive.
Overall I consider it a win.
I use Claude to generate C++ 23, it usually performs well. It takes a bit of nudging to avoid repeating itself, reusing existing functionality, not altering huge portions without running tests, etc. But generally it is helpful and knows what to do.
I had the same experience. C++ doesn't even compile or I have to tell it all the time "use C++23 features". I tried to learn OpenGL with it. This worked out a bit, since I had to spot the errors :D
On the other hand, I've been using Claude Code for the past several months at work in several C++ projects. It's been fine at understanding C++. It just generates a lot of boilerplate, doesn't follow DRY, and gets persnickety with tests.
I've started adding this to all of my new conversations and it seems to help:
My question to the LLM then follows in the next paragraph. Foregoing most of the LLM's code-writing capabilities in favor of giving observations and ideas seems to be a much better choice for productivity. It can still lead me down rabbit holes or wrong directions, but at least I don't have to deal with 10 pages of prose in its output or 50 pages of ineffectual code.