[FEATURE] Clear terminal scrollback on /clear, consistent with Codex CLI
Preflight Checklist
- [x] I have searched existing requests. Previous reports were closed without a fix (see Additional Context).
- [x] This is a single feature request (not multiple features)
Problem Statement
/clear resets the conversation, but the terminal scrollback still holds the previous conversation. After /clear, scrolling up in the terminal shows the old conversation, so the screen does not look like a fresh session.
Codex CLI clears the terminal scrollback when its conversation is cleared. I use both tools every day, and the different behavior is a constant source of friction: after clearing in Claude Code, I still have to clear the terminal by hand (for example, with Cmd+K), and I often forget because Codex does it for me.
Proposed Solution
When /clear runs, clear the terminal scrollback as well as the visible screen (for example, by emitting ESC[3J along with the usual screen clear), so that no content from the previous conversation remains in the terminal.
Some users prefer to keep the scrollback (see #7597), so a setting to opt out would cover both preferences.
Alternative Solutions
- Pressing Cmd+K (or the terminal's own "clear scrollback" action) after every
/clear. This works, but it is an extra manual step that is easy to forget.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- Have a long conversation in Claude Code.
- Run
/clearto start a new task. - Scroll up in the terminal.
- Expected: nothing from the previous conversation is visible, the same as after clearing in Codex CLI.
Actual: the previous conversation is still in the scrollback.
Additional Context
- Environment: Claude Code 2.1.292, macOS 26.6.1, Ghostty 1.3.1 (no tmux)
- Related issues, all closed and locked without a fix:
- #11260 Terminal scrollback buffer not cleared on /clear. Closed as not planned by the inactivity bot despite recent human comments, including reports on macOS and Windows.
- #18147 /clear command doesn't clear terminal scrollback buffer. Closed with no fix mentioned. It also raises a privacy concern: content from before
/clearremains visible in the terminal. - #16457 Closed as a duplicate of #11260.
- #7597 The opposite preference (keep the scrollback), which is why I suggest an opt-out setting.