You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repeating: The model used search patterns that don't match anything in the file. Retrying... #8237
Thanks for reporting this. This is a known, long-standing issue tracked in #4384 (the meta-issue for file editing reliability), and there's also #7665 which is essentially a duplicate reporting the same infinite retry loop.
What's happening
When Cline uses the replace_in_file tool, it needs the model to provide an exact text match of the code being replaced. When the model outputs search patterns that don't match the file (often due to whitespace/indentation differences or the model "remembering" an older version of the file), Cline retries. Without intervention, this can loop indefinitely, burning through tokens and money.
GPT-5.1/5.2 context
You mentioned using GPT-5.2 and another commenter mentioned GPT-5.1. Interestingly, Cline recently added an APPLY_PATCH tool specifically for GPT-5.1+ models (PR #8167, merged Dec 18) which should theoretically be more reliable since it's the patch format these models were trained on. However, this only applies when native tool calling is enabled.
Could you confirm:
Are you using native tool calling in your settings?
Is this happening with a specific type of file or code pattern?
Can you share the Cline logs from when this occurs? (They would help identify whether it's using replace_in_file vs APPLY_PATCH)
Existing safeguards
Cline already has a maxConsecutiveMistakes setting (default: 3) that should pause and ask for guidance when this happens repeatedly. There's also a recent PR (#8189) that auto-fails tasks in YOLO mode when this limit is hit. However, the core issue is that the model keeps retrying the same failing pattern.
Workarounds
From #4384 comments, some users have had success adding custom instructions like:
"For replace_in_file tool, ensure you use correct indentation. If search and replace does not work after 2 attempts, fall back to write_to_file or ask the user for help."
Still an Issue in Cline v3.46.1; had these issues repeatedly during last few days. Sorry for cross posting; it's just super annoying. Steals time and token budget.
Thanks for the report. PR #9933 was just merged — it adds detection for repeated identical tool calls, which should catch the repeating search pattern issue. Expect the fix in the next release. Feel free to reopen if you still see it after updating.
Activity
linear commentedon Dec 20, 2025
CLINE-531
mosmondor commentedon Dec 20, 2025
Was using gpt-5.2 at the time.
alexe100dra commentedon Dec 21, 2025
happens a lot lately .... i'm on gpt-5.1
github-actions commentedon Dec 21, 2025
Thanks for reporting this. This is a known, long-standing issue tracked in #4384 (the meta-issue for file editing reliability), and there's also #7665 which is essentially a duplicate reporting the same infinite retry loop.
What's happening
When Cline uses the
replace_in_filetool, it needs the model to provide an exact text match of the code being replaced. When the model outputs search patterns that don't match the file (often due to whitespace/indentation differences or the model "remembering" an older version of the file), Cline retries. Without intervention, this can loop indefinitely, burning through tokens and money.GPT-5.1/5.2 context
You mentioned using GPT-5.2 and another commenter mentioned GPT-5.1. Interestingly, Cline recently added an
APPLY_PATCHtool specifically for GPT-5.1+ models (PR #8167, merged Dec 18) which should theoretically be more reliable since it's the patch format these models were trained on. However, this only applies when native tool calling is enabled.Could you confirm:
replace_in_filevsAPPLY_PATCH)Existing safeguards
Cline already has a
maxConsecutiveMistakessetting (default: 3) that should pause and ask for guidance when this happens repeatedly. There's also a recent PR (#8189) that auto-fails tasks in YOLO mode when this limit is hit. However, the core issue is that the model keeps retrying the same failing pattern.Workarounds
From #4384 comments, some users have had success adding custom instructions like:
Possible Duplicates:
saoudrizwan commentedon Dec 21, 2025
hey! we tracked this down to a bug with recent changes to native tool calling and parallel tool calling. fix is coming in the next release 🙏
RuntimeRacer commentedon Jan 4, 2026
Still an Issue in Cline v3.46.1; had these issues repeatedly during last few days. Sorry for cross posting; it's just super annoying. Steals time and token budget.

BlackDahlia313 commentedon Feb 11, 2026
I am having this issue and I am using claude. Like Cline has become useless to me now.
feat: add doom loop detection for repeated identical tool calls
ClineXDiego commentedon Mar 24, 2026
Thanks for the report. PR #9933 was just merged — it adds detection for repeated identical tool calls, which should catch the repeating search pattern issue. Expect the fix in the next release. Feel free to reopen if you still see it after updating.
riverar commentedon May 15, 2026
Stiill seeing this in 3.83.0 w/
gemma-4-26B-A4B-it