slm-compress
仓库创建 2026年2月5日最近提交 1 天前SkillHot 收录 6 小时前
▸ 精选理由
在保持大窗口可用性的同时减少占用,支持可逆恢复。
▸ 风险提示
有损压缩会丢失细节,重要信息需避免不可逆压缩。
这个 Skill 做什么
压缩大型文本或输出以节约上下文窗口,支持按需恢复。
当对话或工具输出太大占满上下文窗口时,把文本压缩以节约 tokens,同时保留整段内容可恢复的能力。压缩可以是可逆的:若有损会返回一个 id(可后续检索恢复原文),出错时则宽松回退继续使用原始内容。适合长日志、转录或大型输出频繁出现、需要腾出上下文位置的场景。
▸ 展开 SKILL.md 英文原文
Compress large text, tool output, or transcripts to reduce context-window usage while keeping the full 1M window intact — call slm_compress(content, mode, reversible, ttl_seconds) to shrink content; if the result is lossy a ccr_id is returned so you can call slm_retrieve(ccr_id) later to recover the exact original; always fail-open (ok:false → continue with the original).
199
Stars
34
Forks
37
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/qualixar/superlocalmemory/main/plugin/skills/slm-compress/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/qualixar/superlocalmemory/main/plugin/skills/slm-compress/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# slm-compress — Reversible Context Compression (Surface B)
## Purpose
When a tool output, transcript, or accumulated context grows large enough to crowd out working space, `slm_compress` reduces it in-place. The compressed form is used for the remainder of the session; the exact original is recoverable on demand via `slm_retrieve`. This works without a proxy and without touching `ANTHROPIC_BASE_URL`, so the full 1M context window is never sacrificed.
## Primary MCP Tool: slm_compress
```
slm_compress(
content: str, # required — text to compress (max 1 MB)
mode: str = "auto", # "normalize" | "auto" | "aggressive"
reversible: bool = True, # store origvia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有