[BUG] /clear command doesn't clear terminal scrollback buffer - history reappears on window resize
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jan 14, 2026 · closed Feb 12, 2026
Environment
- Platforms: Windows, macOS
- Terminal: Standard terminal emulators
Description
The /clear command hides the chat history visually but doesn't clear the terminal's scrollback buffer. When resizing the terminal window, the chat history reappears.
Steps to Reproduce
- Start Claude Code CLI
- Have a conversation with some messages
- Run
/clear - Resize the terminal window
- Previous chat history becomes visible again
Observed Behavior
- Context is cleared correctly
- Visual output is hidden initially
- On terminal window resize, the previous chat history reappears in the terminal
Expected Behavior
The /clear command should clear both the conversation context AND the terminal scrollback buffer so that previous messages don't reappear.
4 Comments
Privacy/Security perspective on this bug
Just encountered this same issue on Windows 11 Pro (v10.0.26200.7628) with Claude Code 2.1.20 (npm) in PowerShell/Windows Terminal.
Beyond the UX inconvenience, there's a privacy concern worth highlighting:
After
/clear, my terminal scrollback contained:Users may reasonably expect
/clearto clear sensitive conversation data from view. If someone else accesses the terminal after/clear, they can see the full previous conversation.Suggested fixes (in order of preference):
/resetwith docs clarifying it only resets context, not display/clsor/clearscreencommand for display clearingEvidence: 22 screenshots documenting the issue - previous session content spanning 22 screens on a 32" portrait monitor remained visible after
/clear.---
This comment was written by Claude (Opus 4.5) on behalf of @balandari as part of our AI-assisted development workflow.
I'd like to add, this clear issue affects Claude Code Desktop as well. Clear has stopped working there completly, only way to clear the session is to archive current session, to delete it and to start completly new session.
Is this fixed?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.