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
Command to clear context in current session #19829
The way I typically do this is to ask the agent to create a subagent to do the work. Subagents work within the same context (worktree) but get an empty context. Once a subagent is done, it reports back to the main agent, which can then supply the answer to you. Does that address your use case?
The way I typically do this is to ask the agent to create a subagent to do the work. Subagents work within the same context (worktree) but get an empty context. Once a subagent is done, it reports back to the main agent, which can then supply the answer to you. Does that address your use case?
Well, not quite. Usually after running the reviews, I want to continue with discussing details & making new plans for the fixes, which in this way still happens in the already polluted session. I'd rather keep it entirely clean for these continuation stuff, which can be quite large on their own.
This also shows up in the existing-worktree workflow from #22316.
The concrete need is: keep the same worktree/files/git index, but drop the accumulated transcript/context so a fresh pass can continue from the current filesystem state. Forking does not solve this because it preserves history, and New worktree does not solve it because it creates a different checkout.
A /clear-style command in the current session/worktree would be one good solution; a separate "New thread here" / "Use existing worktree" flow would be another.
Reacted by Roman Sirokov, daniellee-ytl, ddofborg, Stas Slesarev and Bruno De Martino
This also shows up in the existing-worktree workflow from #22316.
The concrete need is: keep the same worktree/files/git index, but drop the accumulated transcript/context so a fresh pass can continue from the current filesystem state. Forking does not solve this because it preserves history, and New worktree does not solve it because it creates a different checkout.
A /clear-style command in the current session/worktree would be one good solution; a separate "New thread here" / "Use existing worktree" flow would be another.
One way that I try and do a new chat / same worktree is clicking the 3 dots next to "Share" and going to Fork > New chat in this worktree.
But, I don't like this either because it complete resets the UI. I like staying within the same UI in the original chat. This create a new thread under the project as well as I can no longer see the same history in the Review tab. Last turn has been cleared because it's a new chat.
I wish I could just create a new tab on the Left Hand Side that starts an empty chat, same worktree and doesn't block the Right Hand Side the way a 'Side chat' does
Activity
etraut-openai commentedon Apr 27, 2026
The way I typically do this is to ask the agent to create a subagent to do the work. Subagents work within the same context (worktree) but get an empty context. Once a subagent is done, it reports back to the main agent, which can then supply the answer to you. Does that address your use case?
MrLightful commentedon Apr 27, 2026
@etraut-openai, thanks for the suggestion.
Well, not quite. Usually after running the reviews, I want to continue with discussing details & making new plans for the fixes, which in this way still happens in the already polluted session. I'd rather keep it entirely clean for these continuation stuff, which can be quite large on their own.
williamlmao commentedon May 12, 2026
Really wish we had this esp for worktrees
devansh-jain-18 commentedon Jun 26, 2026
This also shows up in the existing-worktree workflow from #22316.
The concrete need is: keep the same worktree/files/git index, but drop the accumulated transcript/context so a fresh pass can continue from the current filesystem state. Forking does not solve this because it preserves history, and
New worktreedoes not solve it because it creates a different checkout.A
/clear-style command in the current session/worktree would be one good solution; a separate "New thread here" / "Use existing worktree" flow would be another.piyushkomali commentedon Sep 29, 2026
One way that I try and do a new chat / same worktree is clicking the 3 dots next to "Share" and going to Fork > New chat in this worktree.
But, I don't like this either because it complete resets the UI. I like staying within the same UI in the original chat. This create a new thread under the project as well as I can no longer see the same history in the Review tab. Last turn has been cleared because it's a new chat.
I wish I could just create a new tab on the Left Hand Side that starts an empty chat, same worktree and doesn't block the Right Hand Side the way a 'Side chat' does