Skip to content

immapolar/Thicc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘ Thicc

Node.js Version License Status AI Powered

JSONL Conversation Compressor for Claude Code

"Because that 'Context low' warning is a pain in the ass."


Thicc = Terminate, Hyper-Inflate, Claude Code

(Thanks, Claude Code Thinking mode β€” sarcastically.)


🚨 The Problem

Context Low Warning

You know that moment. You're deep in the zone, Claude Code is crushing it, and then BAM:

⚠️  Context low · Run /compact to compact & continue

Annoying, right? Like interrupting flow just when things get thicc with context.

Warning

Why /compact Sucks

  1. ⏱️ Takes forever β€” /compact can drag on for 2–5 minutes (especially in long or context-heavy conversations)

    • Thicc finishes in under 5 seconds (--safe) or at most 30 seconds (--medium/--aggressive)
  2. πŸ’Έ Token vampire β€” Can consume up to 40,000 tokens per compaction

    • Thicc avoids this pain completely
  3. πŸ”„ Starts a new conversation β€” /compact doesn't truly compact; it creates a brand-new conversation with a summary of the old one

    • Thicc preserves the current conversation fully intact
  4. 🧠 Loses context β€” /compact often causes Claude Code to forget user instructions, CLAUDE.md instructions, or even current task context (catastrophic)

    • Thicc summarizes older context using a selective approach, keeping the conversation body continuous and almost zero current context loss

Thicc is the only thing that can get rid of that warning without breaking your flow.


⚑ The Solution

Thicc in Action

Thicc compresses Claude Code .jsonl conversation files by intelligently clearing old context while keeping the conversation alive and intact.

🎯 Core Features

βœ… Lightning fast compression
βœ… Zero current context loss (preserves recent context)
βœ… AI-powered summarization (optional)
βœ… Tool pair integrity validation
βœ… Batch processing (multiple files at once)
βœ… Graceful degradation (falls back to Safe mode)
βœ… Auto model selection (mistral β†’ phi3 β†’ llama2)
βœ… Context-aware deletion (preserves snapshots)
βœ… Claude Code compatible (pure JSONL output)


πŸ“¦ Installation

Note

Prerequisites

  • Node.js 16+ (LTS recommended)
  • Ollama (optional, for Medium/Aggressive AI-powered modes)
# Install dependencies
npm install

# Optional: Install Ollama for AI summarization
# Download from https://ollama.ai
ollama pull mistral

πŸš€ Usage

Interactive Mode

node Thicc.js

CLI Arguments

# Safe mode (rules-based, no AI)
node Thicc.js --safe
node Thicc.js -s

# Medium mode (AI-assisted, balanced)
node Thicc.js --medium
node Thicc.js -m

# Aggressive mode (AI-assisted, maximum squeeze)
node Thicc.js --aggressive
node Thicc.js --hard
node Thicc.js -a

# Smart mode (real-time monitoring, 3-7% per pass)
node Thicc.js --smart <Session ID>

# Specify mode by number
node Thicc.js --mode 1    # Safe
node Thicc.js --mode 2    # Medium
node Thicc.js --mode 3    # Aggressive
node Thicc.js --mode 4    # Smart (requires session ID)

Help

node Thicc.js --help

πŸ”§ Compression Modes

πŸ›‘οΈ Safe Mode (Rules-Based)

Strategy:

  1. Identifies a percentage of tool pairs (adjusted based on conversation size)
  2. Deletes backwards from last redundant chunk to first file-history-snapshot or last summary
  3. NO AI intervention β€” pure algorithmic deletion
  4. Speed: Under 5 seconds
  5. Reduction: 5-10%
βš–οΈ Medium Mode (AI-Assisted)

Strategy:

  1. Performs Safe mode deletion first
  2. Summarizes deleted parentUuid chains using AI
  3. Embeds summary into single parentUuid message at the top
  4. Verifies tool pair integrity (no incomplete pairs in summarized section)
  5. Speed: ~20-30 seconds
  6. Reduction: 10-20%
πŸ’₯ Aggressive Mode (AI-Assisted)

Strategy:

  1. Performs Safe mode deletion first
  2. Summarizes deleted parentUuid chains using AI (more aggressive deletion window)
  3. Embeds summary into single parentUuid message at the top
  4. Verifies tool pair integrity
  5. Speed: ~20-30 seconds
  6. Reduction: 15-25%
🧠 Smart Mode (Real-Time Monitoring)

Strategy:

  1. Automatically locates session file in %USERPROFILE%/.claude/projects/*/*
  2. Monitors file size in real-time (polls every 3 seconds)
  3. Only intervenes when file exceeds 1500 KB initially
  4. Performs surgical deletion (3-7% per pass) using Safe mode algorithm
  5. Dynamically updates the file β€” removes only identified deletion range
  6. Never touches middle or recent sections of the conversation
  7. Intelligent threshold management β€” compresses once per +500 KB growth (cumulative)
  8. Continues monitoring indefinitely until stopped (Ctrl+C) or session ends
  9. Speed: Real-time, zero disruption to active conversation
  10. Reduction: 3-7% per pass (conservative, repeatable)

Use Case: Perfect for active, long-running Claude Code sessions. Start monitoring at the beginning of your session and forget about it β€” Smart Mode keeps your conversation optimized without interrupting your flow.

Threshold Logic:

  • First compression: When file reaches 1500 KB
  • Subsequent compressions: Every +500 KB from last compression
  • Example flow:
    • Start: 800 KB β†’ Monitoring...
    • Grows to: 1500 KB β†’ Compress β†’ 1381 KB
    • Grows to: 1881 KB (1381 + 500) β†’ Compress β†’ 1732 KB
    • Grows to: 2232 KB (1732 + 500) β†’ Compress β†’ 2065 KB
    • And so on...

Example:

# Get your session ID from /status command
node Thicc.js --smart 8d87c742-381b-48d5-9173-27b86de5061c

# Or use interactive mode and select option 4
node Thicc.js

πŸŽ“ Personal Workflow (How I Actually Use This)

Note

This is my real workflow.

As soon as the "Context low Β· Run /compact to compact & continue" warning appears:

  1. Get Session ID

    /status

    Copy the Session ID (e.g., 8d87c742-381b-48d5-9173-27b86de5061c)

  2. Navigate to .claude folder

    • Press Win + R (Windows)
    • Go to .claude or C:\Users\<user>\.claude
    • Enter the projects folder
  3. Copy the conversation file

    • Locate the .jsonl file (filename = Session ID)
    • Example: 8d87c742-381b-48d5-9173-27b86de5061c.jsonl
    • Copy it to the Src/ directory of Thicc
  4. Run Thicc

    node Thicc.js --medium
  5. Replace the original file

    • Remove the _compressed suffix from the filename
    • Paste it back into C:\Users\<user>\.claude\projects
  6. Restart Claude Code

    • Press Ctrl + C in the terminal
    • Run claude --continue
  7. Continue the conversation

    • No more "Context low" warning
    • Repeat whenever the warning shows up again

πŸ“Š Efficiency Comparison

Metric /compact Thicc (Safe) Thicc (Medium) Thicc (Aggressive) Thicc (Smart)
Time 2-5 minutes < 5 seconds ~20-30 seconds ~20-30 seconds Real-time (automatic)
Token Cost Up to 40,000 Zero Zero Zero Zero
Context Loss High (new conversation) Zero Zero Zero Zero
Instruction Retention Unreliable Perfect Perfect Perfect Perfect
Reduction ~30-50% 5-10% 10-20% 15-25% 3-7% per pass
Use Case Manual intervention Quick one-time Balanced compression Maximum squeeze Active sessions

Caution

Why /compact Loses Context

/compact summarizes the entire conversation (including recent context), then starts a new conversation with that summary. This causes:

  • Loss of CLAUDE.md instructions
  • Loss of user-defined preferences
  • Loss of current task context

Thicc summarizes older context only, preserving the most recent messages and keeping the same conversation alive.


πŸ“‚ Directory Structure

Thicc/
β”œβ”€β”€ Thicc.js              # Main entry point
β”œβ”€β”€ package.json          # Dependencies
β”œβ”€β”€ Src/                  # Place .jsonl files here
β”œβ”€β”€ Dist/                 # Compressed files output here
β”œβ”€β”€ Assets/               # Images and resources
└── Lib/                  # Internal modules
    β”œβ”€β”€ Ai/               # AI integration (Ollama)
    β”œβ”€β”€ Cli/              # Command-line UI
    β”œβ”€β”€ Compression/      # Compression modes
    β”œβ”€β”€ Core/             # Processing logic
    β”œβ”€β”€ Helpers/          # Utility functions
    β”œβ”€β”€ Io/               # File operations
    └── Validation/       # JSONL validation

🎨 Output Format

Claude Code Pure JSONL β€” each line is a complete JSON object:

{"type":"summary","summary":"...","leafUuid":"..."}
{"parentUuid":"...","message":{...},...}
{"parentUuid":"...","message":{...},...}

Compatibility: Output is directly compatible with Claude Code.


πŸ› οΈ Error Handling

Thicc handles errors gracefully:

Error Behavior
Ollama unavailable Automatically falls back to Safe mode
Model not found Prompts user, falls back to Safe mode
Invalid JSONL Reports errors, skips file, continues processing
Incomplete tool pairs Finds and deletes orphaned tool pairs

🎯 Workflow

  1. Place .jsonl conversation files in Src/ folder
  2. Run node Thicc.js (or with arguments)
  3. Select compression mode (if interactive)
  4. Tool processes all files in batch
  5. Outputs saved to Dist/ folder:
    • [filename]_compressed.jsonl

πŸ™ Credits

Note

Sexy Story

The idea for Thicc and the discovery of the proper manual summarization approach came from me β€” born out of pure frustration with that damn "Context low" warning interrupting my flow.

However...

The tool itself was effectively developed entirely by our beloved Claude Sonnet model. Every line of code, every algorithm, every playful status message β€” all crafted by Sonnet's silicon hands.

Thank You, Sonnet πŸŽ‰

For turning a frustrated idea into a hot to handle tool.
For understanding the assignment (and the vibe).
For making context compression thicc and efficient.

You're a real one, Sonnet. πŸ’œ


πŸ“„ License

ISC


πŸ‘ Thicc β€” Squeezing context so you don't have to.

Built with precision. Thicc enough. Slightly naughty.

Version 1.0.0 | 2025

About

πŸ‘ Lightning-fast Claude Code conversation compressor. Eliminates "Context low" warnings without losing context.

Topics

Resources

Stars

Watchers

Forks

Contributors