Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Clean Start for Claude Code Terminal ModeNew to Visual Studio Code? Get it now.
Clean Start for Claude Code Terminal Mode

Clean Start for Claude Code Terminal Mode

Buhm Han

|
1 install
| (0) | Free
Auto-launch Claude Code in a terminal split & sweep leftover locked panes on startup
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Clean Start for Claude Code Terminal Mode

Auto-launches Claude Code in a terminal split and sweeps the leftover locked panes — every time you open VS Code.

If you run the Claude Code extension in terminal mode — because you'd rather have the full verbose stream (Ctrl+O) in your own shell than a spinner in a panel — you know the two chores that greet every restart:

  1. A leftover locked empty pane (with a lock icon) where your Claude terminal used to live — you close it by hand.
  2. Clicking the Claude Code button again to relaunch Claude in a fresh split.

Leftover locked panes vs a fresh Claude terminal

Clean Start does both for you. When a window with a folder opens, it:

  • closes leftover claude terminal tabs and empty editor groups (the locked ghosts), then
  • runs the same command as the Claude Code button to open a fresh Claude terminal split.

In a window with no folder open, it does nothing.

Why the ghost panes happen

Claude Code creates its terminal as transient, so VS Code never restores it after a restart. But VS Code does restore the editor layout, and the group that held the terminal is auto-locked — and locked groups are not auto-closed even when empty. That empty locked shell is the lock-icon garbage. Clean Start sweeps exactly those: groups with zero tabs, which at startup only exist as restored locked shells.

Requirements

  • The Claude Code extension (declared as a dependency, installed automatically).
  • The claude CLI available in your shell.

Notes

  • The auto-launch calls the Claude Code extension's claude-vscode.terminal.open command. If a future Claude Code update removes it, Clean Start falls back to opening a terminal split running claude directly and shows a notice.
  • You may see the ghost pane flash for a split second before it is swept — VS Code paints the restored layout before extensions run.

Credits

Icon based on Phosphor Icons (MIT).

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft