VS Code: Allow passing initial prompt to openInNewTab command

Resolved 💬 5 comments Opened Mar 5, 2026 by freshlogic Closed Apr 5, 2026

Feature Request

Problem

I want to programmatically open multiple Claude Code tabs in VS Code, each pre-loaded with a different prompt. My use case: fetch open GitHub issues from the current sprint, then open a Claude Code tab for each one with a prompt like "Triage and investigate issue #123: <title>".

Currently, claude-code.openInNewTab accepts no arguments — it just opens a blank session. There's no extension API to send a message into a session either.

Proposed Solution

Allow claude-code.openInNewTab (and similar commands) to accept an optional prompt string:

await vscode.commands.executeCommand('claude-code.openInNewTab', {
    prompt: 'Investigate issue #123: Login fails on mobile Safari'
});

Ideally also expose a proper extension API so other extensions can integrate:

const claudeCode = vscode.extensions.getExtension('anthropic.claude-code');
const api = claudeCode.exports;
await api.openSession({ prompt: '...' });

Use Cases

  • Sprint triage automation: Open a Claude session per issue in the current sprint
  • CI failure investigation: Open tabs for each failing test or workflow
  • Multi-repo tasks: Script opening sessions across different repos with specific instructions
  • Custom VS Code extensions: Build team-specific tooling that delegates tasks to Claude Code

Current Workarounds

  • CLI with claude -p in spawned terminals (works but loses the integrated tab UX)
  • Manual copy/paste into each new tab (defeats the purpose of automation)

Environment

  • VS Code extension (not CLI)
  • macOS

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗