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

trimprompt

v1.0.32

Published

TrimPrompt — Save 80% on LLM tokens. Zero-config CLI proxy for AI coding agents

Downloads

5,369

Readme

TrimPrompt.ai — Client CLI & Local Developer Dashboard

TrimPrompt is an intelligent, zero-configuration local proxy and telemetry client designed to reduce LLM token consumption for AI coding assistants (such as Claude Code, Cursor, GitHub Copilot, and Windsurf) by 60% to 90%.

It intercepts common shell tool executions, strips ANSI coloring, removes redundant boilerplate, collapses duplicate logs, and applies specialized filters for git, npm/pnpm/yarn, pytest, jest, pip, and more—all before the outputs reach your AI agent's context window.

TrimPrompt Local Developer Dashboard


The CSA Engine: How TrimPrompt Works

TrimPrompt coined and invented the CSA (Compression, Security, Audit) Framework to establish the standard architectural pattern for secure, cost-effective LLM prompt and context optimization:

  • C - Compression (Token Optimization): Intelligent context compression that slashes LLM API token consumption by 60% to 90% in real-time, preserving full reasoning quality.
  • S - Security (On-Premise Shielding): Automated local redaction layer that secures sensitive corporate data, blocking credentials and proprietary keys from leaking to third-party model providers.
  • A - Audit (Telemetry & ROI Tracking): Enterprise-grade visibility into developer adoption, cost savings, and compliance metrics from a unified, private dashboard.

⚡ CONVERSATION COMPRESSION (LIVE CONTEXT)

TrimPrompt Live Conversation Compression

TrimPrompt features real-time background watchers and native hooks that continuously compress active AI session logs and conversation histories on-the-fly, preventing context window bloat and slashing token costs:

  • 🟢 Google Gemini Code Assistant: Live session watcher monitoring and compressing Gemini CLI & extension session logs in ~/.config/gemini/.
  • 🟢 Claude Code Live Compression: Native hooks and local side-cache engine for active sessions in ~/.claude/projects/.
  • 🟢 Aider Chat History Optimizer: Automatic background optimization for .aider.chat.history.md files upon launch.
  • 🟢 Universal Agent Support: Integrated live session monitors for Codex, Cursor, GitHub Copilot, OpenClaw, OpenCode, and Cortex.

Features

  • Zero-Config Interception: Automatically injects custom PATH shims during installation so that all agent-triggered tools run through the optimizer transparently.
  • Real-time MCP Proxy: Intercepts Model Context Protocol (MCP) tool response JSON-RPC streams on the fly to compress large tool outputs.
  • Developer Dashboard: Visualizes token savings, original vs. shaved cost estimates, and provides a line-by-line diff inspector.
  • Log Rotation Policy: Automatically prunes local log text files and database entries older than 180 days in the background to prevent disk bloat.
  • Central Sync: Option to stream aggregated daily savings metrics to a centralized self-hosted Enterprise Hub.

Installation & Setup

Install the package globally via NPM:

npm install -g trimprompt

[!IMPORTANT] Restart your active terminal window or AI editor (Cursor/Claude Code) after installation for the changes to take effect.


Usage

1. Transparent Interception

Since TrimPrompt intercepts commands at the OS PATH level, your AI assistants will automatically benefit from prompt optimization without changing their workflow. When Claude Code runs git status, it triggers trim git status behind the scenes, outputting a compacted representation.

2. Local Developer Dashboard

Start the local dashboard web UI:

trim ui
# or trim dashboard

Options:

  • -p, --port <number>: Port to run the server on (default: 4000).

The command will boot the dashboard web server and automatically open your default browser pointing to: 👉 http://localhost:4000

Inside the Dashboard:

  • Analytics Cards: See your Shaved Cost, Reduction Rate, Estimated Savings, and Original Cost.
  • Savings Timeline: A Chart.js graph tracking your daily raw vs. compressed token counts.
  • Execution Logs: Click on any past command to open the visual side-by-side diff inspector showing the exact raw vs. compacted output.

3. Manual CLI Commands

You can also run commands manually:

  • Show stats summary:
    trim stats
  • View/Set local configurations (e.g. set telemetry sync endpoint):
    trim config set telemetry_url "http://your-company-hub:5000/api/telemetry"
  • Inspect a dry-run command rewrite:
    trim rewrite "git status"

4. Model Context Protocol (MCP) Proxying

If you run interactive, streaming MCP servers, wrap them with the mcp-proxy command:

trim mcp-proxy <server-command> [server-args...]

Example:

trim mcp-proxy npx -y @modelcontextprotocol/server-postgres postgres://localhost:5432

TrimPrompt will parse the stdin/stdout JSON-RPC stream, extract the tool response text blocks, compress them, log metrics, and forward the stream in real-time.


180-Day Log Rotation Policy

To keep your disk usage lightweight, TrimPrompt runs a background cleanup process. Every calendar day you use the CLI, a detached background process unlinks all log files (.raw.txt and .comp.txt) inside ~/.trimprompt/logs/ and removes metadata records from stats.json that are older than 180 days.


License

Proprietary — TrimPrompt.ai