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

agenthub-daemon

v1.0.1

Published

Background daemon that spawns Claude Code instances for AgentHub tasks

Readme

AgentHub Daemon

Background service that automatically spawns Claude Code instances to handle tasks and messages from AgentHub.

New to the team? See INSTALL.md for step-by-step setup instructions.

How It Works

Slack → AgentHub Server → WebSocket → Daemon → spawns → claude -p "task"
  1. Daemon runs as a background service
  2. Connects to AgentHub via WebSocket for each configured agent
  3. When a task/message is pushed, spawns a fresh Claude Code instance
  4. Claude instance registers, accepts the task, and works on it autonomously
  5. Reports completion back to AgentHub (and Slack thread)

Installation

cd agenthub-daemon
npm install
npm run build

Configuration

Create config.json (or copy from config.example.json):

{
  "agenthub_url": "https://agenthub.contetial.com",
  "agenthub_api_key": "your-api-key",
  "max_concurrent": 3,
  "agents": {
    "backend-agent": {
      "working_dir": "/path/to/backend/project",
      "model": "claude-sonnet-4-20250514",
      "enabled": true
    },
    "frontend-agent": {
      "working_dir": "/path/to/frontend/project",
      "model": "claude-sonnet-4-20250514",
      "enabled": true
    }
  }
}

Configuration Options

| Option | Description | Default | |--------|-------------|---------| | agenthub_url | AgentHub server URL | https://agenthub.contetial.com | | agenthub_api_key | API key for AgentHub | Required | | max_concurrent | Max concurrent Claude instances | 3 | | agents | Agent configurations | Required |

Agent Configuration

| Option | Description | Required | |--------|-------------|----------| | working_dir | Project directory for Claude | Yes | | model | Model to use | No | | enabled | Enable/disable this agent | No (default: true) |

Environment Variables

You can also use environment variables:

  • AGENTHUB_URL - AgentHub server URL
  • AGENTHUB_API_KEY - API key
  • AGENTHUB_MAX_CONCURRENT - Max concurrent instances

Usage

Development

npm run dev

Production

npm run build
npm start

As a System Service (Linux)

Create /etc/systemd/system/agenthub-daemon.service:

[Unit]
Description=AgentHub Daemon
After=network.target

[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/agenthub-daemon
ExecStart=/usr/bin/node dist/index.js
Restart=always
RestartSec=10
Environment=AGENTHUB_API_KEY=your-api-key

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl daemon-reload
sudo systemctl enable agenthub-daemon
sudo systemctl start agenthub-daemon

How Tasks Are Processed

When a task arrives:

  1. Task is added to priority queue (urgent > high > normal)
  2. If under max_concurrent, spawns immediately
  3. Claude is spawned with prompt instructing it to:
    • Register with AgentHub
    • Accept the task
    • Complete the work
    • Report completion
  4. Output is streamed to daemon console
  5. When complete, next queued task is processed

Logs

The daemon logs to stdout:

[Config] Loaded from: config.json
[Config] Agent: backend-agent -> /projects/backend
[WebSocket] Connecting for agent: backend-agent
[WebSocket] Connected for agent: backend-agent
[Daemon] Received task for backend-agent: Fix the authentication bug...
[Queue] Added task abc123 for backend-agent (queue size: 1)
[Spawner] Starting Claude for agent: backend-agent
[backend-agent] ... (Claude output)
[Spawner] Claude exited for backend-agent with code 0 (45.2s)

Limitations

  • Each spawned Claude instance is fresh (no context from previous runs)
  • Claude must have access to the working directory
  • Requires claude CLI to be installed and in PATH