✨
简介
Context Shrink
原始描述
Auto-compress session memories when context usage exceeds 85%
通过你的 Agent 添加
点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。
或者手动安装
Claude Codeunzip -o skill.zip -d ~/.claude/skills/context-shrink/
其它 Agent解压到它自己的 skills 目录,目录名用 context-shrink
包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。
技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。
技能正文
name: context-shrink slug: context-shrink description: "Auto-compress session memories when context usage exceeds 60%" type: hook version: 1.0.0 author: Lin license: MIT
Context Shrink Hook
Auto-compresses session memories when context usage exceeds 60% threshold. Cleans up old daily logs and compresses them into MEMORY.md for long-term storage.
Features
- 自动触发: 当 context 使用率 ≥ 60% 时自动执行
- 智能清理: 保留最近 3 天的详细日志
- 压缩存储: 旧日志压缩后写入 MEMORY.md
- Git 提交: 自动 commit 变更记录
Configuration
CONTEXT_THRESHOLD = 0.6 // 60% 触发阈值
DAYS_TO_KEEP = 3 // 保留最近 N 天日志
MIN_FILES_TO_KEEP = 5 // 至少保留文件数
COMPRESSION_MODEL = 'ollama-remote/qwen2.5:3b'
Changelog
1.0.0
- Initial release
- Auto-compression at 60% threshold
- Git commit on cleanup
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。
标签
同类 Skill
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
Self-Improving + Proactive Agent
Self-Improving + Proactive Agent
下载 177.1k
✨
Gog
Gog
下载 165k