Skip to content

Command to clear context in current session #19829

Open

Description

@MrLightful

What variant of Codex are you using?

App

What feature would you like to see?

Working the worktree, I like to run review skills on empty context, giving it another chance to explore code potentially finding new edge cases.

There is, however, no way to clear context in the current session/worktree (e.g. /clear).

Additional information

No response

Activity

  1. added
    enhancement
    on Apr 27, 2026
  2. added
    app
    context
    on Apr 27, 2026
  3. etraut-openai commented on Apr 27, 2026

    @etraut-openai
    Contributor

    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?

  4. MrLightful commented on Apr 27, 2026

    @MrLightful
    Author

    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?

    @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.

  5. williamlmao commented on May 12, 2026

    @williamlmao

    Really wish we had this esp for worktrees

  6. devansh-jain-18 commented on Jun 26, 2026

    @devansh-jain-18

    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.

  7. piyushkomali commented on Sep 29, 2026

    @piyushkomali

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appcontextenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions