prod-memory-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory Management

内存管理

Memory makes Claude your workplace collaborator - someone who speaks your internal language.
内存让Claude成为你的职场协作伙伴——一个能听懂你内部用语的伙伴。

The Goal

目标

Transform shorthand into understanding:
User: "ask todd to do the PSR for oracle"
              ↓ Claude decodes
"Ask Todd Martinez (Finance lead) to prepare the Pipeline Status Report
 for the Oracle Systems deal ($2.3M, closing Q2)"
Without memory, that request is meaningless. With memory, Claude knows:
  • todd → Todd Martinez, Finance lead, prefers Slack
  • PSR → Pipeline Status Report (weekly sales doc)
  • oracle → Oracle Systems deal, not the company
将速记转化为准确理解:
用户:“让todd做oracle的PSR”
              ↓ Claude解码
“请财务主管Todd Martinez为Oracle Systems交易(230万美元,第二季度收尾)准备销售管道状态报告”
没有内存的话,这个请求毫无意义。有了内存,Claude知道:
  • todd → Todd Martinez,财务主管,偏好使用Slack
  • PSR → 销售管道状态报告(每周销售文档)
  • oracle → Oracle Systems交易,而非甲骨文公司

Architecture

架构

CLAUDE.md          ← Hot cache (~30 people, common terms)
memory/
  index.md         ← Catálogo centralizado por categoria (auto-updated)
  log.md           ← Registro cronológico de operações (append-only)
  glossary.md      ← Full decoder ring (everything)
  people/          ← Complete profiles
  projects/        ← Project details
  context/         ← Company, teams, tools
  trends/          ← Weekly metric snapshots (JSON)
CLAUDE.md (Hot Cache):
  • Top ~30 people you interact with most
  • ~30 most common acronyms/terms
  • Active projects (5-15)
  • Your preferences
  • Goal: Cover 90% of daily decoding needs
memory/glossary.md (Full Glossary):
  • Complete decoder ring - everyone, every term
  • Searched when something isn't in CLAUDE.md
  • Can grow indefinitely
memory/people/, projects/, context/:
  • Rich detail when needed for execution
  • Full profiles, history, context
CLAUDE.md          ← 热缓存(约30人、常用术语)
memory/
  index.md         ← 按类别集中的目录(自动更新)
  log.md           ← 操作的时间顺序记录(仅追加)
  glossary.md      ← 完整解码手册(所有内容)
  people/          ← 完整人员档案
  projects/        ← 项目详情
  context/         ← 公司、团队、工具信息
  trends/          ← 每周指标快照(JSON格式)
CLAUDE.md(热缓存):
  • 你最常互动的约30人
  • 约30个最常用的缩写/术语
  • 活跃项目(5-15个)
  • 你的偏好设置
  • 目标:覆盖90%的日常解码需求
memory/glossary.md(完整术语表):
  • 完整解码手册——包含所有人、所有术语
  • 当CLAUDE.md中找不到内容时进行搜索
  • 可无限扩展
memory/people/、projects/、context/:
  • 执行任务所需的详细信息
  • 完整档案、历史记录、上下文信息

Lookup Flow

查询流程

User: "ask todd about the PSR for phoenix"

1. Check CLAUDE.md (hot cache)
   → Todd? ✓ Todd Martinez, Finance
   → PSR? ✓ Pipeline Status Report
   → Phoenix? ✓ DB migration project

2. If not found → search memory/glossary.md
   → Full glossary has everyone/everything

3. If still not found → ask user
   → "What does X mean? I'll remember it."
This tiered approach keeps CLAUDE.md lean (~100 lines) while supporting unlimited scale in memory/.
用户:“询问todd关于phoenix的PSR情况”

1. 检查CLAUDE.md(热缓存)
   → Todd?✓ Todd Martinez,财务人员
   → PSR?✓ 销售管道状态报告
   → Phoenix?✓ 数据库迁移项目

2. 如果未找到 → 搜索memory/glossary.md
   → 完整术语表包含所有人/所有内容

3. 如果仍未找到 → 询问用户
   → “X是什么意思?我会记住它。”
这种分层方法让CLAUDE.md保持精简(约100行),同时memory/目录支持无限扩展。

File Locations

文件位置

  • Working memory:
    CLAUDE.md
    in current working directory
  • Deep memory:
    memory/
    subdirectory
  • 工作内存: 当前工作目录下的
    CLAUDE.md
  • 深度内存:
    memory/
    子目录

Working Memory Format (CLAUDE.md)

工作内存格式(CLAUDE.md)

Use tables for compactness. Target ~50-80 lines total.
markdown
undefined
使用表格实现紧凑排版,目标总篇幅约50-80行。
markdown
undefined

Memory

Memory

Me

关于我

[Name], [Role] on [Team]. [One sentence about what I do.]
[姓名],[团队]的[职位]。[一句话描述我的工作内容。]

People

人员

WhoRole
ToddTodd Martinez, Finance lead
SarahSarah Chen, Engineering (Platform)
GregGreg Wilson, Sales
→ Full list: memory/glossary.md, profiles: memory/people/
简称职位
ToddTodd Martinez,财务主管
SarahSarah Chen,平台部工程师
GregGreg Wilson,销售
→ 完整列表:memory/glossary.md,详细档案:memory/people/

Terms

术语

TermMeaning
PSRPipeline Status Report
P0Drop everything priority
standupDaily 9am sync
→ Full glossary: memory/glossary.md
术语含义
PSR销售管道状态报告
P0最高优先级(放下所有工作优先处理)
standup每日9点同步会议
→ 完整术语表:memory/glossary.md

Projects

项目

NameWhat
PhoenixDB migration, Q2 launch
HorizonMobile app redesign
→ Details: memory/projects/
名称内容
Phoenix数据库迁移,第二季度上线
Horizon移动端应用重设计
→ 详细信息:memory/projects/

Preferences

偏好设置

  • 25-min meetings with buffers
  • Async-first, Slack over email
  • No meetings Friday afternoons
undefined
  • 25分钟会议,预留缓冲时间
  • 优先异步沟通,偏好Slack而非邮件
  • 周五下午不安排会议
undefined

Deep Memory Format (memory/)

深度内存格式(memory/)

memory/glossary.md - The decoder ring:
markdown
undefined
memory/glossary.md - 解码手册:
markdown
undefined

Glossary

术语表

Workplace shorthand, acronyms, and internal language.
职场速记、缩写和内部用语。

Acronyms

缩写

TermMeaningContext
PSRPipeline Status ReportWeekly sales doc
OKRObjectives & Key ResultsQuarterly planning
P0/P1/P2Priority levelsP0 = drop everything
术语含义上下文
PSR销售管道状态报告每周销售文档
OKR目标与关键成果季度规划
P0/P1/P2优先级等级P0 = 放下所有工作优先处理

Internal Terms

内部术语

TermMeaning
standupDaily 9am sync in #engineering
the migrationProject Phoenix database work
ship itDeploy to production
escalateLoop in leadership
术语含义
standup每日9点在#engineering频道同步
迁移项目Phoenix数据库迁移项目
发布部署到生产环境
升级处理通知领导层介入

Nicknames → Full Names

昵称 → 全名

NicknamePerson
ToddTodd Martinez (Finance)
TAlso Todd Martinez
昵称人员
ToddTodd Martinez(财务)
T同样指Todd Martinez

Project Codenames

项目代号

CodenameProject
PhoenixDatabase migration
HorizonNew mobile app

**memory/people/{name}.md:**
```markdown
代号项目
Phoenix数据库迁移
Horizon新移动端应用

**memory/people/{name}.md:**
```markdown

Todd Martinez

Todd Martinez

Also known as: Todd, T Role: Finance Lead Team: Finance Reports to: CFO (Michael Chen)
别名: Todd、T 职位: 财务主管 团队: 财务部 汇报对象: CFO(Michael Chen)

Communication

沟通偏好

  • Prefers Slack DM
  • Quick responses, very direct
  • Best time: mornings
  • 偏好Slack私信
  • 回复迅速,风格直接
  • 最佳沟通时间:上午

Context

背景信息

  • Handles all PSRs and financial reporting
  • Key contact for deal approvals over $500k
  • Works closely with Sales on forecasting
  • 负责所有销售管道状态报告和财务报表
  • 50万美元以上交易审批的关键联系人
  • 与销售团队密切合作进行预测

Notes

备注

  • Cubs fan, likes talking baseball

**memory/projects/{name}.md:**
```markdown
  • 小熊队球迷,喜欢聊棒球

**memory/projects/{name}.md:**
```markdown

Project Phoenix

Phoenix项目

Codename: Phoenix Also called: "the migration" Status: Active, launching Q2
代号: Phoenix 别名: “迁移项目” 状态: 进行中,第二季度上线

What It Is

项目内容

Database migration from legacy Oracle to PostgreSQL.
将数据库从传统Oracle迁移至PostgreSQL。

Key People

关键人员

  • Sarah - tech lead
  • Todd - budget owner
  • Greg - stakeholder (sales impact)
  • Sarah - 技术负责人
  • Todd - 预算负责人
  • Greg - 利益相关方(影响销售)

Context

背景信息

$1.2M budget, 6-month timeline. Critical path for Horizon project.

**memory/context/company.md:**
```markdown
预算120万美元,周期6个月。是Horizon项目的关键路径。

**memory/context/company.md:**
```markdown

Company Context

公司背景

Tools & Systems

工具与系统

ToolUsed forInternal name
SlackCommunication-
AsanaEngineering tasks-
SalesforceCRM"SF" or "the CRM"
NotionDocs/wiki-
工具用途内部名称
Slack沟通-
Asana工程任务管理-
Salesforce客户关系管理"SF" 或 "CRM系统"
Notion文档/知识库-

Teams

团队

TeamWhat they doKey people
PlatformInfrastructureSarah (lead)
FinanceMoney stuffTodd (lead)
SalesRevenueGreg
团队职责关键人员
平台部基础设施Sarah(负责人)
财务部财务相关Todd(负责人)
销售部营收Greg

Processes

流程

ProcessWhat it means
Weekly syncMonday 10am all-hands
Ship reviewThursday deploy approval
undefined
流程含义
每周同步会议周一10点全员会议
发布评审周四部署审批
undefined

How to Interact

交互方式

Decoding User Input (Tiered Lookup)

用户输入解码(分层查询)

Always decode shorthand before acting on requests:
1. CLAUDE.md (hot cache)     → Check first, covers 90% of cases
2. memory/glossary.md        → Full glossary if not in hot cache
3. memory/people/, projects/ → Rich detail when needed
4. Ask user                  → Unknown term? Learn it.
Example:
User: "ask todd to do the PSR for oracle"

CLAUDE.md lookup:
  "todd" → Todd Martinez, Finance ✓
  "PSR" → Pipeline Status Report ✓
  "oracle" → (not in hot cache)

memory/glossary.md lookup:
  "oracle" → Oracle Systems deal ($2.3M) ✓

Now Claude can act with full context.
务必先解码速记再执行请求:
1. CLAUDE.md(热缓存)     → 优先检查,覆盖90%的场景
2. memory/glossary.md        → 热缓存中未找到时查询完整术语表
3. memory/people/、projects/ → 需要详细信息时查询
4. 询问用户                  → 遇到未知术语?学习并记录。
示例:
用户:“让todd做oracle的PSR”

CLAUDE.md查询:
  "todd" → Todd Martinez,财务人员 ✓
  "PSR" → 销售管道状态报告 ✓
  "oracle" → (热缓存中未找到)

memory/glossary.md查询:
  "oracle" → Oracle Systems交易(230万美元) ✓

现在Claude可以在完整上下文下执行任务。

Adding Memory

添加内存

When user says "remember this" or "X means Y":
  1. Glossary items (acronyms, terms, shorthand):
    • Add to memory/glossary.md
    • If frequently used, add to CLAUDE.md Quick Glossary
  2. People:
    • Create/update memory/people/{name}.md
    • Add to CLAUDE.md Key People if important
    • Capture nicknames - critical for decoding
  3. Projects:
    • Create/update memory/projects/{name}.md
    • Add to CLAUDE.md Active Projects if current
    • Capture codenames - "Phoenix", "the migration", etc.
  4. Preferences: Add to CLAUDE.md Preferences section
当用户说“记住这个”或“X的意思是Y”时:
  1. 术语表条目(缩写、术语、速记):
    • 添加至memory/glossary.md
    • 如果频繁使用,添加至CLAUDE.md的快速术语表
  2. 人员信息:
    • 创建/更新memory/people/{name}.md
    • 如果是重要联系人,添加至CLAUDE.md的关键人员列表
    • 务必记录昵称——这对解码至关重要
  3. 项目信息:
    • 创建/更新memory/projects/{name}.md
    • 如果是当前活跃项目,添加至CLAUDE.md的活跃项目列表
    • 务必记录代号——比如“Phoenix”、“迁移项目”等
  4. 偏好设置: 添加至CLAUDE.md的偏好设置部分

Recalling Memory

调用内存

When user asks "who is X" or "what does X mean":
  1. Check CLAUDE.md first
  2. Check memory/ for full detail
  3. If not found: "I don't know what X means yet. Can you tell me?"
当用户询问“X是谁”或“X是什么意思”时:
  1. 优先检查CLAUDE.md
  2. 检查memory/目录获取详细信息
  3. 如果未找到:“我还不知道X的意思,能告诉我吗?”

Progressive Disclosure

渐进式披露

  1. Load CLAUDE.md for quick parsing of any request
  2. Dive into memory/ when you need full context for execution
  3. Example: drafting an email to todd about the PSR
    • CLAUDE.md tells you Todd = Todd Martinez, PSR = Pipeline Status Report
    • memory/people/todd-martinez.md tells you he prefers Slack, is direct
  1. 加载CLAUDE.md快速解析任何请求
  2. 需要完整上下文执行任务时再深入查询memory/目录
  3. 示例:撰写给todd的关于PSR的邮件
    • CLAUDE.md告诉你Todd = Todd Martinez,PSR = 销售管道状态报告
    • memory/people/todd-martinez.md告诉你他偏好Slack,沟通风格直接

Bootstrapping

初始化

Use
/productivity:start
to initialize by scanning your chat, calendar, email, and documents. Extracts people, projects, and starts building the glossary.
使用
/productivity:start
命令初始化,扫描你的聊天记录、日历、邮件和文档,提取人员、项目信息并开始构建术语表。

Conventions

约定

  • Bold terms in CLAUDE.md for scannability
  • Keep CLAUDE.md under ~100 lines (the "hot 30" rule)
  • Filenames: lowercase, hyphens (
    todd-martinez.md
    ,
    project-phoenix.md
    )
  • Always capture nicknames and alternate names
  • Glossary tables for easy lookup
  • When something's used frequently, promote it to CLAUDE.md
  • When something goes stale, demote it to memory/ only
  • CLAUDE.md中使用加粗格式提升术语的可扫描性
  • 保持CLAUDE.md篇幅在100行以内(“热门30条”规则)
  • 文件名:小写,使用连字符(
    todd-martinez.md
    project-phoenix.md
  • 务必记录昵称和别名
  • 使用术语表表格便于查询
  • 当某个内容频繁使用时,将其升级至CLAUDE.md
  • 当某个内容不再相关时,将其降级至仅存储于memory/目录

What Goes Where

内容分类

TypeCLAUDE.md (Hot Cache)memory/ (Full Storage)
PersonTop ~30 frequent contactsglossary.md + people/{name}.md
Acronym/term~30 most commonglossary.md (complete list)
ProjectActive projects onlyglossary.md + projects/{name}.md
NicknameIn Key People if top 30glossary.md (all nicknames)
Company contextQuick reference onlycontext/company.md
PreferencesAll preferences-
Historical/stale✗ Remove✓ Keep in memory/
类型CLAUDE.md(热缓存)memory/(完整存储)
人员约30位高频联系人glossary.md + people/{name}.md
缩写/术语约30个最常用术语glossary.md(完整列表)
项目仅活跃项目glossary.md + projects/{name}.md
昵称若属于前30位高频联系人则包含glossary.md(所有昵称)
公司背景仅快速参考信息context/company.md
偏好设置所有偏好-
历史/过期内容✗ 移除✓ 保留在memory/中

Promotion / Demotion

升级/降级规则

Promote to CLAUDE.md when:
  • You use a term/person frequently
  • It's part of active work
Demote to memory/ only when:
  • Project completed
  • Person no longer frequent contact
  • Term rarely used
This keeps CLAUDE.md fresh and relevant.
升级至CLAUDE.md的情况:
  • 频繁使用某个术语/联系人
  • 属于当前活跃工作内容
降级至仅memory/存储的情况:
  • 项目已完成
  • 不再是高频联系人
  • 术语很少使用
这样能保持CLAUDE.md的时效性和相关性。

Operations (LLM Wiki Pattern)

运维(LLM维基模式)

Three core operations maintain the knowledge base:
维护知识库的三个核心操作:

Ingest (via memory-sync, daily 21:15)

摄入(通过memory-sync,每日21:15执行)

When new information arrives, it's not just saved — it's propagated:
  • New info about a person → update their people/ file AND any projects/ that mention them
  • New project detail → update glossary.md codename entry + CLAUDE.md if active
  • Role change → update people/, glossary.md, and CLAUDE.md hot cache
  • After any change → update index.md catalog + append to log.md
当有新信息进入时,不仅会保存——还会同步更新
  • 人员的新信息 → 更新其people/文件以及所有提及该人员的projects/文件
  • 项目的新细节 → 更新glossary.md中的代号条目,如果是活跃项目则同步更新CLAUDE.md
  • 职位变动 → 更新people/、glossary.md和CLAUDE.md热缓存
  • 任何变更后 → 更新index.md目录并追加至log.md

Query (during conversations)

查询(对话过程中)

When synthesizing a complex answer, the valuable result can be filed back as a new memory entry — knowledge compounds through use, not just accumulation.
当生成复杂回答时,有价值的结果可以作为新的内存条目归档——知识通过使用而非单纯积累来增长。

Lint (via memory-lint, weekly Sunday 09:00)

检查(通过memory-lint,每周日09:00执行)

Periodic health check that detects:
  • Contradictions — mismatches between CLAUDE.md hot cache and memory/ deep storage
  • Stale claims — dates older than 60 days, closed Linear issues still listed as open
  • Orphan files — files in memory/ not listed in index.md
  • Coverage gaps — active projects/people in CLAUDE.md without memory/ files
  • Missing cross-references — people in projects without people/ files, and vice versa
Fixes what it can automatically, flags the rest for manual review.
定期健康检查,检测:
  • 矛盾内容 —— CLAUDE.md热缓存与memory/深度存储之间的不一致
  • 过期内容 —— 超过60天的日期、已关闭的Linear问题仍标记为开放
  • 孤立文件 —— memory/目录中未在index.md列出的文件
  • 覆盖缺口 —— CLAUDE.md中的活跃项目/人员在memory/中无对应文件
  • 缺失交叉引用 —— 项目中提及的人员无对应的people/文件,反之亦然
自动修复可处理的问题,其余标记为需要人工审核。