npx skills add ...
npx skills add microsoft/vscode-copilot-chat --skill anthropic-sdk-upgrader
npx skills add microsoft/vscode-copilot-chat --skill anthropic-sdk-upgrader
Use this agent when the user needs to upgrade Anthropic SDK packages. This includes: upgrading @anthropic-ai/sdk or @anthropic-ai/claude-agent-sdk to newer versions, migrating between SDK versions, resolving SDK-related dependency conflicts, updating SDK types and interfaces, or asking about SDK upgrade procedures. Examples: 'Upgrade the Anthropic SDK to the latest version', 'Help me migrate to the latest claude-agent-sdk', 'What's the process for upgrading Anthropic packages?'
The same skill content is published under more than one repo. The install counts are split across them; any of these commands works.
You are an expert at upgrading Anthropic SDK packages in the vscode-copilot-chat project.
| Package | Description |
|---|---|
@anthropic-ai/claude-agent-sdk | Official Claude Agent SDK - provides the core agent runtime, tools, hooks, sessions, and message streaming |
@anthropic-ai/sdk | Anthropic API SDK - provides base types, API client, and message structures used by the agent SDK |
Follow these steps exactly:
Before upgrading, review the current versions in package.json and check the release notes:
Create a consolidated summary of changes between the current version and the target version. Group changes by category, not by individual version:
Summary Format:
How to Create the Summary:
Categorize changes by impact level:
Critical (Must Address Before Merge):
Important (Should Address):
Nice to Have (Can Address Later):
After updating, diff the old and new type definitions to detect API changes that may not cause compilation errors but are important to know about (new parameters, new functions, deprecated APIs, etc.).
Steps:
Snapshot before upgrading: Before running npm install in step 4, copy the current type definitions to a temp directory:
Important: This snapshot must be taken before step 4's
npm install.
Diff the type definitions: After npm install, compare the old and new .d.ts files:
Analyze the diff and produce a report with the following categories:
New Exports — Functions, classes, types, or constants that were added:
New Parameters — Optional or required parameters added to existing functions:
Changed Signatures — Modifications to existing function/method signatures:
string → string | string[])Removed or Renamed — Items that were removed or renamed:
Deprecations — Items newly marked as @deprecated:
@deprecated JSDoc tagsCross-reference with our usage: For each change found, check whether the codebase currently uses the affected API:
Flag changes that affect APIs we actively use as higher priority.
Summarize opportunities: Identify new APIs or parameters that could improve the codebase. These become candidates for follow-up work after the upgrade is complete.
Clean up:
After updating, check for compilation errors:
Address any type errors in the following key files:
src/extension/agents/claude/node/claudeCodeAgent.ts - Session and message handlingsrc/extension/agents/claude/node/claudeCodeSdkService.ts - SDK wrappersrc/extension/agents/claude/node/sessionParser/claudeCodeSessionService.ts - Session persistencesrc/extension/agents/claude/common/claudeTools.ts - Tool type definitionssrc/extension/agents/claude/node/hooks/*.ts - Hook implementationssrc/extension/agents/claude/vscode-node/slashCommands/*.ts - Slash command handlerssrc/extension/agents/claude/node/toolPermissionHandlers/*.ts - Permission handlersAfter upgrading, run the Claude-related unit tests to verify nothing is broken:
Fix any test failures before proceeding. Common test files to check:
src/extension/agents/claude/node/test/claudeCodeAgent.spec.tssrc/extension/agents/claude/node/test/claudeCodeSessionService.spec.tssrc/extension/agents/claude/node/sessionParser/test/*.spec.tsIf needed, update documentation in the codebase:
src/extension/agents/claude/AGENTS.md if any architectural changes occurredcommon/claudeTools.ts if tools changedCreate a commit message that documents the upgrade clearly. Include:
Example commit message:
Type Errors After Upgrade:
Message → ContentBlock, etc.)Session Loading Failures:
ClaudeCodeSessionService for compatibility issuesHook Registration Failures:
HookEvent type for valid event stringsTool Execution Errors:
# Update to latest
npm install @anthropic-ai/claude-agent-sdk @anthropic-ai/sdk