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

agent-monitor-proxy

v0.2.1

Published

Universal monitoring proxy for AI coding agents. Discover, intercept, and observe all your Claude Code, Codex, Cursor, and other agents from a single service.

Downloads

23

Readme

Agent Monitor Proxy (AMP)

Universal monitoring proxy for AI coding agents. Discover, intercept, and observe all your Claude Code, Codex, Cursor, and other agents from a single service.

License: MIT

What is this?

AMP is a local proxy service that automatically discovers and monitors all running AI coding agents on your machine. It provides a unified real-time API for any consumer application to observe agent activity.

┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐
│  Claude Code│  │  Codex CLI  │  │   Cursor    │  │  Kimi Code  │
└──────┬──────┘  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘
       └────────────────┼────────────────┼────────────────┘
                        ▼
              ┌─────────────────┐
              │  Agent Monitor  │
              │     Proxy       │
              │                 │
              │  ┌───────────┐  │
              │  │ Discovery │  │
              │  │ Interceptor│  │
              │  │ Analyzer  │  │
              │  └─────┬─────┘  │
              │        ▼        │
              │  ┌───────────┐  │
              │  │ REST API  │  │
              │  │ WebSocket │  │
              │  └───────────┘  │
              └────────┬────────┘
                       ▼
              ┌─────────────────┐
              │  Your App       │
              │  (Desktop Pet,  │
              │   Dashboard,    │
              │   Automation)   │
              └─────────────────┘

Features

  • Auto-Discovery — Scans running processes and config directories to find all agents
  • Multi-Instance — Track N instances of the same agent type independently
  • Real-Time Events — WebSocket push for state changes, token usage, tool calls
  • REST API — Query instances, stats, and history via HTTP
  • Extensible — Add new agents by implementing a single AgentAdapter interface
  • Zero Intrusion — No modification to agents. Uses environment injection and file observation
  • Local Only — No cloud dependency. All data stays on your machine

Quick Start

# Install
npm install -g agent-monitor-proxy

# Start
amp

# Or run directly
npx agent-monitor-proxy

Then connect your consumer:

const ws = new WebSocket('ws://localhost:9527')

ws.on('message', (event) => {
  const { type, instanceId, data } = JSON.parse(event)
  console.log(`[${instanceId}] ${type}:`, data)
})

API

REST Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /health | Health check | | GET | /api/instances | List all tracked instances | | GET | /api/instances/:id | Get instance detail | | GET | /api/instances/:id/stats | Get instance stats | | GET | /api/summary | Global summary | | GET | /api/events | SSE event stream |

WebSocket

Connect to ws://localhost:9527 and receive real-time events:

{
  "type": "state_change",
  "instanceId": "claude-code-12345",
  "timestamp": 1717200000000,
  "data": {
    "previousState": "thinking",
    "newState": "executing",
    "agentType": "claude-code",
    "agentKind": "cli"
  }
}

Event Types

| Event | When | |-------|------| | instance_discovered | New agent instance found | | instance_lost | Agent process exited | | state_change | Agent state changed (idle/thinking/executing/waiting/completed/stopped) | | message | User or assistant message sent | | tool_call | Agent called a tool | | tool_result | Tool call completed | | token_usage | Token usage recorded | | completed | Task completed |

Writing Adapters

Add support for a new agent by implementing AgentAdapter:

import { BaseAdapter, type AgentAdapter, type AgentDescriptor, type AgentInstance } from 'agent-monitor-proxy'

export class MyAgentAdapter extends BaseAdapter {
  readonly type = 'my-agent'
  readonly kind = 'cli' as const
  readonly displayName = 'My Agent'

  async discover(): Promise<AgentDescriptor[]> {
    // Scan for running instances
    return []
  }

  async startWatching(instance: AgentInstance): Promise<void> {
    // Start monitoring this instance
  }
}

// Register it
const amp = new AgentMonitorProxy({
  adapters: [new MyAgentAdapter()],
})

Programmatic Usage

import { AgentMonitorProxy } from 'agent-monitor-proxy'

const amp = new AgentMonitorProxy({
  config: {
    server: { port: 9527, proxyPort: 9528, host: '127.0.0.1' },
  },
})

// Listen to events
amp.getBus().on('token_usage', (event) => {
  console.log(`Token usage: ${event.data.totalTokens}`)
})

amp.getBus().on('state_change', (event) => {
  if (event.data.newState === 'completed') {
    console.log(`Agent ${event.instanceId} completed!`)
  }
})

await amp.start()

Supported Agents

| Agent | Status | Adapter | |-------|--------|---------| | Claude Code (CLI) | ✅ Built-in | claude-code | | Codex CLI | ✅ Built-in | codex | | Cursor | 🔜 Planned | cursor | | OpenCode | 🔜 Planned | opencode | | Gemini CLI | 🔜 Planned | gemini-cli | | Kimi Code | 🔜 Planned | kimi-code |

Architecture

See docs/architecture.md for the full design document.

License

MIT