smart-compact

Analyze chat context and produce concise summaries with token estimation.

4|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/ybbms777/openclaw-claude-code-integration --skill smart-compact
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smart-compact
Source: https://github.com/ybbms777/openclaw-claude-code-integration/tree/main/skills/smart-compact
Command: npx skills add https://github.com/ybbms777/openclaw-claude-code-integration --skill smart-compact

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

智能压缩决策 Skill 根据当前 session 上下文自动选择合适的压缩策略(量化/代码开发/日常对话/混合),在 Boss 确认后输出压缩结果,并通过命令 /smart-compact 启用。

Core Features & Use Cases

  • 自动分析会话上下文并选取最优的压缩策略,明确保留的内容与丢弃项。
  • 生成可直接记录的摘要,并在需要时通过 Telegram 通知团队。
  • 支持 Dry-run 与实际压缩,提供 token 使用估算、保留比率和节省的 token 数。

Quick Start

在当前会话中执行 dry-run 以查看推荐策略并准备压缩。

Frequently Asked Questions about smart-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress long LLM chat histories to fit the context window?

You can compress long LLM chat histories by analyzing session context to produce concise summaries, preserving key decisions while estimating token usage to optimize retention within the context window.

What is session history compression and when do I need it?

Session history compression reduces long chat histories into concise, actionable summaries. You need it when multi-type sessions, including code blocks and planning discussions, exceed token limits and require optimized retention.

How do I estimate token usage before executing a session summary?

You can estimate token usage by running a deterministic dry-run workflow, which calculates the retention ratio and projected token savings before performing the actual session summarization.

Can I summarize code blocks and natural language dialogue in the same session?

Yes, the summarization process handles mixed session types by applying selective retention rules to extract key decisions from both natural language dialogue and code blocks simultaneously.

Does the smart-compact dry-run workflow require external dependencies?

No, the dry-run and compress workflow operates using local Python scripts and a minimax-like summarization service, requiring no external dependencies to execute session compression.

What is the best way to retain key decisions when reducing session context?

The best way to retain key decisions is applying selective retention rules during summarization, which automatically identifies and preserves critical planning outcomes while discarding redundant conversational history.