by ben-vargas
Vercel AI SDK community provider for Claude Agent SDK
# Add to your Claude Code skills
git clone https://github.com/ben-vargas/ai-sdk-provider-claude-codeGuides for using ai agents skills like ai-sdk-provider-claude-code.
Last scanned: 5/28/2026
{
"issues": [
{
"type": "npm-audit",
"message": "ajv: ajv has ReDoS when using `$data` option",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "brace-expansion: brace-expansion: Zero-step sequence causes process hang and memory exhaustion",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "flatted: flatted vulnerable to unbounded recursion DoS in parse() revive phase",
"severity": "high"
},
{
"type": "npm-audit",
"message": "minimatch: minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern",
"severity": "high"
},
{
"type": "npm-audit",
"message": "picomatch: Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching",
"severity": "high"
},
{
"type": "npm-audit",
"message": "postcss: PostCSS has XSS via Unescaped </style> in its CSS Stringify Output",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "rollup: Rollup 4 has Arbitrary File Write via Path Traversal",
"severity": "high"
},
{
"type": "npm-audit",
"message": "vite: Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling",
"severity": "high"
}
],
"status": "WARNING",
"scannedAt": "2026-05-28T07:59:08.659Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}ai-sdk-provider-claude-code is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ben-vargas. Vercel AI SDK community provider for Claude Agent SDK. It has 357 GitHub stars.
ai-sdk-provider-claude-code returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/ben-vargas/ai-sdk-provider-claude-code" and add it to your Claude Code skills directory (see the Installation section above).
ai-sdk-provider-claude-code is primarily written in TypeScript. It is open-source under ben-vargas on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-sdk-provider-claude-code against similar tools.
No comments yet. Be the first to share your thoughts!
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
Latest Release: Version 4.x supports AI SDK v7 stable with the Claude Agent SDK. Version 3.x moves to maintenance for AI SDK v6 under the
ai-sdk-v6tag.
ai-sdk-provider-claude-code lets you use Claude via the Vercel AI SDK through the official @anthropic-ai/claude-agent-sdk and the Claude Code CLI.
| Provider Version | AI SDK Version | Underlying SDK | NPM Tag | Status | Branch |
|---|---|---|---|---|---|
| 4.x.x | v7 | @anthropic-ai/claude-agent-sdk |
latest |
Stable | main |
| 3.x.x | v6 | @anthropic-ai/claude-agent-sdk |
ai-sdk-v6 |
Maintenance | ai-sdk-v6 |
| 2.x.x | v5 | @anthropic-ai/claude-agent-sdk |
ai-sdk-v5 |
Legacy | ai-sdk-v5 |
| 1.x.x | v5 | @anthropic-ai/claude-code |
v1-claude-code-sdk |
Legacy | v1 |
| 0.x.x | v4 | @anthropic-ai/claude-code |
ai-sdk-v4 |
Legacy | ai-sdk-v4 |
Install commands for each line are listed under Installation below.
The 4.x line requires Zod ^4.1.8. Version 3.x remains available for AI SDK v6 under the ai-sdk-v6 tag.
npm install ai-sdk-provider-claude-code ai zod@^4.1.8
Note: Zod 3 support was dropped in v3.2.0 due to the underlying
@anthropic-ai/claude-agent-sdk@0.2.xrequiring Zod 4. If you need Zod 3 support, useai-sdk-provider-claude-code@3.1.x.
See the official docs for platform-specific options.
curl -fsSL https://claude.ai/install.sh | bash
claude auth login
# For AI SDK v7 (4.x; current latest tag)
npm install ai-sdk-provider-claude-code ai
# For AI SDK v6 maintenance (3.x)
npm install ai-sdk-provider-claude-code@ai-sdk-v6 ai@^6.0.0
# For AI SDK v5
npm install ai-sdk-provider-claude-code@ai-sdk-v5 ai@^5.0.0
# For AI SDK v4 (legacy)
npm install ai-sdk-provider-claude-code@ai-sdk-v4 ai@^4.3.16
# or use a specific version: npm install ai-sdk-provider-claude-code@^0.2.2
This is an unofficial community provider and is not affiliated with or endorsed by Anthropic or Vercel. By using this provider:
Please ensure you have appropriate permissions and comply with all applicable terms when using this provider.
latest)// npm install ai-sdk-provider-claude-code ai
import { streamText } from 'ai';
import { claudeCode } from 'ai-sdk-provider-claude-code';
const result = streamText({
model: claudeCode('haiku'),
prompt: 'Hello, Claude!',
});
const text = await result.text;
console.log(text);
// npm install ai-sdk-provider-claude-code@ai-sdk-v6 ai@^6.0.0
import { streamText } from 'ai';
import { claudeCode } from 'ai-sdk-provider-claude-code';
const result = streamText({
model: claudeCode('haiku'),
prompt: 'Hello, Claude!',
});
const text = await result.text;
console.log(text);
// npm install ai-sdk-provider-claude-code@ai-sdk-v5 ai@^5.0.0
import { streamText } from 'ai';
import { claudeCode } from 'ai-sdk-provider-claude-code';
const result = streamText({
model: claudeCode('haiku'),
prompt: 'Hello, Claude!',
});
const text = await result.text;
console.log(text);
This release ports the provider to AI SDK v7 / LanguageModelV4, adds first-class Claude Agent SDK callback, query-controller, MCP, and image support, and keeps the v7 support boundaries explicit:
^4.1.8require() is no longer availabletool-result parts/events with isError: true instead of the provider-specific tool-error stream extensionVersion 4.0.0 intentionally keeps optional provider surfaces absent unless the Claude Agent SDK has a durable provider-reference mapping:
ProviderV4.files() is not implemented yet. The AI SDK interface uploads { type: 'data' } or { type: 'text' } bytes and returns a reusable provider reference, but Claude Agent SDK 0.3.205 exposes no direct upload/reuse API for that contract. This provider forwards inline image file parts in prompts; non-image inline files (for example PDFs) emit an unsupported-file call warning and are not forwarded. It does not upload files into durable provider references.[File <name>: <mediaType>]; raw file bytes are not re-sent on replay. Richer tool-result file replay, such as re-sending actual image/file bytes for tool-result file parts, is deferred.ProviderV4.skills() is not implemented yet. Claude Code skills are loaded from configured user/project/local skill directories with the existing skills setting below; there is no Agent SDK API that uploads a skill bundle and returns an AI SDK provider reference.@ai-sdk/provider-utils@5.0.5 exposes WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, and serializeModelOptions() for provider model classes in the AI SDK v7 stack, but this provider has not added a serialization contract for provider instances or settings. Callback/function settings such as canUseTool, hooks, logger, spawnClaudeCodeProcess, and SessionStore methods are not JSON-serializable and must be recreated by the application.custom and reasoning-file parts are not emitted as provider output yet. Claude Agent SDK 0.3.205 has no durable reasoning-file artifact output that maps to AI SDK reasoning-file; assistant-history custom and reasoning-file parts have no Claude Code replay representation and are skipped (unknown unsupported content variants still warn).This version upgrades to AI SDK v6 stable with updated provider types:
usage.raw now contains raw provider usage (previously in providerMetadata['claude-code'].rawUsage)LanguageModelV3Usage and LanguageModelV3FinishReason (transparent to most users)This version migrates to @anthropic-ai/claude-agent-sdk with new defaults for better control:
See Breaking Changes Guide for details on migrating from v0.x to v1.x.
Key changes:
fable - Claude Fable (most capable)opus - Claude Opus (highly capable)sonnet - Claude Sonnet (balanced performance)haiku - Claude Haiku (fastest, most cost-effective)You can also use full model identifiers directly (e.g., claude-fable-5, claude-sonnet-4-6, claude-opus-4-8).
The docs/ai-sdk-v4/ and docs/ai-sdk-v5/ directories cover legacy provider versions (0.x and 1.x–2.x respectively) and are kept for reference.
Version 2.0.0 migrates from @anthropic-ai/claude-code to @anthropic-ai/claude-agent-sdk. Two defaults changed: