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?
npx skills add https://github.com/microsoft/vscode-copilot-chat --skill anthropic-sdk-upgrader
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:
### `@anthropic-ai/package-name` (oldVersion → newVersion)
#### Features
- **Category:** Description of new feature or capability
#### Bug Fixes
- Description of what was fixed
#### Breaking Changes
- **Old API → New API**: Description of what changed and how to migrate
How to Create the Summary:
Categorize changes by impact level:
Critical (Must Address Before Merge):
Important (Should Address):
Nice to Have (Can Address Later):
# Update to latest
npm install @anthropic-ai/claude-agent-sdk @anthropic-ai/sdk
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:
npm install in step 4, copy the current type definitions to a temp directory: mkdir -p /tmp/anthropic-sdk-old
cp -r node_modules/@anthropic-ai/sdk/*.d.ts node_modules/@anthropic-ai/sdk/resources/*.d.ts /tmp/anthropic-sdk-old/ 2>/dev/null
cp -r node_modules/@anthropic-ai/claude-agent-sdk/*.d.ts /tmp/anthropic-sdk-old/ 2>/dev/null
> Important: This snapshot must be taken *before* step 4's npm install.
npm install, compare the old and new .d.ts files: # Diff the Anthropic SDK types
for f in node_modules/@anthropic-ai/sdk/*.d.ts node_modules/@anthropic-ai/sdk/resources/*.d.ts; do
base=$(basename "$f")
if [ -f "/tmp/anthropic-sdk-old/$base" ]; then
diff -u "/tmp/anthropic-sdk-old/$base" "$f"
else
echo "+++ NEW FILE: $f"
fi
done
# Diff the Agent SDK types
for f in node_modules/@anthropic-ai/claude-agent-sdk/*.d.ts; do
base=$(basename "$f")
if [ -f "/tmp/anthropic-sdk-old/$base" ]; then
diff -u "/tmp/anthropic-sdk-old/$base" "$f"
else
echo "+++ NEW FILE: $f"
fi
done
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 tags # Example: if `createSession` gained a new parameter, check our usage
grep -rn "createSession" src/extension/agents/claude/
Flag changes that affect APIs we actively use as higher priority.
rm -rf /tmp/anthropic-sdk-old
After updating, check for compilation errors:
npm run compile
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:
# Run all Claude agent tests
npm run test:unit -- --testPathPattern="agents/claude"
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:
Update Anthropic SDK packages
### `@anthropic-ai/sdk` (0.71.2 → 0.72.1)
#### Features
- Structured Outputs support in Messages API
- MCP SDK helper functions
#### Breaking Changes
- `output_format` → `output_config` parameter migration
### `@anthropic-ai/claude-agent-sdk` (0.2.5 → 0.2.31)
#### Features
- **Query interface:** Added `close()` method, `reconnectMcpServer()`, `toggleMcpServer()` methods
- **Sessions:** Added `listSessions()` function for discovering resumable sessions
- **MCP:** Added `config`, `scope`, `tools` fields and `disabled` status to `McpServerStatus`
#### Bug Fixes
- Fixed `mcpServerStatus()` to include tools from SDK and dynamically-added MCP servers
- Fixed PermissionRequest hooks in SDK mode
#### Breaking Changes
- `KillShellInput` → `TaskStopInput`: Updated type mapping in claudeTools.ts
Type Errors After Upgrade:
Message → ContentBlock, etc.)Session Loading Failures:
ClaudeCodeSessionService for compatibility issuesHook Registration Failures:
HookEvent type for valid event stringsTool Execution Errors:
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take microsoft/vscode-copilot-chat-anthropic-sdk-upgrader from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm.
Without those the skill loads but fails at the first command.