A VS Code extension that gives Claude Code what it's missing: a live session panel that shows exactly which Claude sessions are running right now, lets you switch between them with one click, and keeps every background session alive while you focus elsewhere.
Claude Code supports multiple concurrent sessions — each one keeps running in the background even when its tab is hidden. But there's no built-in way to see at a glance which sessions are active, what they're doing, or switch to one without hunting through tabs.
This extension adds a Claude Sessions panel to your Secondary Sidebar that solves exactly that.
The panel shows only sessions that have a running Claude process right now. It detects this by reading ~/.claude/sessions/<pid>.json — files Claude Code writes for each active session — and verifying the PID is still alive using the Linux kernel's procStart timestamp (so recycled PIDs don't fool it). Sessions that end disappear automatically.
Each session row shows a live status dot updated every 5 seconds:
| Indicator | Meaning |
|---|---|
| 🟢 Spinning green ring | Claude is actively running tools or computing |
| 🟡 Pulsing yellow dot | You sent a message — Claude hasn't responded yet |
| ⚫ Dim gray dot | Session is idle, waiting for your input |
Click any session row to bring that Claude Code panel to the front — in the same window, no new windows opened. The × button closes the Claude Code editor tab entirely.
Past conversations live in a collapsible History ▶ section. Click any item to re-open it as a live session.
Session titles match exactly what Claude Code shows in its own tab bar — the AI-generated summary (e.g. "Fix authentication bug"), not your raw first message.
- Go to the Releases page and download
claude-session-switcher-0.0.2.vsix - In VS Code: Extensions panel →
···menu → Install from VSIX... → select the file - Reload the window when prompted
git clone https://github.com/eranra/claude-session-switcher.git
cd claude-session-switcher
npm install
npx @vscode/vsce package --no-dependenciesThen install the generated .vsix as above.
Press F5 in VS Code to launch an Extension Development Host with live reloading.
- Claude Code installed and activated
- VS Code 1.65 or later
- Linux or WSL (relies on
/procfor PID liveness detection)
- Open the Secondary Sidebar (
Ctrl+Alt+Bor View → Secondary Side Bar) - The Claude Sessions panel appears automatically
- Open Claude Code sessions — they appear in the panel in real time
| Action | How |
|---|---|
| Switch to a session | Click the row |
| Close a session tab | Click × on the row |
| Start a new session | Click + |
| Browse past sessions | Click History ▶ |
| Resume a past session | Click any History item |
Claude Code writes a JSON file to ~/.claude/sessions/<pid>.json for every active session:
{
"pid": 1641086,
"sessionId": "3bfad019-...",
"cwd": "/home/user/my-project",
"startedAt": 1781443340390,
"procStart": "33842439",
"entrypoint": "claude-vscode"
}For each file the extension checks:
- PID alive? —
process.kill(pid, 0)(signal 0 checks existence without sending a signal) - Not a recycled PID? — compares
procStartto/proc/<pid>/statfield 21 (kernel start-time in jiffies) - VS Code session? —
entrypoint === "claude-vscode"(excludes CLI runs) - Started today? —
startedAtwithin the last 24 hours (excludes zombie processes from a VS Code that was never restarted)
This is exact — no time-window guessing for active sessions.
The JSONL tail (last 32 KB) is scanned backward for the last meaningful record:
assistant with tool_use content → active (tools are executing)
file modified in last 30 s → active (Claude may still be streaming)
user record → waiting (message sent, no response yet)
pr-link / last-prompt record → idle (CLI session ended cleanly)
assistant + quiet 30 s → idle (response complete)
The extension reads the ai-title record Claude Code appends after the first exchange — the same title shown in Claude Code's tab bar. Falls back to the first user message for brand-new sessions.
Clicking a session calls claude-vscode.primaryEditor.open(sessionId) — Claude Code's own command — which either reveals an existing panel or opens a new editor tab in the current window. Background sessions stay alive with retainContextWhenHidden: true.
VS Code's file system watcher can silently stop delivering events in WSL2. A 5-second polling loop ensures status indicators and new sessions stay current even when watcher events are missing.
See docs/ARCHITECTURE.md for a full breakdown of components, data flows, and design decisions.
- Linux / WSL only for PID-based detection. On macOS/Windows the extension falls back to showing sessions active within the last 2 hours.
- Cannot detect which panel is visible — the VS Code tab API is unavailable from the remote extension host in WSL, so the extension knows which sessions are running but not which is currently on screen.
- New sessions appear after first exchange — Claude Code creates the session file when the first message is sent, so brand-new empty sessions aren't visible until then.
npm run compile # TypeScript → out/
npm test # vitest unit tests (29 tests)
npm run lint # ESLintIssues and pull requests welcome.
MIT