[FEATURE] Feature: API/CLI to programmatically open new Claude Code conversation sessions in VS Code
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Add a way to programmatically open a new Claude Code conversation session (panel/tab) in VS Code from within an existing session or from a CLI subprocess.
Use Case
When building agentic workflows with recurring tasks (e.g. /loop or CronCreate), it's useful to spawn each triggered task in its own isolated conversation session visible in the VS Code UI — rather than accumulating all output in the current session thread.
Concrete example: A cron job monitors a Slack channel for new alerts. When an alert arrives, the ideal UX is for a new Claude Code conversation tab to open in VS Code focused on that specific alert, where the user can interact with it independently.
Current Workaround
- Using the
Agenttool spawns a subagent, but its output flows back into the current session thread claude -p "..."spawns a headless subprocess (not visible in VS Code UI)- Opening a new terminal tab with
claudeworks but is not integrated into the VS Code panel UI
Proposed Solution
One or more of:
- VS Code command:
claude.openNewSession(callable viacode --command) that opens a new conversation panel with an optional pre-filled prompt - CLI flag:
claude --new-session "prompt"that opens a new interactive session in whatever IDE/UI is currently active - IPC/socket API: a local socket or named pipe that the current Claude Code instance listens on, allowing subprocesses to request a new session be opened
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_