Skip to content

Enable “Continue in Claude” for chat handoffs#318232

Open
Chulong-Li wants to merge 2 commits into
microsoft:mainfrom
Chulong-Li:chulong/300531-continue-in-claude-agent
Open

Enable “Continue in Claude” for chat handoffs#318232
Chulong-Li wants to merge 2 commits into
microsoft:mainfrom
Chulong-Li:chulong/300531-continue-in-claude-agent

Conversation

@Chulong-Li
Copy link
Copy Markdown
Member

Fixes #300531

This enables Claude Agent as a functional Continue In destination from chat and plan-mode handoffs.

Summary

Users can now continue work in Claude Agent from the existing Continue In UI, including the plan-mode Start Implementation dropdown. The handoff opens a real Claude Agent session and starts it with the delegated task context.

The implementation follows the existing Copilot CLI handoff pattern: when Claude is invoked from a non-Claude session, the Claude provider treats the request as a delegation, creates a new target session, and starts that session with summarized context rather than trying to process the source chat resource directly.

Details

  • Adds Claude Agent to the existing Continue In allowlist and dropdown.
  • Adds Claude Agent to the plan-mode Continue In target list after Copilot CLI and Cloud.
  • Handles @claude requests from non-Claude sessions as delegated handoffs, matching the Copilot CLI pattern.
  • Starts a new claude-code session with a concise delegated prompt and summary attachment.
  • Resolves delegated summary attachments before sending model input so Claude receives the summary content directly.
  • Preserves the selected Claude model for the delegated request when the source handoff is already using a Claude model.

Validation

Figure 1: Claude Added to the Start Implementation Continue In Menu
image


Figure 2: Claude Handoff Starts a Delegated Agent Session From Plan Mode
image


Figure 3: Delegated Claude Session Uses Summary Context and Preserves the Selected Model
image

Copilot AI review requested due to automatic review settings May 25, 2026 15:59
@Chulong-Li Chulong-Li marked this pull request as ready for review May 25, 2026 15:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds robust “Continue in Claude” delegation support, including preserving the selected model when opening the new session and improving how delegated context is forwarded.

Changes:

  • Enable Claude as a valid “continue in” provider and surface it in continue-in UI/actions.
  • Propagate userSelectedModelId when opening a new chat session and apply it to the model input state (editor + sidebar).
  • Delegate from non-Claude chats into a new Claude session with optional summarized context, and resolve summary-URI references into actual text blocks.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts Adds coverage for getAgentCanContinueIn returning true for Claude.
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.ts Allows partial model input state and applies it earlier during editor initialization.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts Imports Claude provider and introduces ordering for “continue in” contributions.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Adds userSelectedModelId plumbing, initializes input state from model metadata, and forwards the hint to sendRequest.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts Updates continue-in eligibility to include Claude.
src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts Adds “Continue in Claude” option when delegation is supported.
extensions/copilot/src/extension/chatSessions/vscode-node/test/claudeChatSessionContentProvider.spec.ts Adds tests for delegation behavior, summary attachment forwarding, and cancellation handling.
extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts Implements delegation to a new Claude session with summary attachment handling + model hinting.
extensions/copilot/src/extension/chatSessions/vscode-node/chatSessions.ts Registers the delegation summary service in the extension’s service collection.
extensions/copilot/src/extension/chatSessions/claude/node/test/resolvePromptToContentBlocks.spec.ts Adds test for resolving non-inline URI references via provided text.
extensions/copilot/src/extension/chatSessions/claude/node/claudePromptResolver.ts Adds optional resolver hook to replace URI references with actual text.
extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeAgent.ts Uses the resolver hook to inject summary document content into prompt blocks.

Comment on lines 128 to +132
case AgentSessionProviders.Local:
case AgentSessionProviders.Background:
case AgentSessionProviders.Cloud:
return true;
case AgentSessionProviders.Claude:
return true;
Comment on lines +22 to +26
const continueInProviderOrder = new Map<AgentSessionProviders, number>([
[AgentSessionProviders.Background, 0],
[AgentSessionProviders.Cloud, 1],
[AgentSessionProviders.Claude, 2],
]);
Comment on lines +162 to 166
}).sort((a, b) => {
const providerA = getAgentSessionProvider(a.type)!;
const providerB = getAgentSessionProvider(b.type)!;
return (continueInProviderOrder.get(providerA) ?? Number.MAX_SAFE_INTEGER) - (continueInProviderOrder.get(providerB) ?? Number.MAX_SAFE_INTEGER);
});
return {};
}

const attachedContext = [];
Comment on lines +219 to +222
const chatOptions: { prompt: string; attachedContext: typeof attachedContext; userSelectedModelId?: string } = {
prompt,
attachedContext,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to "Continue In" Claude Agent

3 participants