Session ID not displayed on start — hard to resume after terminal restore

Resolved 💬 4 comments Opened Feb 12, 2026 by rusliksu Closed Feb 16, 2026

Problem

When a computer shuts down and terminal windows are restored (e.g., Windows Terminal restores tabs), Claude Code sessions are terminated. There's no convenient way to resume the exact session that was running in a specific terminal window.

Currently:

  • claude --continue resumes the last session, which may not be the one from that terminal
  • claude --resume shows a list, but you have to guess which session was in which terminal
  • Session ID is never printed to the terminal, so there's no way to know which session was active

Proposed Solution

  1. Print session ID on start — display the session ID somewhere visible (e.g., in the header or status bar) so users can note it or find it in scrollback
  2. Auto-resume in restored terminals — store a mapping of terminal/PTY/PID to session ID, so claude --resume in a restored terminal could auto-suggest the last session that ran there
  3. claude --resume --last-in-cwd — resume the most recent session that was active in the current working directory (similar to --continue but more explicit)

Use Case

  • User has multiple Claude Code sessions in different terminal tabs
  • Computer restarts, terminal app restores the tabs
  • User wants to resume each session in its respective tab
  • Currently impossible without manually matching sessions by content/date

Environment

  • Windows 11 + Windows Terminal (tab restore feature)
  • Same issue applies to any terminal with session restore (tmux, iTerm2, etc.)

🤖 Generated with Claude Code

View original on GitHub ↗

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