Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Songhonglei/better-agent-skills --skill consolidate-memorygit clone --depth 1 https://github.com/Songhonglei/better-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/songhonglei/better-agent-skills/consolidate-memory)<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/consolidate-memory"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/consolidate-memory/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/consolidate-memory"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/consolidate-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00131 | $0.01474 |
| Opus 5.5 | $0.00052 | $0.00590 |
| Sonnet 5.5 | $0.00026 | $0.00295 |
| Haiku 4.5 | $0.00013 | $0.00147 |
Grade A, and why
consolidate-memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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)。
- 输出汇总:动了几个文件、合并 / 删除 / 修改各几条、压缩前后字符数、剩余待办。
- 若仍超限,说明差多少、建议迁移哪几节,不要自行大删。
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 17d ago First seen · 72 lines · 131 tokens per session scan A a6e17f4cfbcd
consolidate-memory is a skill published in the GitHub repository Songhonglei/better-agent-skills (4 stars, last pushed 13d ago), licensed MIT. It adds 131 tokens to every session and 1,474 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-13.
consolidate-memory compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| consolidate-memorySonghonglei/better-agent-skills | Skill | 4 | 13d ago | MIT | A | 131 | Claude Code, Codex |
| memory-systembojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 95 | Claude Code, Codex |
| memory-recallzilliztech/memsearch | Skill | 3.0k | 3d ago | MIT | A | 152 | Claude Code |
| memanto-companionmoorcheh-ai/memanto | Skill | 2.4k | 2d ago | Apache-2.0 | A | 72 | Claude Code |
| openloreaakarim/OpenLore | Skill | 2.0k | 9d ago | Apache-2.0 | A | 42 | Claude Code, Codex |
| Context Doctorletta-ai/letta-code | Skill | 3.9k | today | Apache-2.0 | A | 66 | Claude Code, Codex |
| mnemonmnemon-dev/mnemon | Skill | 752 | 7d ago | Apache-2.0 | A | 25 | Claude Code, Codex |