[FEATURE] /clear <prompt> — clear context and immediately execute a prompt

Resolved 💬 6 comments Opened Feb 25, 2026 by dhalem Closed Apr 2, 2026

Problem

When working on long sessions, I frequently need to clear context and immediately start a new task. Currently this requires two steps:

  1. Type /clear and wait for context to reset
  2. Type the new prompt

This is a minor but frequent friction point, especially when context is getting large and you want to pivot to a new task quickly.

Proposed Solution

Allow /clear to accept an optional prompt argument:

/clear check the status of the syncer deployment
/clear review the changes in src/auth.ts

This would:

  1. Clear the conversation context (exactly as /clear does today)
  2. Immediately send the provided text as the first user message in the fresh session

Why This Is Different from #3363

Issue #3363 (now closed/locked) requested chaining slash commands (/clear && /status). This request is specifically about passing a user prompt — free-form text that becomes the first message after clearing. This is the more common use case: you want a fresh context window and you already know what you want to ask next.

Use Cases

  • Pivoting between unrelated tasks in a long session without losing your train of thought
  • Clearing bloated context before starting a complex task where you want maximum context window available
  • Quickly resetting after a task is complete: /clear now implement the login feature
  • Power users who chain workflows and want minimal keystrokes

Backwards Compatibility

Fully backwards compatible — /clear with no arguments works exactly as today.

Example

Before (current behavior):

> /clear
[Context cleared]
> analyze the test failures in sonos_server

After (proposed):

> /clear analyze the test failures in sonos_server
[Context cleared, prompt immediately executed]

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗