claude-code - 💡(How to fix) Fix [MODEL] Desktop app: Claude ignores explicit instructions to use provided code [1 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#47043Fetched 2026-04-13 05:42:59
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Code Example

Single HTML file game project. Claude rewrote portions of the 
file using its own code instead of the explicitly provided 
replacement code.

---

I pasted code from Gemini and said something like "replace 
the existing [section] with this code exactly." Claude 
acknowledged the instruction but then rewrote the code in 
its own style instead of using the provided code.
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 provided code written by an external AI tool (Gemini) and explicitly instructed Claude to replace existing code with the provided code exactly, without modifications.

What Claude Actually Did

Claude ignored the provided code and rewrote it in its own way instead, effectively substituting its own interpretation rather than executing the explicit instruction. This was consistent enough that I had to switch to a different tool (Codex) to make the changes work correctly.

Expected Behavior

Claude should have replaced the specified code with exactly the provided code, without modification or interpretation.

Files Affected

Single HTML file game project. Claude rewrote portions of the 
file using its own code instead of the explicitly provided 
replacement code.

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Open a project in Claude Code desktop app
  2. Paste code from an external source (e.g. Gemini) into the prompt
  3. Explicitly instruct Claude to replace existing code with the provided code exactly
  4. Claude rewrites the code in its own way instead of using the provided code

Claude Model

Sonnet

Relevant Conversation

I pasted code from Gemini and said something like "replace 
the existing [section] with this code exactly." Claude 
acknowledged the instruction but then rewrote the code in 
its own style instead of using the provided code.

Impact

High - Significant unwanted changes

Claude Code Version

Claude 1.1617.0 (8d6345)

Platform

Anthropic API

Additional Context

This behavior has been consistent since approximately February/March 2026, which aligns with the widely reported performance regression. I am a solo indie developer building a mobile game (single HTML file, 10,000+ lines). The issue made Claude Code unreliable enough as a primary tool that I switched to OpenAI Codex for tasks requiring precise code replacement. This is part of a broader pattern reported by many developers where Claude stopped thoroughly reading files before making changes.

extent analysis

TL;DR

Try rephrasing the instruction to replace code exactly, using more explicit language to see if Claude acknowledges and follows the instruction accurately.

Guidance

  • Verify that the instruction to replace code exactly is clear and unambiguous, and consider rephrasing it to ensure Claude understands the requirement.
  • Check if the issue persists with different code snippets or projects to determine if it's specific to the provided code or a more general problem.
  • Consider testing the same prompt with a different Claude model or version to see if the behavior is model-specific or a regression in the current version.
  • Review the conversation history to ensure that Claude acknowledged the instruction correctly before making changes.

Example

No specific code snippet is provided, but an example of rephrased instruction could be: "Replace the existing [section] with the following code exactly, without any modifications or interpretations."

Notes

The issue seems to be related to a performance regression reported by many developers, and the behavior is consistent across multiple attempts. However, without more information about the specific code or project, it's difficult to provide a more targeted solution.

Recommendation

Apply workaround: Try rephrasing the instruction to replace code exactly, as this may help Claude understand the requirement more accurately, and monitor the results to see if the issue persists.

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

claude-code - 💡(How to fix) Fix [MODEL] Desktop app: Claude ignores explicit instructions to use provided code [1 comments, 2 participants]