# Agent always changes behavior / forgets context in the middle

**URL:** <https://forum.cursor.com/t/agent-always-changes-behavior-forgets-context-in-the-middle/86951>\
**Category:** Help\
**Created:** [May 6, 2025, 3:39pm UTC](https://forum.cursor.com/t/agent-always-changes-behavior-forgets-context-in-the-middle/86951 "2025-05-06T15:39:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elton](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@Elton](https://forum.cursor.com/u/Elton)\
**Post date:** [May 6, 2025, 3:39pm UTC](https://forum.cursor.com/t/agent-always-changes-behavior-forgets-context-in-the-middle/86951/1 "2025-05-06T15:39:47Z")

</div>

This issue has been bothering me in a very painful way recently. With the Sonnet 3.7 model, it ofen changes topic suddenly in the middle of resolving some issue or generating codes - it looks like the agent suddenly changed to another different one, and starts to read document, analyze codes from beginning and eventually gives a whole bunch of summary of the project - totally forgot its original task and target. Someone from the cusor team could explain why, and when this issue could be fixed?

---

<div class="post-metadata">

**Author:** ![Siage](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/siage/32/46704_2.png) [@Siage](https://forum.cursor.com/u/Siage)\
**Post date:** [May 7, 2025, 6:16am UTC](https://forum.cursor.com/t/agent-always-changes-behavior-forgets-context-in-the-middle/86951/2 "2025-05-07T06:16:48Z")

</div>

This issue is mostly caused by LLMs losing focus due to long or complex context. You can check out this project: [mcp-shrimp-task-manager](https://github.com/cjo4m06/mcp-shrimp-task-manager)  
It breaks down complex tasks into smaller steps and keeps guiding the LLM to stay on track. Even if the context gets too long and the model starts to drift, you can start a new conversation and ask it to continue. Shrimp will help the LLM pick up where it left off.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/127254_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 6, 2025, 6:17am UTC](https://forum.cursor.com/t/agent-always-changes-behavior-forgets-context-in-the-middle/86951/3 "2025-06-06T06:17:08Z")

</div>

Closed on June 6, 2025, 6:17am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
