[BUG] VS Code extension: Tab names change inconsistently on window reload

Resolved 💬 3 comments Opened Mar 28, 2026 by sumanaddanki Closed Apr 1, 2026

What's Wrong?

When reloading VS Code window (Cmd+Shift+P → "Developer: Reload Window"), Claude Code tabs get reassigned to different sessions, causing tab names to change unexpectedly.

Example:

  • Tab was named "Squad Suma MCP" (from my first message in that session)
  • After reload, same tab now shows "you went into a state" (a different session's first message)

The session-to-tab assignment appears random on each reload when multiple sessions exist.

What Should Happen?

  1. Tab names should persist across reloads (same tab = same session)
  2. OR: Tab names should be editable/renameable (like the CLI's --name flag)
  3. OR: Users should be able to pin specific sessions to specific tabs

Error Messages/Logs

No error messages — the behavior is silent but disorienting.

Steps to Reproduce

  1. Open VS Code with Claude Code extension
  2. Create 5+ Claude Code tabs over time, each starting with a different first message (e.g., "Squad Companion", "Squad Suma MCP", "Discussion")
  3. Work for a while, accumulating sessions
  4. Run Cmd+Shift+P → "Developer: Reload Window"
  5. Observe that tab names have changed — "Squad Suma MCP" might now show as "you went into a state" or another session's first message

Root Cause (Observed)

  • Tab names are derived from the first user message in each session (stored in ~/.claude/projects/<hash>/<session-id>.jsonl)
  • Multiple sessions exist (20+ in my case)
  • On reload, VS Code extension reassigns which session goes to which tab
  • The assignment isn't deterministic, causing name changes

Suggested Fix

  1. Persist tab-to-session mapping — save which session ID was in which tab position
  2. Add /rename command — let users rename tabs explicitly
  3. Support --name in VS Code — the CLI has claude --name "My Tab" but VS Code extension doesn't use it

Claude Code Version

2.1.84 (Claude Code)

Platform

  • API Platform: Anthropic (direct)
  • OS: macOS Sequoia 15.3.1
  • Terminal/Shell: VS Code integrated terminal (zsh)

Additional Information

I have a complex multi-project workflow with ~20 named sessions (Squad Companion, Squad Mentor, Squad Suma MCP, etc.). Each represents a different product/context. The tab renaming on reload breaks my mental model and workflow.

The CLI's --name flag exists and works great — please bring this to VS Code extension.

View original on GitHub ↗

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