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

ai-squeeze

v1.0.0

Published

Compress verbose CLI output for AI coding assistants. Saves 90%+ tokens on build errors, test results, and logs.

Readme

ai-squeeze

Built by Claude Code License: MIT TypeScript

This project was entirely designed, written, and published by Claude Code (Anthropic's AI coding assistant).

Compress verbose CLI output for AI coding assistants. Turns 500-line build errors into 15 lines. Saves 90%+ tokens on noisy output.

The Problem

Every time your AI coding assistant runs a command, the full output goes into its context window. A single npx tsc --noEmit can dump 500+ lines of errors. A jest --verbose run prints every passing test. An npm install spews 200 lines of progress nobody reads.

That output eats tokens. Tokens cost money. Worse, the noise pushes useful context out of the window.

ai-squeeze compresses that output before it reaches the AI. It auto-detects the output type and applies smart, type-specific compression.

Quick Start

npx ai-squeeze "npm run build 2>&1"

Or pipe:

npx tsc --noEmit 2>&1 | npx ai-squeeze

Before / After

TypeScript Errors

Before (523 lines):

src/app/admin/users/page.tsx(12,5): error TS2322: Type 'string' is not assignable to type 'number'.
src/app/admin/users/page.tsx(15,10): error TS2304: Cannot find name 'UserProfile'.
src/lib/auth.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'.
src/lib/auth.ts(8,14): error TS7006: Parameter 'req' implicitly has an 'any' type.
... (519 more lines)

After (15 lines):

TypeScript: 523 errors in 84 files

By error code:
  TS2322: 201 occurrences
  TS2304: 156 occurrences
  TS7006: 98 occurrences
  TS2345: 45 occurrences
  TS2339: 23 occurrences

First errors:
  src/app/admin/users/page.tsx:12 TS2322: Type 'string' is not assignable to type 'number'
  src/app/admin/users/page.tsx:15 TS2304: Cannot find name 'UserProfile'
  src/lib/auth.ts:3 TS2322: Type 'string' is not assignable to type 'number'

-- squeezed [typescript-errors]: 523 -> 15 lines | ~12,800 tokens saved (95%) --

Test Results

Before (347 lines):

PASS src/utils/date.test.ts
  date formatting
    ✓ formats ISO to display (3ms)
    ✓ handles null dates (1ms)
    ✓ applies timezone offset (2ms)
... (200 more passing tests)
FAIL src/api/users.test.ts
  user API
    ✕ returns 404 for missing user (5ms)
      Expected: 404
      Received: 500
... (more output)

After (12 lines):

Test Suites: 23 passed, 1 failed, 24 total
Tests:       198 passed, 2 failed, 200 total
Time:        12.3s

FAILURES:
  FAIL src/api/users.test.ts
    user API
      ✕ returns 404 for missing user (5ms)
        Expected: 404
        Received: 500

-- squeezed [test-results]: 347 -> 12 lines | ~8,200 tokens saved (93%) --

Stack Traces

Before (48 lines):

TypeError: Cannot read properties of undefined (reading 'id')
    at getUserProfile (/src/api/users.ts:45:23)
    at handler (/src/app/api/users/route.ts:12:18)
    at Object.apply (/node_modules/next/dist/server/web/adapter.js:123:16)
    at /node_modules/next/dist/server/base-server.js:456:22
    ... (43 more node_modules frames)

After (6 lines):

TypeError: Cannot read properties of undefined (reading 'id')
    at getUserProfile (/src/api/users.ts:45:23)
    at handler (/src/app/api/users/route.ts:12:18)
    ... 43 library/internal frames

-- squeezed [stack-trace]: 48 -> 4 lines | ~1,100 tokens saved (90%) --

npm Install

Before (189 lines):

npm warn deprecated [email protected]: ...
npm warn deprecated @humanwhocodes/[email protected]: ...
npm warn deprecated [email protected]: ...
... (progress bars, resolution details, etc.)
added 1847 packages in 42s
234 packages are looking for funding
  run `npm fund` for details
3 moderate severity vulnerabilities

After (4 lines):

added 1847 packages in 42s
3 deprecation warning(s)
234 packages are looking for funding
3 moderate severity vulnerabilities

-- squeezed [npm-install]: 189 -> 4 lines | ~4,600 tokens saved (97%) --

Detected Output Types

| Type | Pattern | Strategy | |------|---------|----------| | typescript-errors | error TS\d+ | Group by error code, show first 5 unique | | eslint-errors | X problems (Y errors, Z warnings) | Group by rule, show samples | | test-results | PASS/FAIL, Tests: | Summary + failures only | | npm-install | added X packages | Summary + warning counts | | stack-trace | Error: + at frames | User frames only, collapse libs | | git-log | Commit hash lines | Head 10 + tail 5 | | json-blob | Valid JSON > 500 chars | Schema + first 2 items | | generic | Everything else | Dedup + head/tail |

CLI Options

squeeze <command>                Run command, compress output
<command> | squeeze              Pipe mode
squeeze --threshold 30 <cmd>    Min lines before compression (default: 20)
squeeze --type typescript <cmd>  Force detection type
squeeze --stats-only <cmd>      Show only stats, not output
squeeze --help                  Show help

Integration with AI Assistants

Claude Code

Add to your CLAUDE.md:

## Output Compression
For commands that may produce verbose output (builds, tests, logs), use squeeze:
- `squeeze "npx tsc --noEmit 2>&1"` instead of running tsc directly
- `squeeze "npx jest --verbose 2>&1"` for test runs
- `git log --oneline -100 | squeeze` for long git history

Cursor / Copilot / Codex

Add squeeze to your AI assistant's rules file. Any tool that reads CLI output benefits from compressed input.

How It Works

  1. Output under 20 lines passes through unchanged
  2. ANSI escape codes are stripped
  3. Pattern matching detects the output type
  4. Type-specific compressor extracts signal, drops noise
  5. Stats line shows savings

No AI models are used. All compression is deterministic pattern matching. Fast, free, predictable.

Pairs With

  • ai-codex -- pre-build codebase index (saves exploration tokens)
  • RTK -- bash output compression at the shell level

ai-codex saves tokens at session start. ai-squeeze saves tokens during the session. Use both.

License

MIT. Free forever.