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

@sumanit/claude-code-observer

v1.0.0

Published

Use Claude Code without an Anthropics account and route it to another LLM provider

Downloads

90

Readme

Claude Code Observer

A traffic observer for Claude Code that proxies requests and provides real-time SSE (Server-Sent Events) streaming for monitoring and debugging.

English | 中文

✨ Features

  • Traffic Proxy: Proxies Claude Code API requests to different LLM providers (e.g., DeepSeek, OpenAI, etc.)
  • Real-time Streaming: SSE-based real-time traffic monitoring and event streaming
  • Request/Response Tracking: Captures complete request and response data including headers and timing
  • Web Dashboard: Built-in web interface for visualizing traffic streams
  • Health Monitoring: Health check endpoint for service monitoring
  • Easy Deployment: Docker support with Docker Compose configuration

🚀 Getting Started

Installation

Install the package globally:

npm install -g @musistudio/claude-code-router

Or build from source:

git clone <repository-url>
cd observer-for-claude-code-node
npm install
npm run build

Running the Server

Method 1: Using the CLI

observer

Method 2: Using Node.js

node dist/cli.js

Method 3: Using Docker

docker-compose up

The server will start on port 8080 by default. You can change the port by setting the PORT environment variable:

PORT=3000 node dist/cli.js

📡 API Endpoints

Health Check

Check if the service is running:

curl http://localhost:8080/health

Response:

{
  "status": "OK",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Traffic Proxy

Proxy requests to different LLM providers:

curl http://localhost:8080/proxy/{model}/{path}
  • {model}: Base64 encoded target API URL (optional, defaults to DeepSeek)
  • {path}: API endpoint path

Example:

curl -X POST http://localhost:8080/proxy/aHR0cHM6Ly9hcGkuZGVlcHNlZWsubmV0L2FudGhyb3BpYw==/v1/messages \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4", "messages": [{"role": "user", "content": "Hello"}]}'

SSE Traffic Stream

Connect to the real-time traffic stream:

curl -N http://localhost:8080/proxy/trace

Event format:

{
  "id": "uuid",
  "type": "REQUEST|RESPONSE",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "body": "request/response body",
  "statusCode": 200,
  "durationMs": 1234
}

🖥️ Web Dashboard

Access the built-in web dashboard at:

http://localhost:8080/

The dashboard provides a real-time view of all traffic flowing through the proxy.

🔧 Configuration

Environment Variables

  • PORT: Server port (default: 8080)
  • TARGET_URL: Default target API URL (default: https://api.deepseek.com/anthropic)

Building the Project

npm run build

Type Checking

npm run type-check

🐳 Docker Deployment

Using Docker Compose

docker-compose up -d

Using Docker directly

docker build -t claude-code-observer .
docker run -p 8080:8080 claude-code-observer

📝 Use Cases

  1. Debugging API Requests: Monitor and debug Claude Code API requests and responses
  2. Traffic Analysis: Analyze traffic patterns and performance metrics
  3. Multi-Provider Support: Route requests to different LLM providers easily
  4. Development: Test Claude Code integrations with various providers

🔒 Security Considerations

  • By default, the server listens on all interfaces. In production, consider restricting access
  • Use reverse proxies (nginx, Traefik) for additional security features
  • Implement authentication if deploying to public networks

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT

🙋 Support

If you encounter any issues or have questions, please open an issue on GitHub.