memory

A project-memory manager that keeps current progress, technical decisions, problems, and reusable patterns in Markdown files inside a memory-bank folder.

In plain words
What is it for?
Use it to save progress, record architecture and technology decisions, document solved problems, check memory status, load context at the start of a session, and synchronize memory files.
Why use it?
It preserves project knowledge between coding sessions, so an agent can resume work without relying on the full earlier conversation.

Command

Install

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.

agentmods
npx agentmods add commands/xiaobei930/cc-best/memory
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 753 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.00753
Opus 5 $0.00014 $0.00377
Sonnet 5 $0.00005 $0.00151
Haiku 4.5 $0.00003 $0.00075

Measured 2d ago against content hash 50cf2933a511, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 2d 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.

commands/memory.md · 98 lines

What it actually says

/memory - 项目记忆管理

管理项目上下文和长期记忆,确保连续性。

记忆层次

1. 即时记忆(当前会话)

  • 当前任务上下文
  • 最近的代码变更
  • 未解决的问题

2. 短期记忆(memory-bank/progress.md)

  • 今日完成的工作
  • 当前阶段状态
  • 待办事项

3. 长期记忆(memory-bank/*.md)

  • 架构设计决策
  • 技术选型理由
  • 历史问题和解决方案

记忆更新规则

必须更新的时机

  1. 完成一个 Phase → 更新 progress.md + architecture.md
  2. 做出重要决策 → 记录到相关文档
  3. 遇到并解决问题 → 添加到问题记录
  4. 发现可复用模式 → 记录到规范文档

更新格式

### [日期] [时间]

**操作**: [做了什么]
**结果**: [产出/状态]
**决策**: [为什么这样做](可选)
**下一步**: [接下来做什么]

上下文恢复

新会话开始时

  1. 读取 memory-bank/progress.md - 了解当前状态和最近进展
  2. 读取当前阶段相关文档
  3. 确认下一步任务

恢复命令

  • /cc-best:memory load - 加载项目上下文
  • /cc-best:memory status - 显示当前记忆状态
  • /cc-best:memory sync - 同步所有记忆文件

关键文件索引

文件 用途 更新频率
memory-bank/progress.md 当前状态和进度 每个任务
memory-bank/architecture.md 架构设计 架构变更时
memory-bank/tech-stack.md 技术选型 技术变更时

记忆容量管理

避免信息过载

  • progress.md 只保留最近 7 天的详细记录
  • 历史记录归档到 docs/history/
  • 保持每个文件 < 500 行

信息压缩

  • 完成的任务只保留摘要
  • 相似问题合并记录
  • 定期清理过时信息

渐进式加载(大项目推荐)

当 memory-bank 文件 > 5 个或总量 > 30KB 时:

  1. ls memory-bank/ 查看文件列表和大小
  2. head -20 <file> 预览相关文件
  3. 只完整加载确实需要的文件

小项目(3-5 个文件,~20KB)直接全量加载即可,不必强求渐进式。

记住: Memory Bank 是跨会话的桥梁,每次会话结束前更新 progress.md,下次启动就能无缝继续。

Changes

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.

  1. 2d ago First seen · 98 lines · 27 tokens per session scan A 50cf2933a511

Subscribe to this mod's changes

memory is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 27 tokens to every session and 753 once invoked, about $0.0001 per session on Opus 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-08-30.