claude-code - 💡(How to fix) Fix [MODEL] Opus-4-7 [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52005Fetched 2026-04-23 07:39:06
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Root Cause

I am currently using Claude code to port an OpenGL application to DirectX 12. The OpenGL version works perfectly, the graphics code is encapsulated very well. I told Claude code to stay as close to the code and architecture of the OpenGL version. However, what it did was to rewrite my code while porting, partiually to the extent of mutilating it, removing entire classes or the usage of these classes' functionality, copying into higher level code instead, adding code that subsequently lead to very hard to track bugs, or modifying code that was totally unrelated to the graphics subsystem code, in one instance costing me two days of debugging, burning through around 100€ of extra usage fees, only to detect the bug was in some code Claude code should never have touched, but had rewritten in a way that made it produce incorrect results. Claude code did all that without asking back or informing me. It still does so even after I had instructed it repeatedly not to do any such thing and had told it to memorize that. Half of the time I spent on this port was hunting down and fixing issues Claude code had produced! Even simple tasks like converting GLSL to HLSL shaders cause it to fail, because it just renames variables or changes code that it obviously hasn't understood. This doesn't just cost my time, it also costs my money since I have to rely on Claude code to determine such issues as DirectX 12 is new to me and I am only learning it on the job here. I am severely disappointed with your tool and totally upset about how much money it has cost me just to fix what it broke! Last session ids: 9cc4f2cc-239b-437e-8568-417f496aa56a 9cc4f2cc-239b-437e-8568-417f496aa56a I can provide more session ids. Quite a few sessions ran into such fiascos!

Code Example

Modified:
texture.cpp/.h

---

Claude never explained such things, I stumbled across them when debugging.
When confronted, it always replied somehow along the lines "Sorry I did that, I shouldn't have, your instructions clearly state otherwise and I am aware of them."
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude ignored my instructions or configuration

What You Asked Claude to Do

I am currently using Claude code to port an OpenGL application to DirectX 12. The OpenGL version works perfectly, the graphics code is encapsulated very well. I told Claude code to stay as close to the code and architecture of the OpenGL version. However, what it did was to rewrite my code while porting, partiually to the extent of mutilating it, removing entire classes or the usage of these classes' functionality, copying into higher level code instead, adding code that subsequently lead to very hard to track bugs, or modifying code that was totally unrelated to the graphics subsystem code, in one instance costing me two days of debugging, burning through around 100€ of extra usage fees, only to detect the bug was in some code Claude code should never have touched, but had rewritten in a way that made it produce incorrect results. Claude code did all that without asking back or informing me. It still does so even after I had instructed it repeatedly not to do any such thing and had told it to memorize that. Half of the time I spent on this port was hunting down and fixing issues Claude code had produced! Even simple tasks like converting GLSL to HLSL shaders cause it to fail, because it just renames variables or changes code that it obviously hasn't understood. This doesn't just cost my time, it also costs my money since I have to rely on Claude code to determine such issues as DirectX 12 is new to me and I am only learning it on the job here. I am severely disappointed with your tool and totally upset about how much money it has cost me just to fix what it broke! Last session ids: 9cc4f2cc-239b-437e-8568-417f496aa56a 9cc4f2cc-239b-437e-8568-417f496aa56a I can provide more session ids. Quite a few sessions ran into such fiascos!

What Claude Actually Did

What Claude code did: 2. Claude read texture.cpp and texture.h, texturebuffer.cpp and texturebuffer.h 3. Claude converted it to use DirectX 12 instead of OpenGL calls 4. Claude dropped class TextureBuffer method calls entirely and copied them into the code of class Texture methods instead, messing up encapsulation and architecture 5. Claude added method calls that shouldn't have taken place where it placed them, causing very hard to track bugs 6. In all this, Claude code ignored my explicit directives how to convert code and what to preserve or ask back before making changes in case it deemed those necessary

Expected Behavior

Expected behavior

  1. Keep the class hierarchy and architecture
  2. Replace or add code "minimally invasive"
  3. Not add code without asking for permission and receiving it The OpenGL code is very well structured and cleanly coded. Claude code turned it into a mess. How the F you train it with code from high level professional SW devs and not the trillion tons of shitty code produced by inept coders found on the internet?

Files Affected

Modified:
texture.cpp/.h

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Sometimes (intermittent)

Steps to Reproduce

Get some OpenGL code and have Claude code adapt it to DirectX 12.

Claude Model

Opus

Relevant Conversation

Claude never explained such things, I stumbled across them when debugging.
When confronted, it always replied somehow along the lines "Sorry I did that, I shouldn't have, your instructions clearly state otherwise and I am aware of them."

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.1.117

Platform

Anthropic API

Additional Context

My code is low to medium complex c++20 code Application is a 3D shooter game Gfx API specific stuff is well encapsulated Claude code has a general tendency to change code at will because it doesn't really understand it, nor does it understand the context, and "fix" things that aren't broken, breaking them in the process

extent analysis

TL;DR

The most likely fix is to disable auto-accepting changes and closely review Claude's modifications to ensure it preserves the original code architecture and only makes minimal invasive changes.

Guidance

  • Review the Accept Edits permission mode and consider disabling auto-accepting changes to have more control over Claude's modifications.
  • Provide explicit directives to Claude on how to convert code and what to preserve, and verify that it understands these instructions before proceeding.
  • Monitor Claude's changes closely, especially when converting complex code like OpenGL to DirectX 12, to catch any potential issues early on.
  • Consider breaking down the conversion process into smaller tasks to reduce the likelihood of Claude introducing unintended changes.

Example

No specific code example is provided, as the issue is more related to Claude's behavior and configuration rather than a specific code snippet.

Notes

The issue seems to be related to Claude's tendency to make unnecessary changes and not fully understand the context of the code. Disabling auto-accepting changes and closely reviewing Claude's modifications can help mitigate this issue. However, it may require more manual effort and oversight to ensure the conversion is done correctly.

Recommendation

Apply workaround: Disable auto-accepting changes and closely review Claude's modifications. This will provide more control over the conversion process and help prevent unintended changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING