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

jsclaw

v0.0.1

Published

Lightweight container orchestration for Claude AI agents. Pure JavaScript ESM.

Downloads

8

Readme

jsclaw

Lightweight container orchestration for Claude AI agents. Pure JavaScript ESM, zero host-side dependencies.

A JavaScript port of nanoclaw — the core engine without the channel-specific code.

What is jsclaw?

jsclaw provides primitives for running Claude AI agents in isolated Docker containers:

  • Container Runner — Spawn Docker containers, stream agent output via sentinel-delimited JSON
  • IPC System — Filesystem-based JSON communication between host and container
  • Group Queue — Per-group concurrency with configurable container limits
  • MCP Tools — Send messages and schedule tasks from inside the agent
  • Mount Security — Validate volume mounts against allowlists

You bring your own I/O (chat, API, CLI) and storage. jsclaw handles the container orchestration.

Install

npm install jsclaw

Quick Start

1. Build the container image

docker build -t jsclaw-agent:latest -f node_modules/jsclaw/container/Dockerfile node_modules/jsclaw/container/

2. Run an agent

import { runContainerAgent, createConfig } from 'jsclaw';

const config = createConfig({
  containerImage: 'jsclaw-agent:latest',
  dataDir: './data',
  groupsDir: './groups',
});

const group = { name: 'my-agent', folder: 'my-agent' };
const input = {
  prompt: 'Hello, what can you do?',
  groupFolder: 'my-agent',
  chatJid: 'user-1',
  isMain: true,
};

const result = await runContainerAgent(
  group,
  input,
  (proc, name) => console.log(`Container ${name} started`),
  async (output) => console.log('Agent:', output.result),
  config,
);

3. With Queue + IPC

import { GroupQueue, startIpcWatcher, createConfig } from 'jsclaw';

const config = createConfig();
const queue = new GroupQueue(config);

queue.setProcessMessagesFn(async (groupJid) => {
  // Your logic: fetch messages, run agent, handle output
  return true;
});

const ipc = startIpcWatcher({
  sendMessage: async (jid, text) => {
    // Send text via your channel
  },
  onTask: async (type, data, sourceGroup, isMain) => {
    // Handle schedule_task, pause_task, etc.
  },
  getRegisteredGroups: () => ({}),
}, config);

// Trigger processing
queue.enqueueMessageCheck('group-1');

// Cleanup
// ipc.stop();
// await queue.shutdown();

Architecture

Host Process                    Docker Container
┌───────────────┐              ┌──────────────────┐
│ container-     │──stdin──>   │ agent-runner.js   │
│ runner.js      │<──stdout──  │  (Claude SDK)     │
│                │              │                   │
│ ipc.js        │<──files───  │ mcp-server.js     │
│ (polls ipc/)  │              │  (MCP tools)      │
│                │───files──>  │                   │
│ group-queue.js │              │ /workspace/       │
└───────────────┘              └──────────────────┘
  • stdin/stdout: ContainerInput JSON in, sentinel-delimited ContainerOutput JSON out
  • IPC files: Atomic JSON files in data/ipc/{group}/{messages,tasks,input}/
  • Container workspace: Isolated at /workspace/group/ per group

API

createConfig(overrides?)

Create configuration. All settings have sensible defaults and can be overridden via env vars (JSCLAW_*).

runContainerAgent(group, input, onProcess?, onOutput?, config?)

Spawn a container, run a Claude agent, stream results.

GroupQueue

Per-group concurrency queue. Ensures one container per group with a global limit.

startIpcWatcher(deps, config?)

Poll IPC directories for messages and task operations from containers.

writeIpcFile(dir, data) / readIpcFile(path) / drainIpcDir(dir)

Low-level atomic IPC file operations.

validateAdditionalMounts(mounts, groupName, isMain, allowlistPath?)

Validate volume mounts against a security allowlist.

MCP Tools (Inside Container)

The agent has access to these tools via the jsclaw MCP server:

| Tool | Description | |------|-------------| | send_message | Send a message to the chat immediately | | schedule_task | Schedule a cron, interval, or one-shot task | | list_tasks | List scheduled tasks | | pause_task | Pause a scheduled task | | resume_task | Resume a paused task | | cancel_task | Cancel and delete a task |

Configuration

| Env Var | Default | Description | |---------|---------|-------------| | JSCLAW_CONTAINER_IMAGE | jsclaw-agent:latest | Docker image | | JSCLAW_CONTAINER_RUNTIME | docker | docker, podman, or container | | JSCLAW_CONTAINER_TIMEOUT | 1800000 | Idle timeout (ms) | | JSCLAW_MAX_CONCURRENT | 5 | Max concurrent containers | | JSCLAW_DATA_DIR | ./data | IPC data directory | | JSCLAW_GROUPS_DIR | ./groups | Group workspace directory | | JSCLAW_LOG_LEVEL | info | Log level | | ANTHROPIC_API_KEY | — | Required for Claude API |

Differences from nanoclaw

  • No WhatsApp/Telegram channels — bring your own I/O
  • No SQLite database — bring your own storage
  • No router or message loop — build your own orchestration
  • No task scheduler — implement your own scheduling
  • Pure JavaScript ESM, no build step, zero host-side dependencies
  • Docker by default (configurable to podman/Apple Container)

License

MIT