Claude Compress — Communication skill for Claude Code
Claude Code /compress command - compress chat sessions.
How to install Claude Compress
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open unclecode/claude-compress and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Compress does
Claude Code /compress command - compress chat sessions.
Alternatives in Communication
- Prompts.chat — f.k.a. Awesome ChatGPT Prompts 154.3k ★
- HolaOS — Open-source agentic workspace enterprises can make their own 10.9k ★
- Pregunta Cualquier Cosa Sobre El Código — /understand-chat How does the payment flow work 8.2k ★
README
Claude Code /ccomp Command
Compress Claude Code chat sessions to preserve key information while reducing size.
Quick Install
curl -sSL https://raw.githubusercontent.com/unclecode/claude-compress/main/install.sh | bash
Or with gh cli:
gh repo clone unclecode/claude-compress && cd claude-compress && ./install.sh
Update
Run the same install command to update to the latest version:
curl -sSL https://raw.githubusercontent.com/unclecode/claude-compress/main/install.sh | bash
Requirements
ANTHROPIC_API_KEYenvironment variable set- Python 3.8+ (uses only built-in modules, no pip dependencies)
Usage
In Claude Code
/ccomp
/ccomp 50%
/ccomp focus on API implementation, ignore debugging steps
/ccomp 40% keep file paths and commands, remove explanations
From Terminal (CLI)
ccomp # Default 30% compression
ccomp --target 50 # 50% compression
ccomp --focus "keep API calls" # With focus guidelines
ccomp --target 40 --focus "ignore logs" # Combined
ccomp --help # Show all options
This will:
- Detect your current chat session
- Extract all messages
- Compress long messages to ~30% of original size
- Save output to current directory as
chat_compressed_.txt
Manual Installation
# Copy script
mkdir -p ~/.claude/scripts
cp compress_chat.py ~/.claude/scripts/
chmod +x ~/.claude/scripts/ccomp_chat.py
# Copy command
mkdir -p ~/.claude/commands
cp compress.md ~/.claude/commands/
Options
Run the script directly with custom options:
python3 ~/.claude/scripts/ccomp_chat.py --cwd "$(pwd)" \
--target 30 \ # Target compression % (default: 30)
--min-length 1000 \ # Only compress lines >= this length (default: 1000)
--min-output 500 \ # Exclude lines < this from output (default: 500)
--batch-size 5 \ # API batch size (default: 5)
--wor
Related Skills
Lark Coding Agent Bridge
Bot that bridges Feishu/Lark messenger with a local Claude Code or Codex CLI. Streaming cards, per-chat sessio
Cctrace
Export Claude Code chat sessions into markdown and XML.
Group Chat Checkin
Coordinate parallel sessions for discussion, task execution, and git commits.
Pokegents
Pokegents is a local, Pokémon-inspired dashboard that turns Claude Code and Codex sessions into a local team d
Claude Chat To Md
Convert Claude Code chat sessions to clean Markdown — including subagent conversations
Find In Chat
Search captured chat-log turns from your prior Claude / Gemini sessions.
Related Agents
Context Optimizer
Meta utility agent for token and context optimization. Spawn when needing to compress agent prompts, optimize
Skill Refiner
Meta-skill agent. Takes a skill file and evidence of how it has performed in real sessions (commit log, chat t
Caveman
Rewrites any input into caveman style — terse, blunt, facts only. No greetings, no filler, no explanations. Us