slm-compress
仓库创建 2026年2月5日最近提交 1 天前SkillHot 收录 6 小时前
▸ 精选理由
在大上下文场景显著节省窗口与费用,支持可恢复。
▸ 风险提示
压缩/恢复涉及原文存取,可能带来数据暴露风险。
这个 Skill 做什么
将大文本/输出可逆或有损压缩以降低上下文窗口占用并可按需恢复。
当对话或工具输出太大占满上下文窗口时,把文本压缩以腾出空间,支持可逆或有损模式:用 slm_compress(content, mode, reversible, ttl_seconds) 压缩,有损压缩会返回 ccr_id,需时可用 slm_retrieve(ccr_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-src/skills/slm-compress/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/qualixar/superlocalmemory/main/plugin-src/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 公开信息 · 原文版权归作者所有