Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Claude Agent SDKNew to Visual Studio Code? Get it now.
Claude Agent SDK

Claude Agent SDK

Microsoft

microsoft.com
|
2 installs
| (0) | Free
Exports the claude-agent-sdk npm package for consumption by other VS Code extensions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Agent SDK for VS Code

Exposes @anthropic-ai/claude-agent-sdk to other VS Code extensions as a single shared installation.

The SDK is 200+ MB with native platform binaries. Rather than bundling it with VS Code, this extension can be installed on demand — saving hundreds of MB of duplicate downloads. It also handles the CJS/ESM boundary so consumers don't have to.

Usage

1. Declare a dependency in your extension's package.json:

{
  "extensionDependencies": ["ms-vscode.vscode-claude-sdk"]
}

VS Code will activate this extension before yours.

2. Get the SDK in your extension code:

import type * as sdk from '@anthropic-ai/claude-agent-sdk';
import type { ExtensionContext } from 'vscode';

type SDKActivation =
    | { sdk: typeof sdk; error: null }
    | { sdk: null; error: Error };

export async function activate(context: ExtensionContext) {
    const sdkExt = vscode.extensions.getExtension<SDKActivation>('ms-vscode.vscode-claude-sdk');
    const { sdk, error } = await sdkExt!.activate();
    if (error) {
        // SDK failed to load (e.g. missing native binary for this platform)
        throw error;
    }
    // sdk is the full @anthropic-ai/claude-agent-sdk module
}

API

type SDKActivation =
    | { sdk: typeof import('@anthropic-ai/claude-agent-sdk'); error: null }
    | { sdk: null; error: Error };

activate() always resolves — it never rejects. Check error before using sdk.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft