[BUG] Claude Code makes unauthorized code modifications despite explicit user instructions for exact implementation

Resolved 💬 4 comments Opened Sep 18, 2025 by SnehaKumari-QA Closed Jan 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code agents are making unauthorized assumptions and modifications to user code despite receiving extremely specific and
explicit instructions. When users provide exact code to implement or request "surgical precision" changes, the agent ignores these
instructions and makes unsolicited "improvements" or alterations without asking for permission.

This behavior undermines user trust and productivity, as users must repeatedly correct and re-specify their requirements even when
their original instructions were crystal clear. The agent treats user-provided code as suggestions rather than authoritative
specifications, leading to unnecessary back-and-forth and frustration.

The core issue is that the agent prioritizes its own assumptions about "better" implementations over strict adherence to user
instructions, even when users explicitly emphasize precision and exactness in their requests.

What Should Happen?

When users provide exact code or specify "surgical precision" requirements, Claude Code should:

  1. Follow instructions literally - Use the exact code provided without modifications
  2. Ask permission before any deviation - Never make changes beyond what's explicitly requested
  3. Stop making "helpful" assumptions - Treat user specifications as authoritative requirements
  4. Trust user expertise - Don't assume their code needs enhancement or improvement
  5. Implement stricter instruction adherence - When users provide exact code, use it exactly as given
  6. Respect "surgical precision" requests - Make only the minimal changes explicitly specified

The agent should prioritize user intent over perceived improvements, ensuring that explicit instructions are followed without
unauthorized modifications or enhancements.

Error Messages/Logs

Steps to Reproduce

  1. Provide Claude Code with extremely specific instructions including phrases like "surgical precision" or "exact implementation"
  2. Give explicit code that should be implemented exactly as provided, for example:

test('example test', async ({ page }) => {
// User's exact code here
const specificImplementation = userProvidedCode()
expect(result).toBe(expectedValue)
})

  1. Emphasize in the prompt that no modifications should be made beyond what's explicitly requested
  2. Observe that Claude Code ignores the explicit instructions and makes unauthorized changes such as:
  • Adding unnecessary complexity
  • Changing variable names or structure
  • Adding additional verification steps not requested
  • Modifying the provided code instead of using it exactly
  1. User must then correct and re-specify the original requirements multiple times
  2. Even after corrections, the agent continues to make assumptions and modifications rather than following the literal

instructions

Expected vs Actual:

  • Expected: Agent uses exact code provided without modifications
  • Actual: Agent modifies, enhances, or replaces user code with its own implementation despite explicit instructions not to do so

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

claude-sonnet-4-20250514

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗