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

watchtower-ai

v1.0.3

Published

Watchtower — monitor, inspect, and debug all API traffic between AI coding agents (Claude Code, Codex CLI, OpenAI-compatible clients) and their APIs, with a real-time web dashboard.

Readme

Watchtower

Monitor, inspect, and debug all API traffic between AI coding agents and their APIs — with a real-time web dashboard.

Like Chrome DevTools Network tab, but for Claude Code and Codex CLI.

Watchtower Dashboard

Why

AI coding agents make dozens of API calls per interaction — streaming messages, token counts, quota checks, subagent spawns — and you can't see any of it. Watchtower sits between your AI agent and its API, captures everything, and gives you a live dashboard to inspect it all.

Works with:

What you see:

  • Every request and response, fully decoded
  • SSE stream events in real time
  • Agent hierarchy tracking (main agent → subagents → utility calls)
  • Token usage, rate limits, and timing
  • System prompts, tool definitions, full message history
  • Dark and light mode
  • All logged to disk as JSON for later analysis

Quick Start

npm install -g watchtower-ai
watchtower-ai

Or clone and run directly:

git clone https://github.com/fahd09/watchtower.git
cd watchtower
npm install
npm start

Then point your AI agent at the proxy:

# Claude Code
ANTHROPIC_BASE_URL=http://localhost:8024 claude

# Codex CLI
OPENAI_BASE_URL=http://localhost:8024 codex

Open http://localhost:8025 — that's it. Both providers share the same proxy port. Requests are auto-detected.

Usage

# Default ports: proxy=8024, dashboard=8025
node intercept.mjs

# Custom ports
node intercept.mjs 9000 9001

Dashboard Tabs

| Tab | What it shows | |-----|--------------| | Overview | Duration, model, status, token counts, rate limits | | Messages | Full conversation history (user/assistant messages) | | Response | Pretty-printed response JSON | | Tools | Tool definitions with searchable parameters and schemas | | Stream | Raw SSE events with expandable payloads | | Headers | Request and response headers | | Rate Limits | Rate limit headers with visual progress bars | | Raw | Complete request/response bodies as JSON |

Request Classification

The proxy automatically classifies each request:

Anthropic:

  • messages_stream — Streaming chat (the main interaction)
  • messages — Non-streaming chat
  • token_count — Token counting
  • quota_check — Quota/permission check (max_tokens=1)

OpenAI:

  • responses_stream / responses — Responses API (Codex CLI default)
  • chat_stream / chat_completion — Chat Completions API
  • models — Model listing
  • embeddings — Embedding requests

Agent Roles

Each request is tagged with an agent role:

  • main — The primary agent (Claude Code's main agent has the Agent tool; Codex requests with tools)
  • subagent — A spawned sub-agent (Explore, Plan, etc.)
  • utility — Token counts, quota checks, and tool-less calls

Logs

All requests are saved to ./logs/ as numbered JSON files:

logs/0001_messages_stream_claude-opus-4-6.json
logs/0002_token_count_claude-haiku-4-5-20251001.json

Each file contains the complete request/response cycle: headers, body, SSE events, timing, and rate limits.

How It Works

Claude Code  ──HTTP──┐
                     ├──>  Watchtower (proxy)  ──HTTPS──>  api.anthropic.com
Codex CLI    ──HTTP──┘          │              ──HTTPS──>  api.openai.com / chatgpt.com
                                │
                                ├── logs to disk
                                ├── broadcasts via WebSocket
                                │
                          Dashboard (web UI)
  1. Your AI agent sends requests to the local proxy instead of directly to the API
  2. Watchtower auto-detects the provider and forwards to the correct upstream
  3. Responses (including SSE streams) are decoded, logged, and forwarded back
  4. The dashboard connects via WebSocket for real-time updates

Requirements

  • Node.js >= 18

Roadmap

See TODO.md for the full roadmap, including planned features like:

  • Cost & token tracking
  • Search & filter
  • System prompt diffing
  • Request replay & modification (Burp Suite for Claude)
  • Agent hierarchy tree visualization

Contributing

Contributions welcome. Open an issue first for anything non-trivial.

git clone https://github.com/fahd09/watchtower.git
cd watchtower
npm install
npm start

The proxy is in intercept.mjs, provider logic in providers/, and the dashboard is a single dashboard.html. No build step, no bundler.

License

MIT