Grep overflows context with a single command #2129

Open
opened 2026-02-16 17:34:17 -05:00 by yindo · 3 comments
Owner

Originally created by @ClassyCircuit on GitHub (Oct 16, 2025).

Originally assigned to: @rekram1-node on GitHub.

Searching needs to be optimized, very often it will run Grep **/* (path=, pattern=containerloader) and that will return so much text that it automatically overflows the entire context window.
Especially in frontend projects with node modules.

Is it possible to limit this functionality somehow?

Originally created by @ClassyCircuit on GitHub (Oct 16, 2025). Originally assigned to: @rekram1-node on GitHub. Searching needs to be optimized, very often it will run `Grep **/* (path=, pattern=containerloader)` and that will return so much text that it automatically overflows the entire context window. Especially in frontend projects with node modules. Is it possible to limit this functionality somehow?
Author
Owner

@github-actions[bot] commented on GitHub (Oct 16, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2981: Claude's context get's filled up by reading a single file - describes how context gets filled and compacted after file operations, similar to the grep overflow issue described here

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 16, 2025): This issue might be a duplicate of existing issues. Please check: - #2981: Claude's context get's filled up by reading a single file - describes how context gets filled and compacted after file operations, similar to the grep overflow issue described here Feel free to ignore if none of these address your specific case.
Author
Owner

@ClassyCircuit commented on GitHub (Oct 16, 2025):

It's not the same as #2981. AI should add more filters when grepping files in large codebases.

@ClassyCircuit commented on GitHub (Oct 16, 2025): It's not the same as #2981. AI should add more filters when grepping files in large codebases.
Author
Owner

@rekram1-node commented on GitHub (Oct 16, 2025):

I thought we automatically truncated the grep response to try to handle this, will take a look

@rekram1-node commented on GitHub (Oct 16, 2025): I thought we automatically truncated the grep response to try to handle this, will take a look
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2129