Compress and decompress text files using smart abbreviation and whitespace normalization. Use when user asks to compress, shrink, reduce, or optimize text fi...
Coding
Snip Compressor
Try itSemantic conversation compressor — intelligently summarize long chat history while preserving key decisions, facts, and context.
What it does
Semantic conversation compressor — intelligently summarize long chat history while preserving key decisions, facts, and context.
The skill document
Snip Compressor
Distilled from Claude Code's Snip compression engine. Analyzes conversation history and generates a compressed summary that preserves semantic continuity — not a simple truncation.
When to use
- Conversation exceeds 60% of context window
- User says "continue" / "刚才说到哪了" / "where were we"
- Before compaction to preserve key context
- Session handoff between agents
How it works
- Parse — Split conversation into segments (user messages, assistant replies, tool calls, tool results)
- Score — Each segment gets a retention score based on:
- Contains decision/agreement (high)
- Contains factual data/numbers (high)
- Contains tool results (medium, summarized)
- Contains greetings/small talk (low)
- Compress — Low-score segments get dropped or condensed; high-score segments preserved verbatim or lightly summarized
- Rebuild — Output a compressed transcript that reads naturally
Usage
# Compress a conversation file
python3 {baseDir}/compressor.py --input conversation.json --output compressed.md
# Compress with custom token budget
python3 {baseDir}/compressor.py --input conversation.json --budget 2000
# Compress from stdin
cat conversation.json | python3 {baseDir}/compressor.py --budget 1500
Input format
JSON array of message objects:
[
{
"role": "user",
"content": "帮我分析一下这个股票"
},
{
"role": "assistant",
"content": "好的,我来看看...",
"tool_calls": [
{"name": "exec", "result": "{...}"}
]
}
]
Output
Markdown with sections:
- Summary: 1-2 paragraph overview
- Key Decisions: bullet list of decisions made
- Active Context: what's currently in progress
- Compressed Transcript: compressed conversation (token-optimized)
Algorithm reference
Based on Claude Code's src/services/snip/ module:
- Semantic boundary detection: topic shift → new segment
- Importance scoring: decision > data > tool_result > greeting
- Token-aware truncation: respects model-specific limits
- Cross-segment reference preservation: if segment B references segment A, both are retained
Related skills
Compress any source while preserving every claim, hedge, number, and attribution.
Say "Help me install this skill from https://clawhub.ai/shuminliu026/chat-summary-card" to your local agent, then turn conversations into polished visual sum...
Compresses verbose responses by removing filler and framing to save 200-400 tokens
Quickly summarize any text, URL, or file content into a concise structured brief. Use when the user wants a TL;DR, executive summary, or needs to distill long content into key points without reading the full source.
面向长文本场景的语义压缩工具,通过迭代验证与锚点校验机制,在保证关键信息完整的前提下大幅缩减Token占用。核心能力:,可自发提升工作效率. 适用于需要file compressor相关能力的开发场景,包含结构化的工作流程和可复用的模板,帮助用户快速完成任务并保持代码质量. 适用于需要file compressor相关能力的开发场景,包含结构化的工作流程和配置指引.