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

cczip

v2.2.0

Published

Claude Context Compressor - Intelligently compress Claude conversation history

Readme

cczip - Claude Context Compressor

Never hit Claude's context limit again. Intelligently compress conversation history with one command.

Installation

npm install -g cczip

Quick Start

# Check your current usage
cczip --context

# Compress by 50% (default)
cczip

# That's it! Your conversation is optimized.

Common Usage Patterns

Managing Multiple Sessions

# List all available chat sessions
cczip --list

# Output:
# ID                                     TOKENS    MSGS  USAGE  MODIFIED
# ────────────────────────────────────────────────────────────────────────
# e93f6920-62eb-446f-92f1-69b30e387ec5  170006   254   85%  Sep 25, 08:57 PM
# 66b1d662-42b8-40f7-bf98-150eaaa08c13   45320    89   23%  Sep 25, 08:49 PM

# Compress a specific session
cczip e93f6920-62eb-446f-92f1-69b30e387ec5

# Compress session with specific amount
cczip e93f6920-62eb-446f-92f1-69b30e387ec5 40%

Compression Options

# Light compression (remove 30%)
cczip 30%
# → Keeps 70% of content, good for when you're at ~70% capacity

# Medium compression (remove 50%) - DEFAULT
cczip
# → Balanced approach, doubles your remaining space

# Heavy compression (remove 70%)
cczip 70%
# → Aggressive cleanup, keeps only 30% most relevant content

# Target specific token count
cczip 100000
# → Compress to exactly 100k tokens

Safety Features

# Preview changes without modifying anything
cczip --preview 40%
# Shows what would be removed, no changes made

# Every compression creates automatic backup
cczip 50%
# → Creates: session-id.jsonl.backup.1234567890

# Restore from backup if needed
cczip --restore
# → Restores most recent backup

Working with Files

# Auto-detect (uses most recent session in current directory)
cczip

# Specific session by ID
cczip e93f6920-62eb-446f-92f1-69b30e387ec5

# Specific file path
cczip /path/to/conversation.jsonl

# With compression amount
cczip conversation.jsonl 40%

Understanding Compression

What Gets Removed?

  • Messages with low relevancy to recent conversation
  • Old technical discussions unrelated to current topic
  • Redundant explanations that have been superseded

What Gets Protected?

  • First 2 ranges: Initial setup and context
  • Last 3 ranges: Most recent conversation
  • User messages: Preserved at range boundaries
  • Message threading: parentUuid chains maintained

Visual Context Display

cczip --context

# Output:
#   ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁
#   ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   Current Context Usage
#   ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   170,006/200,000 tokens (85%)
#   ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁
#   ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
#
#   Total messages: 254

Advanced Options

Custom Context Limits

# For different models with different limits
cczip --ctx-limit 150000 50%

Protection Zones

# Protect more initial context (first 5 ranges)
cczip --protect-start 5

# Protect more recent context (last 5 ranges)
cczip --protect-end 5

How It Works

  1. Analyzes your conversation to identify message ranges
  2. Calculates relevancy using lexical similarity to recent messages
  3. Removes low-relevancy ranges intelligently
  4. Preserves conversation flow and context
  5. Updates all token counts and message references
  6. Creates automatic backup before changes

Real-World Example

# Monday: Deep into a complex feature implementation
cczip --context
# → 168k/200k tokens (84%) ⚠️ Getting close!

# Compress to continue working
cczip 40%
# → Compress by 40% → Keep 60% (120,000 tokens)
# → [DONE] 168k → 120k tokens

# Continue coding without interruption!

Tips

  • At 80% capacity? Run cczip 30% for light cleanup
  • Hit the limit? Run cczip 70% for aggressive compression
  • Not sure? Use cczip --preview 50% to see what would be removed
  • Working on multiple projects? Use cczip --list to manage all sessions
  • Made a mistake? Use cczip --restore immediately

Troubleshooting

No sessions found

cczip --list
# [ERROR] No Claude sessions found in current directory

Solution: Run from a directory where you've used Claude

Session not found

cczip abc-def-ghi
# [ERROR] Session not found: abc-def-ghi

Solution: Check session ID with cczip --list

Already optimized

cczip
# ✓ File is already within target size. No optimization needed.

Solution: Your conversation is already compact!

License

MIT

Contributing

Found a bug or have a feature request? Open an issue at: https://github.com/unclecode/cczip/issues