anthropics / anthropics/claude-code

[BUG] VSCode extension: session tab bar close button closes the OTHER tabs and keeps the current one

Aperta
#92,219 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:ide bug has repro platform:vscode platform:windows
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

In the VSCode extension, the Claude session tab bar (the strip listing the multiple Claude tabs I have open) has a close button on the tabs. Clicking it does not close the tab I clicked — it closes the **other** session tabs and leaves the active one open.

So the control behaves as "close all other tabs" while presenting itself as "close this tab".

### Steps to Reproduce

1. In VSCode, open several Claude sessions so the Claude tab bar shows multiple tabs.
2. With one tab active, click the close (X) button in that tab bar.
3. Observe: the other session tabs are closed and the active tab remains open. The expected result is that only the clicked tab closes.

### Expected vs Actual

- **Expected:** the close button closes the one tab it belongs to, leaving all other session tabs open.
- **Actual:** the other session tabs are closed and the current one stays open.

### Note: the behaviour itself is useful — it just needs its own affordance

"Close all other Claude sessions, keep the one I'm working in" is a genuinely useful action, especially after a session sprawl. Please don't just delete it — the ask here is:

1. Make the tab close button close *that* tab.
2. Keep the close-others behaviour as a separate, explicitly labelled action (context-menu item and/or a contributed command, e.g. `claude-vscode.closeOtherSessions`), so it is discoverable and not triggered by accident.

### Additional context from inspecting the shipped extension

Before filing I checked the installed extension for an intentional "close others" action and could not find one, which is part of why this looks like a mis-wired handler rather than a deliberate (if surprising) feature:

- `package.json` in `anthropic.claude-code-2.1.260-win32-x64` contributes session-tab commands `claude-vscode.renameSessionTab`, `claude-vscode.addSessionTabToGroup`, `claude-vscode.markSessionUnread`, and `claude-vscode.reopenClosedSession` — but no close, close-others, or close-all command.
- Neither `extension.js` nor `webview/index.js` contains any "close other / close all / clear completed"-style UI string for sessions or tasks.

Because there is no labelled close-others action anywhere in the contributed commands, users have no way to know this is what the button will do.

### Related

- #29631 — `Cmd+W` closing two Claude tabs at once in the VSCode extension. Different symptom and likely a different cause (keybinding double-handling vs. the tab bar's own close handler), but both are session-tab close handling in the VSCode extension.

### Environment

- Claude Code VSCode extension: 2.1.260 (win32-x64); 2.1.259 also present in `~/.vscode/extensions`
- VSCode: 1.136.1 (x64)
- OS: Windows 11 Home 10.0.26200

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the tab-bar close behavior in the VSCode extension with multiple Claude sessions. Inspect the shipped extension entry points named in the issue: package.json, extension.js, and webview/index.js, focusing on session tab close handlers and contributed commands. Done means the clicked tab closes, other tabs remain open, and the close-others behavior is exposed as a separate labelled command or menu action.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, vscode
Ambito
desktop, developer-experience
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
70/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.