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

trimr

v1.0.1

Published

Local proxy that reduces AI API token usage via caching, diffing, dedup, and summarisation

Readme

Trimr

Token-saving proxy for Anthropic and OpenAI APIs. Cuts your API costs by caching, diffing, deduplicating, and summarising requests — transparent to Claude Code, Cursor, Codex, and any other tool.

Install

npm install -g trimr
trimr install

Then open http://localhost:3000 to see your savings.

That's it. Claude Code, Cursor, and Codex will automatically route through Trimr.

How it works

Trimr runs as a CONNECT tunnel proxy on port 8080. It sets HTTPS_PROXY and ANTHROPIC_BASE_URL environment variables so your AI tools route through it automatically. Every API call is compressed before forwarding to the real API.

[Claude Code / Cursor / Codex]
        |
        | HTTPS via CONNECT proxy (localhost:8080)
        v
  [Trimr Proxy :8080]
        |
        | Compression pipeline (cache, diff, dedup, summarise)
        |
        | HTTPS to real API
        v
  [Anthropic / OpenAI API]

Compression pipeline

| Step | What it does | Savings | |---|---|---| | System prompt cache | Hashes system prompt; on repeat calls adds Anthropic's native cache_control breakpoint | ~90% of system prompt on 2nd+ call | | File diffing | Detects file contents in tool results and fenced code blocks, stores last version, sends only unified diffs | 60-90% on iterative edits | | History compression | Strips echoed code from old assistant messages | 50-80% on long sessions | | Dedup | Identical requests within 5 min return cached responses (full-request + last-turn hashing) | 100% on duplicate calls | | Streaming passthrough | SSE events forwarded byte-for-byte | No overhead |

CLI commands

trimr install     Set up proxy (env vars, autostart)
trimr uninstall   Cleanly remove all modifications
trimr start       Start the proxy service
trimr stop        Stop the proxy service
trimr status      Show proxy status and lifetime stats
trimr help        Show this help

Uninstall

trimr uninstall

Cleanly reverses all changes — stops the proxy, removes env vars, removes autostart.

Manual proxy mode

You can also point tools at Trimr manually without running trimr install:

# Start the proxy
trimr start

# Point Claude Code at it
ANTHROPIC_BASE_URL=http://localhost:8080 claude

Dashboard

The web dashboard runs at http://localhost:3000 showing live sessions, token savings, cost reduction, and compression ratios.

Stats are also available as JSON at GET /tokendiff/stats.

Environment variables

| Variable | Default | Description | |---|---|---| | ANTHROPIC_API_KEY | — | Fallback API key (optional — tools pass their own) | | PORT | 8080 | Proxy port | | DASHBOARD_PORT | 3000 | Web dashboard port | | TOKENDIFF_DASHBOARD | true | Set false to disable terminal UI |

Data directory

~/.trimr/
  certs/           # Domain certificates (for MITM mode)
  trimr.pid        # PID of running proxy
  trimr.log        # Proxy log output
~/.tokendiff/
  history.json     # Lifetime statistics

License

MIT