consolidate-memory
Skill4 starsChanged 5 months agoMITView on GitHub
Reflective pass over an agent's memory files — merge duplicates, retire stale entries, convert relative time to absolute dates, and prune a bloated MEMORY.md back under its size cap. WorkBuddy-adapted edition: maps the three-layer memory system (read-only cloud profile / user-level MEMORY.md / workspace daily logs), enforces append-only logs, backup-before-write and per-item approval. Triggers: "consolidate memory", "memory health check", "review memory", "整理记忆", "记忆体检", "记忆去重", "压缩记忆", "清理记忆".
11 other projects use a version of this.
Adopted by
Most recently taken up by
- invergent-ai/surogatestheir own version, first seen Oct 13, 2026
- GeekFamilyCorp/TricorderKittheir own version, first seen Oct 13, 2026
- jesusalgartrainer/claude-skillstheir own version, first seen Oct 13, 2026
- UtsavBalar1231/oh-my-claudeagenttheir own version, first seen Oct 12, 2026
- docvinum/agent-skillstheir own version, first seen Sep 2, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- GeekFamilyCorp/TricorderKit★ 32same name
- invergent-ai/surogates★ 28same name
- Hassaan146/claude-skills★ 18same name
- thtskaran/claude-skills★ 18same name
- UtsavBalar1231/oh-my-claudeagent★ 3same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- LilithLabs/lilith★ 1same name
- docvinum/agent-skills★ 0same name
- jesusalgartrainer/claude-skills★ 0same name
- Myra-Agents/skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- agent-avatar-managerSkill
- agent-team-meshSkill
- claw-memory-managerSkill
- codex-thread-repairSkill
- collective-memorySkill
- copy-my-profileSkill
- hello-envSkill
- init-hooksSkill
- mulitca-cost-dashboardSkill
- multica-squad-load-balancerSkill
- multica-squad-onboardSkill
- openviking-projectsSkill
- recover-codex-project-chatsSkill
- rename-sessionSkill
- session-recoverySkill
- subagent-timeout-configSkill
- token-slimSkill
- workspace-git-setupSkill
The file
Files
Consolidate Memory(WorkBuddy 适配版)
- Version: 1.0.0-wb
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills
- Upstream: Claude Code
consolidate-memory(MIT) — https://claudskills.com/skills/consolidate-memory - Platform: WorkBuddy three-layer memory. Claude Code users should use the upstream original instead.
目标:让下一次会话能快速定位「用户是谁、在意什么、怎么做事」,不用重新问一遍。
原版假定 Claude Code 的单一 memory 目录 + MEMORY.md 索引文件;本版按 WorkBuddy 三层记忆重写,目录、红线、容量全部对齐平台规则。
0. 目录映射与边界(先做这一步)
| 层 | 位置 | 本 skill 的动作 |
| 云记忆 | 会话注入的 <memory> 与服务端 profile | 只读,跳过。服务端自动学习,本地改动会被覆盖 |
| 用户级 | ~/.workbuddy/user-*/MEMORY.md(用 ls -d 定位) | 可整理:精简、去重、修时间、迁工作流。上限 4,000 字符 |
| 工作区长期 | <workspace>/.workbuddy/memory/MEMORY.md | 可整理:项目长期笔记。上限 3,000 字符 |
| 工作区日志 | <workspace>/.workbuddy/memory/YYYY-MM-DD.md | 只读 + 只追加,不改写、不删除、不重排 |
| 身份三件套 | ~/.workbuddy/user-*/{SOUL,USER,IDENTITY}.md | 只读,由用户手动维护 |
硬性红线:
- 绝不删除
.workbuddy目录;不改 SOUL / USER / IDENTITY;不写云记忆。 - 日志 append-only:30 天以上日志的蒸馏由 WorkBuddy 内置机制负责,本 skill 只产出蒸馏候选清单,不执行移动或删除。
- 不写入密钥、token、身份证 / 银行卡等敏感值;发现即提示用户移除,不复述内容。
- 改动前先把目标文件备份到同目录
MEMORY.md.bak-YYYYMMDD-HHMMSS,并确认备份成功。 - 逐条确认:先给完整清单,用户确认一项才改一项,禁止批量套用。
- 用户级
MEMORY.md是「分节规则清单」,不要套用 Claude 版- [Title](file.md) — hook索引格式,不凭空造主题文件。
1. 盘点
- 定位并读取两层
MEMORY.md,用wc -m统计字符数,对照 4,000 / 3,000 上限。 - 只读扫近期工作区日志,仅用于判断哪些长期条目已经过时。
- 给每条打标签:重复 / 过期 / 相对时间 / 易重查 / 应迁到 skill / 保留。
- 先汇报:条目数、字符数、超限多少、各类问题各几条。
2. 整理
按此优先级处理,逐条出示「原文 → 拟改」并等用户确认:
- 合并重复:同一规则在多处出现,保留最完整的一条,其余合并或删除。
- 清理过期:一次性项目、已过截止日的安排、已失效的账号状态,删掉或折成一句可复用结论。
- 绝对日期化:「上周」「本季度」「30 天内」改成
YYYY-MM-DD,过期判断据此得出。 - 去掉易重查的:能从日历、文档、git、已连接工具随时拉到的内容不存;保留偏好、决策背后的原因、找谁办什么事。
- 超限时先迁后删:可执行的多步工作流迁到 skill,
MEMORY.md只留一行指针;过程叙述一律删,只留结论。 - 矛盾项:两条冲突时保留较新且更明确的一条,另一条标注后交用户裁决,不静默覆盖。
3. 收尾
- 复跑
wc -m,确认两层都在上限内;按主题分节、每节条目精简;仅扁平索引式 MEMORY.md 才限 10–20 条。 - 确认日志文件未被改动(对比备份或 mtime)。
- 输出汇总:动了几个文件、合并 / 删除 / 修改各几条、压缩前后字符数、剩余待办。
- 若仍超限,说明差多少、建议迁移哪几节,不要自行大删。
与内置能力的分工
- 平台内置的「完成实质工作后自动写日志」「30 天以上日志蒸馏进 MEMORY.md」负责增量写入与归档;本 skill 负责存量体检(去重、去矛盾、绝对日期化、容量压回),两者互补,不替代。
/memory面板与设置 → 记忆提供单条查看 / 编辑 / 删除 / 导入,适合点状修改;本 skill 适合整本过一遍。- 本 skill 不自动运行,只在用户显式触发、或发现明显超限时提议一次。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

