Add URI handler for opening new sessions programmatically

Resolved 💬 1 comment Opened Feb 26, 2026 by tmthyhrr Closed Mar 7, 2026

Feature Request

Add URI handler paths to the Claude Code VS Code extension so that new sessions/tabs can be opened programmatically from the terminal.

Use Case

When working with git worktrees and multiple Claude Code sessions, it's common to need to open a new session tab in the current window — for example, as part of a "new session" handoff workflow where the current session preps context and then spawns a fresh one.

Current State

  • The extension registers claude-vscode.editor.open (Open in New Tab) and claude-vscode.newConversation (New Conversation), but these can only be triggered from the command palette
  • The extension's URI handler (vscode://anthropic.claude-code/...) only handles /install-plugin
  • VS Code's CLI has no --command flag to execute extension commands (microsoft/vscode#105487)
  • AppleScript keyboard simulation is unreliable with multiple windows

Proposed Solution

Add URI handler paths to the extension:

vscode://anthropic.claude-code/open          → opens a new Claude Code tab
vscode://anthropic.claude-code/new-session   → opens a new tab with fresh conversation
vscode://anthropic.claude-code/open?prompt=continue  → opens with initial prompt

This would enable:

open "vscode://anthropic.claude-code/new-session"

Workaround

Opening new VS Code windows works via CLI (code /path), but opening a new tab in the same window has no reliable programmatic path.

Environment

  • Claude Code v2.1.59 (VS Code extension)
  • macOS

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗