Agent Gets Stuck in Infinite "Chat Context Summarized" Loop, Consumes Tokens Without Producing a Response

Hi Cursor team,

I’ve been running into a recurring issue that has become quite frustrating.

One Of The Sample Request ID: 3bb6df06-da76-4737-9f51-19259c4761d4

Problem

The Cursor Agent frequently gets stuck in an infinite loop where it repeatedly shows messages like:

  • Explored X files
  • Chat context summarized
  • Thought briefly
  • Explored more files
  • Chat context summarized

This continues indefinitely without ever producing a response.

While this is happening:

  • Tokens continue to be consumed rapidly.
  • CPU usage increases.
  • The agent never finishes the task.
  • Eventually I have to cancel the request.

What’s strange

This happens even when I provide:

  • The exact file(s)
  • The exact file path(s)
  • The exact function/class to modify
  • Very specific instructions

In many cases, there is no reason for the agent to search the entire repository, yet it keeps exploring files and repeatedly summarizing context.

What I’ve already tried

  • Started a brand new chat.
  • Reindexed the workspace.
  • Restarted Cursor.
  • Reduced the prompt size.
  • Pointed the agent to only the relevant files.
  • Tried different chats.

The issue still occurs.

Interestingly, if I stop using Cursor for a few hours and come back later, it often starts working normally again. Then after some time, the problem returns.

Expected behavior

If I’ve explicitly provided the target files and paths, I’d expect the agent to primarily use those files instead of repeatedly searching and summarizing the repository.

It would also be helpful if there were:

  • a timeout for infinite planning/search loops,
  • a way to see why the planner keeps searching,
  • or a mechanism to stop token consumption when no meaningful progress is being made.

At the moment, it feels like the agent enters a planning loop that burns through tokens without making progress.

Has anyone else experienced this? If so, were you able to identify the cause or find a workaround?

Thanks!

This sounds less like a normal context problem and more like the planner losing its exit condition.

If the user gave exact files and exact symbols, the agent should eventually stop searching and either act on that scope or say what is missing. A visible “still searching because…” state would help a lot, because right now the user only sees tokens being spent without knowing whether the agent is making progress.

The Context Usage report shows 185,344 tokens under Project Rules, even though my repository only contains 8 .mdc rule files totaling roughly 3,500 lines (~708 KB for the entire .cursor directory).

This appears significantly larger than expected. Is Cursor recursively expanding project rules, or is there a bug causing rule duplication? It would be extremely helpful if the Context Explorer showed the token count per individual rule file rather than only an aggregate “Project Rules” bucket. That would make it much easier to identify which rule is responsible for the excessive context usage.

Hi @MediCall_Official!

Thanks for raising this. It looks like your repository has .cursor/skills and .agents/skills directories that contain files named AGENTS.md. Cursor treats AGENTS.md as workspace instructions, which cause their full contents to be added to the Agent context.

You probably want to convert these files to SKILL.md files with valid name and description frontmatter. They will then be discovered as Agent Skills and loaded only when relevant, rather than included in full in every request.

Can you share a screenshot what you see? I do see the breakdown of each rule.