[BUG] Command history from other sessions appears when using arrow keys in a new session
[BUG] Command history from other sessions appears when using arrow keys in a new session
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (2.1.50)
What's Wrong?
When multiple Claude Code sessions are running concurrently in different terminals, after exiting one session with /exit and resuming it with claude -c, the command history (accessed via Up/Down arrow keys) contains command history from other concurrent sessions, not just the current session.
What Should Happen?
The Up/Down arrow key command history should only show commands from the current session, not mixed with commands from other concurrent sessions.
Steps to Reproduce
- Open multiple terminals, run
claudein each terminal - Enter some different commands in each session (e.g., "help" in terminal 1, "model" in terminal 2)
- In one of the sessions, enter
/exitto exit - In the same terminal, run
claude -cto resume the session - Press Up/Down arrow keys to browse command history
- Observe that commands from other concurrent sessions appear in the history
Is this a regression?
Unknown - not sure if this worked differently in previous versions.
Claude Code Version
2.1.50 (Claude Code)
Platform
Claude API (anthropic)
Operating System
Windows 10
Terminal/Shell
Windows Terminal
Additional Information
This causes confusion when resuming a session as users may accidentally execute commands intended for a different session. Each session should maintain its own isolated command history.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗