domdomegg

Tool Sandbox โ€” AI skill for Claude Code

AI community

๐Ÿ“ฆ Execute code and call tools in a sandbox, for AI agents.

How to install Tool Sandbox

This entry records only its repository, not the path inside it, so there is no exact command to give. Open domdomegg/tool-sandbox and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tool Sandbox does

๐Ÿ“ฆ Execute code and call tools in a sandbox, for AI agents.

Alternatives in AI

  • Open Multi Agent โ€” TypeScript multi-agent orchestration engine โ€” one runTeam() call from goal to result 5.8k โ˜…
  • Axonhub โ€” โšก๏ธ Open-source AI Gateway โ€” Use any SDK to call 100+ LLMs 3.2k โ˜…
  • Multi Execute โ€” ๆ‰ง่กŒ - ๅคšๆจกๅž‹ๅไฝœๆ‰ง่กŒ (Multi-Model Collaborative Execution) 1.9k โ˜…

README

tool-sandbox

Library for executing code and calling tools in a sandbox. Particularly useful for letting AI agents write and execute code, following [the code execution pattern for AI agents](https://www.anthropic.com/engineering/code-execution-with-mcp).

https://github.com/user-attachments/assets/d2f45db4-0861-489a-98cf-675490176fdc

Why?

When agents call tools directly, every tool definition and intermediate result flows through the context window. This gets expensive fast.

**Code execution solves this.** The agent writes code that calls tools, which:

  • Saves tokens: Load tool definitions on-demand, filter data before returning to the model.
  • Enables complex logic: Loops, conditionals, error handling in one execution instead of many tool calls.
  • Keeps data private: Intermediate results stay in the execution environment.
  • Runs safely: Unlike eval(), code runs in a WASM sandbox with no filesystem, network, or Node.js access.
  • Runs anywhere: Works in Node.js, browsers, Deno, Bun, and Cloudflare Workers.

Quick Start

npm install tool-sandbox
import {createSandbox, type Tool} from 'tool-sandbox';

const tools: Tool[] = [
  {
    name: 'listUsers',
    description: 'List all users',
    inputSchema: {type: 'object'},
    handler: async () => [
	  // In real-life, you'd fetch this from an API
	  // or plug in an MCP server (see below!)
      {email: 'alice@example.com', active: false},
      {email: 'bob@example.com', active: true},
    ],
  },
  {
    name: 'sendReactivationEmail',
    description: 'Send a reactivation email to a user',
    inputSchema: {type: 'object', properties: {to: {type: 'string'}}},
    handler: async () => ({sent: true}),
  },
];

const sandbox = await createSandbox({tools});

// Code can be generated by an LLM - see "Using with LLMs" below
await sandbox.execute.handler({
  code: `
    const users = await tool('listUsers', {});
    const inactiveUsers = users.filter(u => !u.active