bashkit
The
Claude Agents SDK for the
Vercel AI SDK
install bashkit ai zodWhat is bashkit?
BashKit provides a comprehensive toolkit for building AI coding agents using the Vercel AI SDK. It bridges the gap between AI models and actual code execution environments, giving your agents the ability to run commands, read and modify files, search codebases, and more.
Tool signatures are designed to match Claude Code patterns, so AI models already know how to use them effectively. Bring your own sandbox — start with LocalSandbox for development, swap to Vercel or E2B for production.
10 Tools
- Bash — Execute shell commands with timeout control
- Read — Read files and list directories
- Write — Create or overwrite files
- Edit — Replace strings in existing files
- Glob — Find files by pattern matching
- Grep — Search file contents with regex
- WebSearch — Web search with domain filtering
- WebFetch — Fetch and extract web content
- Task — Spawn sub-agents for complex work
- TodoWrite — Manage structured task lists
Quick Example
import { createLocalSandbox, createAgentTools } from 'bashkit';import { generateText } from 'ai';import { anthropic } from '@ai-sdk/anthropic';const sandbox = createLocalSandbox({ workingDirectory: '.' });const { tools } = await createAgentTools(sandbox);const { text } = await generateText({model: anthropic('claude-sonnet-4-5'),tools,maxSteps: 20,prompt: 'Read the README and summarize this project.',});console.log(text);
Key Features
- Bring Your Own Sandbox — LocalSandbox for dev, VercelSandbox or E2BSandbox for production
- Type-Safe — Full TypeScript with Zod schema validation
- Configurable — Security controls, timeouts, and limits per tool
- Composable — Tools work together seamlessly in agentic loops
- Budget Tracking — Cumulative cost tracking with auto-stop
- Caching — Optional LRU caching for read-only tools
- Prompt Caching — Anthropic prompt cache middleware included