[BUG] Every other 'edit' performed in a sub-agent ends up destroying the code

Resolved 💬 3 comments Opened Nov 21, 2025 by guidedways Closed Jan 21, 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?

  • Ask Claude code fix something, such as a rename or removal of some function on a specific object
  • If this 'function' is generic such that it exists on various different classes, Claude performs an edit in a separate sub-agent and removes every single occurrence

This started happening several versions back when Claude Code was _improved_ to use sub-agents for edits. It gets them wrong every single time. I've given up on Claude Code in general but tested it again after several weeks and nothing has changed.

What Should Happen?

Please allow us to configure Claude Code to not use sub-agents for edits and refactors. I'm wall aware of the 200k context window and can manage it myself very well. I don't want claude to be using sub-agents as Claude as the primary agent is clearly unable to pass along the correct context because a) it does not read the file itself to begin with, b) the sub-agent is equally blind but worse at its job.

Error Messages/Logs

Steps to Reproduce

  • Ask Claude code fix something, such as a rename or removal of some function on a specific object
  • If this 'function' is generic such that it exists on various different classes, Claude performs an edit in a separate sub-agent and removes every single occurrence

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

The version before Claude Code started delegating its work to sub agents automatically

Claude Code Version

2.0.47

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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