Agent Context Forking

Feature request for product/service

Cursor IDE

Describe the request

A trick I’ve learned with debugging is that after I’m done debugging I can just click in the prompt window from before we began and type a new prompt to continue on as though the bug never existed. Continuing without reverting I’m sure is nothing new to many of you but using it this way as far as I’m aware restores context pre-summarization if there was one during the debugging phase. Essentially restoring the train of thought and relevant context to it’s original state. A very valuable feature for saving the context window and delaying having to begin a new session, and an underrated one that needs love in the IDE I think. Right now searching through that chat history for the right spot is a bit time consuming sometimes depending on how long you were debugging for and more importantly making sure you didn’t talk about something you learned that is important to further development.

What I propose is an addition to the Agent Pane. An Agent Tree dropdown view, but not a standard file system tree, think timeline divergence style tree. Each branch forks off a previous agent conversation. Forking would be initiated by manual toggle by the user or automatically initiated during set conditions such as receiving debugging prompts and as a baked in rule for when the agent is thinking about debugging. Forks could be color coded to make it easier to see and select a previous context fork to load from within each agent chat. The dropdown could pop down upon selecting an agent chat in the Agents pane. Once completing debugging the user can click on the previous fork they were on before they started debugging and select a confirmation to save or discard changes and return to previous fork. Optionally there could be a method by which as part of the return to fork we check for lessons learned that we want to hold on to from debugging and paste into the first prompt as text when returning to fork, but if so these should be no more than a sentence or two, no code snippets. Forking might also trigger on changes to Ask mode, with an option to summarize in point form the discussion with the lessons learned and changes decided upon and return to fork from before switching to Ask Mode with the points as new prompt text. Including as prompt text instead of a context attachment I think is better so users can be satisfied everything’s there that should be.

Time based forking. I also believe anytime a user creates a new agent chat and saves file changes that should constitute a new global fork point for all previous chats. For instance if changes are made in Chat A and I later go back to Chat B once I send a request it should show a break in the fork in Chat B with a side fork coming out of the gap ghosting off. Clicking said fork should link to the appropriate chat, Chat A, and hovering perhaps a tooltip for the chat title and days previous count or date. This would increase transparency and clarity of what changes were made to a project and when in the chronological order of the agent chats.

This feature would improve context window efficiency, as well as save time. I believe it would also improve user experience greatly.