anthropics / anthropics/claude-code
[BUG]
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### 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?
When using the Claude Code plugin (latest version) in Terminal mode in VS Code, the tabs now close. Prior versions (I believe 2.1.234 and earlier) worked perfectly fine. This just broke with an update
### What Should Happen?
The tab/session that the Claude Code Terminal was is should remain, and be there after a restart
### Error Messages/Logs
```shell
Why this breaks persistence: isTransient is a documented VS Code TerminalOptions flag whose entire purpose is: "the terminal will not persist when the window is reloaded or shut down and restarted." It overrides the global terminal.integrated.enablePersistentSessions setting (which defaults to true and is unset on your machine, so that setting was never the issue). With isTransient: true, VS Code doesn't even attempt to revive the tab or its scrollback on the next launch — it just drops it, which is exactly what your screenshots show: the "Claude Code" terminal tab is gone entirely and the editor group falls back to the Welcome tab, while the plain WebView tab next to it (unaffected by this flag) survives fine.
This lines up with your report that 2.1.234 worked and the current version doesn't — somewhere between those versions, Anthropic's extension started (or kept) marking the Claude-launched terminal as transient, which silently opts it out of restart persistence.
What you can do about it:
This is a bug in the extension itself, not a local misconfiguration — nothing in your VS Code settings.json can override isTransient from the caller side.
Worth filing at https://github.com/anthropics/claude-code/issues (the bugs.url in the extension's own package.json) referencing that createTerminal is called with isTransient: true, which defeats terminal-mode session persistence across restarts — and that this regressed vs. 2.1.234.
As a workaround, using the non-terminal "native UI" panel mode (claudeCode.useTerminal: false) uses a real webview (claudeVSCodePanel) with a registered WebviewPanelSerializer, which — as your own before/after screenshots show for the other WebView tab — does survive restarts.
```
### Steps to Reproduce
1. Open VS Code
2. Open Claude Code (making sure that it opens in Terminal mode)
3. Type a test question
4. Open Claude Code (this time in WebView mode)
5. Type a test question
6. Close VS Code
7. Re-start VS Code. You will now see the terminal session and any work within it gone. The WebView session is still there
### Claude Model
None
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
2.1.234 and prior
### Claude Code Version
2.1.236 (Claude Code)
### Platform
Anthropic API
### Operating System
Windows
### Terminal/Shell
VS Code integrated terminal
### Additional Information
_No response_
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start at the extension's package.json and trace the createTerminal call used by Terminal mode, focusing on the isTransient setting described in the report. Reproduce the restart behavior on Windows with VS Code 2.1.236, then verify that the Claude Code terminal and its session persist after restart as they did in 2.1.234.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- vscode
- Lĩnh vực
- desktop, developer-experience
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100