claude-code - 💡(How to fix) Fix [BUG] Claude over-gathering context [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#52341Fetched 2026-04-24 06:09:44
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

Error Messages/Logs

Root Cause

When i look at what it is reading, it breaks out ILDASM in some cases, which is completely unnecessary. It seems that it will consistently gather context, well and truly beyond what it needs, just because.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

I have a significantly large solution, all in C#, which now spans more than 170 projects in total. Whenever I ask Claude to do anything, it over-gathers context to the extent that it cannot even write a single file. It times out or will sit, doing nothing, for hours on end.

I am using version 2.1.118 (Claude Code), Opus 4.7, Sonnet 4.6.

When i look at what it is reading, it breaks out ILDASM in some cases, which is completely unnecessary. It seems that it will consistently gather context, well and truly beyond what it needs, just because.

When asked about why it is going down that path, you get the "that's on me - i over gathered context".

Even when directed and specific projects and specific files, it will eventually go and start gathering the entire solution. It claims that it's objective is to be thorough, but it is impossible to limit how it proceeds as it will constantly.

I instruct it to break everything down into small tasks, and implement it step by step, it surveys absolutely everything and becomes unusable.

I tell it, in a clear session, to create 10 simple, empty files, in a very specific location, not to look at anything else, only to create those 10 files - 1hr and 26mins later and it's created two of the ten files. It will time out and just go crazy with gathering context. Why on earth is it doing this? and ILDASM on System.Net.dll? ILDASM on package DLLs in random areas?

Is it determine to fill up the 1M context? it literally cannot perform anything and will time out constantly. When asking about it, it will tell me the context is large, writing these 40 lines of code is comprehensive, i should instruct it to write more clearly etc etc

I instructed it to write "here is some random text" into a MarkDown file... 58 minutes and it still hadn't done in, in a new session. What on earth is going on with Claude Code?

What Should Happen?

Claude should literally do only what it is instructed to do, not go into deep rabbit holes.

Error Messages/Logs

Steps to Reproduce

  1. Open up Claude Code in the repo of the solution
  2. Instruct Claude to do something which requires writing or editing a file, in a specific location
  3. sit back and wait for it to gather the entire solution into context, then go into rabbit holes using ILDASM

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.118 (Claude Code)

Platform

Anthropic API

Operating System

Other

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by breaking down tasks into smaller, more specific instructions to limit Claude Code's context gathering.

Guidance

  • Try providing more specific and narrow instructions to Claude Code to reduce unnecessary context gathering.
  • Consider breaking down large tasks into smaller, step-by-step instructions to help Claude Code focus on the required task.
  • Verify that the issue is not related to the large solution size by testing Claude Code with a smaller solution or a minimal example.
  • Check if there are any configuration options or settings in Claude Code that can help limit the context gathering or optimize performance.

Notes

The issue seems to be related to Claude Code's tendency to over-gather context, which can be mitigated by providing more specific instructions. However, without more information about the previous working version or the exact changes made, it's difficult to determine the root cause of the regression.

Recommendation

Apply workaround: Provide more specific and narrow instructions to Claude Code to reduce unnecessary context gathering, as this seems to be the most effective way to mitigate the issue given the current information.

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