C:/Program Files/Git/clear command does not clear terminal scrollback - previous session data remains visible

Resolved 💬 3 comments Opened Jan 27, 2026 by balandari Closed Jan 27, 2026

Description

The /clear command resets the conversation context (tokens) but does NOT clear the terminal display. Previous session content remains fully visible in scrollback, including sensitive personal information.

Environment

  • Claude Code version: 2.1.20 (npm)
  • OS: Windows 11 Pro (Version 10.0.26200.7628)
  • Terminal: PowerShell (Windows Terminal)
  • Mode: --dangerously-skip-permissions

Steps to reproduce

  1. Start a Claude Code session
  2. Have a conversation that includes sensitive information
  3. Run /clear
  4. Scroll up in the terminal

Expected: Terminal display is cleared, previous content not visible
Actual: All previous session content remains in scrollback

Privacy/Security concern

After /clear, the following types of sensitive data remained visible in my terminal:

  • Government agency confirmation numbers
  • Personal mailing addresses
  • Employment status details
  • Application/account information

Users may reasonably expect /clear to clear the display, not just reset the conversation context. If someone else views the terminal after /clear, they can see the full previous conversation.

Evidence

22 screenshots documenting the issue available. The scrollback contained the entire previous session - approximately 22 screens of content on a 32" portrait monitor.

Suggested fix

/clear should either:

  1. Actually clear the terminal display (send ANSI clear + reset scrollback)
  2. Be renamed to /reset with documentation clarifying it only resets context, not display
  3. Add a separate /cls or /clearscreen command for display clearing

Related

This was discovered while investigating #21039 (multiple startup banner renders). That issue is about Ink rendering; this issue is about /clear behavior and user expectations around sensitive data visibility.

Workaround

Manually clear terminal with cls (Windows) or clear (Unix) after /clear, or close and reopen the terminal.

View original on GitHub ↗

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