Skip to content

[FEATURE]: add /clear slash command to clear conversation in the same session (similar to claude code) #19499

@sdeonvacation

Description

@sdeonvacation

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Use Case

When working on a long session, the conversation history can become cluttered with irrelevant messages from previous tasks. Currently, users must create a new session to start using /new command
fresh, losing the session context.

The /clear command would allow users to:

  • Clear all messages from the current session
  • Keep the same session (preserving session ID, title, etc.)
  • Start fresh without context from previous messages being sent to the model

Proposed Implementation

  • Add a new slash command /clear in the TUI
  • Delete all messages via the existing session.deleteMessage API
  • Refresh the UI after deletion
  • Show a toast confirming how many messages were cleared

Verification

Tested locally:

  • Command appears in slash command menu
  • Messages are deleted from database
  • UI refreshes to show empty conversation
  • New messages after /clear don't include old context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions