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

@papercraneai/sandbox-agent

v0.1.4

Published

Claude Agent SDK server for sandbox environments

Readme

Sandbox Agent

An Express server that runs the Claude Agent SDK inside Daytona sandboxes, providing AI-assisted development capabilities.

Overview

This agent runs inside a Daytona sandbox and exposes HTTP endpoints for chat interactions. It uses the Claude Agent SDK with built-in tools (Read, Write, Edit, Glob, Grep, Bash) to help users build applications.

Building the Daytona Snapshot

Prerequisites

  1. Install the Daytona CLI:

    curl -sf https://download.daytona.io/daytona/install.sh | bash
  2. Authenticate:

    daytona login

Creating the Snapshot

From this directory (papercrane/apps/sandbox-agent):

daytona snapshot create <snapshot-name> --dockerfile ./Dockerfile --context .

Important: The --context . flag is required. Without it, Daytona only includes files explicitly referenced in COPY commands and may miss the src/ directory.

Monorepo Considerations

This project lives in a monorepo with npm workspaces. The package-lock.json must be generated standalone (outside the workspace) for the Docker build to work:

# Copy to temp directory
cp -r . /tmp/sandbox-agent-standalone
cd /tmp/sandbox-agent-standalone

# Generate lock file
npm install

# Copy back
cp package-lock.json /path/to/papercrane/apps/sandbox-agent/

Claude Agent SDK Usage

Key Options

import { query } from "@anthropic-ai/claude-agent-sdk"

for await (const msg of query({
  prompt: message,
  options: {
    systemPrompt: "Your system prompt",
    maxTurns: 15,
    cwd: "/path/to/project",  // NOT workingDirectory
    permissionMode: "bypassPermissions",
    allowDangerouslySkipPermissions: true,  // Required when bypassing
    allowedTools: ["Read", "Write", "Edit", "Glob", "Grep", "Bash"]
  }
})) {
  // Handle streaming messages
}

Common Pitfalls

  1. workingDirectory vs cwd: The SDK uses cwd (not workingDirectory) to set the working directory.

  2. allowDangerouslySkipPermissions: When using permissionMode: "bypassPermissions", you must also set allowDangerouslySkipPermissions: true. This is a safety measure to ensure intentional bypassing.

  3. Built-in Tools: The SDK provides these built-in tools - no need to implement them yourself:

    • Read - Read files
    • Write - Write files
    • Edit - Edit files with find/replace
    • Glob - Find files by pattern
    • Grep - Search file contents
    • Bash - Execute shell commands

API Endpoints

GET /health

Health check endpoint.

POST /chat

Streaming chat endpoint (SSE). Send a message and receive streaming responses.

{ "message": "Create a hello world component" }

POST /chat/sync

Synchronous chat endpoint. Waits for completion and returns all messages.

Environment Variables

  • PORT - Server port (default: 3001)
  • PROJECT_DIR - Working directory for the agent (default: /home/user/project)
  • ANTHROPIC_API_KEY - Required for Claude API access (injected at sandbox creation time, not in the snapshot)

Architecture

┌─────────────────────────────────────────────────────────┐
│                    Daytona Sandbox                       │
│  ┌─────────────────┐     ┌─────────────────────────┐   │
│  │  sandbox-agent  │     │   Vite Dev Server       │   │
│  │   (port 3001)   │     │     (port 3000)         │   │
│  │                 │     │                         │   │
│  │  Claude Agent   │────▶│   /tmp/project          │   │
│  │  SDK + Tools    │     │   (React app)           │   │
│  └─────────────────┘     └─────────────────────────┘   │
└─────────────────────────────────────────────────────────┘
           │                          │
           │ Preview Token            │ Preview Token
           ▼                          ▼
┌─────────────────────────────────────────────────────────┐
│                    AuthLLM Server                        │
│  - Proxies chat requests to sandbox-agent               │
│  - Manages sandbox lifecycle                            │
│  - Handles authentication                               │
└─────────────────────────────────────────────────────────┘

Security

  • Sandboxes are created with public: false
  • All requests to the sandbox require a Daytona preview token (X-Daytona-Preview-Token header)
  • The ANTHROPIC_API_KEY is injected at runtime, not baked into the snapshot