C:/Program Files/Git/clear command does not clear terminal scrollback - previous session data remains visible
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
- Start a Claude Code session
- Have a conversation that includes sensitive information
- Run
/clear - 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:
- Actually clear the terminal display (send ANSI clear + reset scrollback)
- Be renamed to
/resetwith documentation clarifying it only resets context, not display - Add a separate
/clsor/clearscreencommand 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗