VS Code: allow claude-vscode.editor.open to submit the initial prompt, not just pre-fill it
What I'm trying to do
I maintain a small internal VS Code extension that, for each Jira ticket, creates a git worktree, opens it in a new window, and starts Claude Code there with a templated prompt ("pick up GPM-1234: <summary> …").
Everything in that flow is automated except the very last step: a human still has to click into the panel and press Enter.
Current behaviour (extension 2.1.226, macOS)
claude-vscode.editor.open accepts (sessionId, initialPrompt, viewColumn). The prompt reaches the webview as data-initial-prompt, becomes session.initialPrompt, and ends up in setInputText(...) — so it only pre-fills the composer.
As far as I can tell there is no way to actually send it:
- none of the contributed commands submits a prompt (
newConversation,focus,blur, … don't help here); - the only
autoSubmitin the bundle belongs to voice mode (hold-to-talk); - a webview owned by another extension can't be typed into from the outside, so the only workaround is synthesizing a Return keystroke at the OS level (AppleScript + Accessibility permissions). That's fragile and breaks on any UI change.
Meanwhile the CLI already supports exactly this: claude "<prompt>" starts with the message submitted. So today the only way to get an auto-started session is to give up the panel UI, which is a parity gap rather than a missing capability.
What I'd like
An opt-in way to send the prompt rather than just fill it. For example a 4th options argument:
vscode.commands.executeCommand(
'claude-vscode.editor.open',
undefined,
prompt,
vscode.ViewColumn.Active,
{ submit: true }
)
…or a separate claude-vscode.sendPrompt command. Either works — the plumbing already exists and the prompt already arrives in the right place; it just never gets sent.
Opt-in matters: nobody should get auto-submitting behaviour by accident, but when the caller has deliberately constructed the prompt, having to press Enter is the one manual step left in an otherwise fully automated per-ticket setup.