npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bugzy-ai/sandbox-agent-sdk

v0.1.3

Published

Claude Agent SDK with Vercel Sandbox backing for serverless environments

Readme

Claude Agent SDK with Vercel Sandbox Backing

Run the Claude CLI in Vercel's serverless environment using Vercel Sandbox microVMs.

Problem

The Claude Agent SDK works locally but fails on Vercel deployment:

Error: Claude Code executable not found

Vercel's serverless functions don't have the Claude CLI installed.

Solution

This SDK runs the Claude CLI inside Vercel Sandbox microVMs, enabling Claude Agent functionality in serverless environments.

[Your API Route] → [This SDK] → [Vercel Sandbox] → [Claude CLI] → [Anthropic API]

Installation

npm install @bugzy-ai/sandbox-agent-sdk

Quick Start

import { query } from '@bugzy-ai/sandbox-agent-sdk';

const result = await query({
  prompt: 'What is the capital of France?',
});

console.log(result.text); // "The capital of France is Paris."

Features

  • Drop-in replacement for local Claude CLI usage
  • Streaming support with SSE for real-time responses
  • Multi-turn conversations with session management
  • Custom tools via MCP (Model Context Protocol)
  • Snapshots for faster cold starts
  • VFS for mounting GitHub repos or custom files

API

Simple Query

import { query } from '@bugzy-ai/sandbox-agent-sdk';

// Get just the text response
const q = query({ prompt: 'Hello!' });
const text = await q.text();
console.log(text);

Streaming

import { query, isAssistantMessage, extractText } from '@bugzy-ai/sandbox-agent-sdk';

for await (const message of query({ prompt: 'Tell me a story' })) {
  if (isAssistantMessage(message)) {
    process.stdout.write(extractText(message));
  }
}

Multi-turn Conversations

import { VercelClaudeClient } from '@bugzy-ai/sandbox-agent-sdk';

const client = new VercelClaudeClient({
  systemPrompt: 'You are a helpful assistant.',
});

await client.connect();

const response1 = await client.chat('My name is Alice.');
const response2 = await client.chat('What is my name?');
// Claude remembers the conversation context

await client.disconnect();

Custom Tools

import { tool, createSdkMcpServer } from '@bugzy-ai/sandbox-agent-sdk';
import { z } from 'zod';

const weatherTool = tool(
  'get_weather',
  'Get the current weather for a location',
  { location: z.string() },
  async ({ location }) => {
    const weather = await fetchWeather(location);
    return { content: [{ type: 'text', text: weather }] };
  }
);

const server = createSdkMcpServer({
  name: 'my-tools',
  tools: [weatherTool],
});

Snapshots (Faster Cold Starts)

import { createSnapshot, query } from '@bugzy-ai/sandbox-agent-sdk';

// Create once (during deployment)
const snapshotId = await createSnapshot({ name: 'claude-ready' });

// Use for all queries
const result = await query({
  prompt: 'Hello!',
  snapshotId,
});

Next.js API Route Example

// app/api/chat/route.ts
import { NextRequest } from 'next/server';
import { query, isAssistantMessage, extractText } from '@bugzy-ai/sandbox-agent-sdk';

export const runtime = 'nodejs';
export const maxDuration = 300;

export async function POST(request: NextRequest) {
  const { prompt } = await request.json();

  const stream = new ReadableStream({
    async start(controller) {
      for await (const msg of query({ prompt })) {
        if (isAssistantMessage(msg)) {
          controller.enqueue(new TextEncoder().encode(extractText(msg)));
        }
      }
      controller.close();
    },
  });

  return new Response(stream, {
    headers: { 'Content-Type': 'text/plain' },
  });
}

Environment Variables

# Required
ANTHROPIC_API_KEY=sk-ant-xxx

# Optional (for faster cold starts)
CLAUDE_SANDBOX_SNAPSHOT_ID=snap_xxx

# Optional (for team deployments)
VERCEL_TEAM_ID=team_xxx

Documentation

Examples

Architecture

| Component | Location | Purpose | |-----------|----------|---------| | Your API Route | Vercel Functions | Entry point, handles requests | | This SDK | Vercel Functions | Manages sandbox lifecycle | | Vercel Sandbox | MicroVM | Runs Claude CLI in isolated environment | | Claude CLI | Inside Sandbox | Communicates with Anthropic API | | Custom Tools | Your Functions | Access databases, APIs (secure) |

Performance

| Scenario | Cold Start | Warm | |----------|------------|------| | Fresh sandbox | ~45s | - | | With snapshot | ~3-5s | ~1s |

Recommendation: Always use snapshots in production.

Security

  • Anthropic API key is passed to sandbox but never logged
  • Custom tools run in your application, not the sandbox
  • Each sandbox is an isolated microVM
  • Database credentials stay in your application

License

MIT

Contributing

Contributions welcome! Please read the contributing guidelines first.