Skip to main content
Glama
miles990

claude-dev-memory

by miles990

Claude Dev Memory

讓 Claude Code 具備跨 session 的長期記憶能力

痛點

Session 1                    Session 2
┌─────────────────┐          ┌─────────────────┐
│ 學到了解法 A     │   /clear  │ 這問題怎麼解?   │ ← 學習消失
│ 決定用架構 B     │  ───────>  │ 要用什麼架構?   │ ← 決策遺失
│ 專案進度 70%    │          │ 做到哪了?       │ ← 進度歸零
└─────────────────┘          └─────────────────┘

Claude Code 的限制:

  • 每次 /clear 或新 session 就完全失憶

  • 過去的學習和決策無法累積

  • 沒有工具可以主動保存重要資訊

Related MCP server: Claude Persistent Memory

解決方案

這個 MCP Server 提供 5 個工具,讓 Claude 可以主動讀寫長期記憶:

工具

用途

memory_status

查看記憶系統狀態

memory_recall

讀取 Core Memory

memory_update

更新 Core Memory

memory_archive

存入 Archival Memory(完整文件)

memory_search

語意搜尋歷史記錄

記憶架構

┌─────────────────────────────────────────────────────────────────┐
│                       Core Memory                                │
│                  (小而重要,~2000 tokens)                         │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐                │
│  │   project   │ │  learnings  │ │  decisions  │                │
│  │  專案概述    │ │  學習紀錄    │ │  架構決策    │                │
│  └─────────────┘ └─────────────┘ └─────────────┘                │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                     Archival Memory                              │
│                  (大而完整,無限制)                               │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐               │
│  │  specs  │ │ commits │ │learnings│ │decisions│               │
│  │完整規格  │ │提交記錄  │ │詳細筆記  │ │完整文檔  │               │
│  └─────────┘ └─────────┘ └─────────┘ └─────────┘               │
└─────────────────────────────────────────────────────────────────┘

設計理念:

  • Core Memory:摘要性質,每次對話都載入,讓 Claude 快速了解專案

  • Archival Memory:完整內容,需要時搜尋取用,保留所有細節

與 claude-memory-hook 的關係

這兩個工具是互補的:

工具

類型

職責

claude-memory-hook

Hook

啟動時顯示狀態(被動)

claude-dev-memory

MCP Server

提供讀寫記憶工具(主動)

┌─────────────────────────────────────────────────────────────────┐
│  claude-memory-hook                                              │
│  → Session 開始時自動執行                                        │
│  → 顯示 Git、規格進度、Letta 記憶摘要、提醒                       │
├─────────────────────────────────────────────────────────────────┤
│  claude-dev-memory(本專案)                                     │
│  → 提供 MCP 工具讓 Claude 主動讀寫記憶                           │
│  → memory_recall / memory_update / memory_archive / memory_search│
└─────────────────────────────────────────────────────────────────┘

安裝

npm install -g claude-dev-memory

或使用 npx(無需安裝):

npx claude-dev-memory

配置

1. 取得 Letta API Key

  1. 前往 Letta Cloud

  2. 註冊帳號並取得 API Key

  3. 建立 Agent 並記下 Agent ID

2. 配置 Claude Code

claude mcp add claude-dev-memory -s user -- npx claude-dev-memory

設定環境變數:

# 在 shell profile 或專案 .env 中
export LETTA_API_KEY=sk-let-xxxxx
export LETTA_AGENT_ID=agent-xxxxx

或使用 JSON 配置(~/.claude.json):

{
  "mcpServers": {
    "claude-dev-memory": {
      "command": "npx",
      "args": ["claude-dev-memory"],
      "env": {
        "LETTA_API_KEY": "your-api-key",
        "LETTA_AGENT_ID": "agent-xxxxx"
      }
    }
  }
}

工具詳細說明

memory_status

查看記憶系統狀態。

回傳:連線狀態、Core Memory 使用量、Archival 記錄數

memory_recall

讀取 Core Memory,恢復專案上下文。

參數

類型

說明

block

string

allprojectlearningsdecisions

memory_update

更新 Core Memory,記錄專案進度和決策。

參數

類型

說明

block

string

projectlearningsdecisions

content

string

完整替換內容

append

string

附加內容(二選一)

auto_summarize

boolean

超過限制時自動摘要(預設 false)

memory_archive

存入 Archival Memory,保存完整文檔。

參數

類型

說明

content

string

要存檔的內容

type

string

speccommitlearningdecision

tags

string[]

標籤陣列(方便搜尋)

搜尋 Archival Memory,找出相關記錄。

參數

類型

說明

query

string

搜尋關鍵字

filter

string

allspeccommitlearningdecision

limit

number

回傳筆數上限(預設 5)

min_relevance

number

最低相關度 0-1(預設 0.7)

MCP Resource

letta://memory/core

被動讀取 Core Memory 內容,回傳 JSON 格式的完整記憶資料。

使用情境

Session 開始時恢復上下文

Claude 使用 memory_recall 讀取 project 區塊
→ 立即了解專案背景,無需重新解釋

完成重要決策後記錄

Claude 使用 memory_update 更新 decisions 區塊
→ 下次 session 仍記得這個決策

保存完整 spec 文檔

Claude 使用 memory_archive,type 設為 spec
→ 完整內容存入 Archival,可語意搜尋

遇到類似問題時搜尋

Claude 使用 memory_search 搜尋相關記錄
→ 找出過去的解法,避免重複踩坑

與官方 letta-mcp 的差異

面向

官方 letta-mcp

claude-dev-memory

目標用戶

通用 AI 應用

Claude Code 開發者

Memory 結構

單一 human block

project / learnings / decisions

Agent 策略

自動建立 per user

指定現有 Agent

額外功能

-

Token 計算、狀態檢查、類型標籤

環境變數

變數

說明

預設值

LETTA_API_KEY

Letta Cloud API Key

(必填)

LETTA_AGENT_ID

指定使用的 Agent ID

(選填)

LETTA_BASE_URL

Letta API URL

https://api.letta.com

專案配置

可在專案目錄建立 .claude/letta.json 覆蓋全域設定:

{
  "agent_id": "agent-xxx"
}

開發

git clone https://github.com/miles990/claude-dev-memory.git
cd claude-dev-memory

npm install     # 安裝依賴
npm run build   # 編譯
npm test        # 測試
npm run dev     # 開發模式

相關專案

License

MIT

Available Tools

5 tools
memory_archiveA

存入 Archival Memory,保存完整 spec、commit、學習紀錄。 特性:無大小限制、可語意搜尋。

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNo標籤(方便搜尋)
typeYes內容類型
contentYes要存檔的內容

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of disclosing behavioral traits. It adds two useful features: unlimited size and semantic search capability, which give some context. However, it does not mention side effects, durability, return values, or permission requirements, leaving gaps for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the action, and every word contributes value. It is concise and well-structured, lacking any redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple storage tool with 3 parameters and no output schema, the description covers the core purpose and features. However, it lacks explicit usage guidance and any behavioral details like success feedback or side effects, making it minimally adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema provides full descriptions for all three parameters, so baseline is 3. The description adds minimal extra meaning by aligning with the enum types (spec, commit, learning), but it does not explain parameter syntax or provide additional semantics beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: storing content into Archival Memory. It specifies the types of content (spec, commit, learning records) and highlights distinctive features (no size limit, semantic search), making it easily distinguishable from sibling tools like recall, update, search, and status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for archiving content by listing the content types, but it does not explicitly state when to use this tool versus alternatives or when not to use it. There is no mention of sibling tools or any exclusions, so guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_recallA

讀取專案的 Core Memory,取得專案上下文、學習紀錄、決策。 用於:session 開始時恢復上下文,或隨時查看記憶內容。

ParametersJSON Schema
NameRequiredDescriptionDefault
blockNo要讀取的記憶區塊all

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the transparency burden. It uses '讀取' (read) to signal a read-only operation, but does not describe output format, default behavior for the 'all' block, or any potential side effects. It is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences: the first states the function, the second states usage. No redundant words or repetition of the schema. The description is front-loaded with the primary purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one optional parameter and no output schema, the description adequately covers what it does and when to use it. It lacks detail on return format, but that is not critical for such a simple recall operation. The schema covers the 'block' parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already covers the parameter with a description and enum. The tool description enriches this by mapping the enum values (project, learnings, decisions) to the listed content types, giving semantic meaning beyond the schema's terse label.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it reads the project's Core Memory to obtain context, learnings, and decisions, and specifies the two use cases (session start and anytime viewing). This verb+resource pair is specific and distinguishes it from siblings like memory_search (which searches) and memory_status (which shows status).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit usage context ('session start to restore context, or anytime to view memory content'), but does not mention when to use alternatives like memory_search instead. No exclusions are given, but the intended use cases are clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_statusA

查看記憶系統狀態,首次使用時自動初始化 Agent。 顯示:連線狀態、Core Memory 使用量、Archival 記錄數。

ParametersJSON Schema
NameRequiredDescriptionDefault
initNo強制重新初始化(謹慎使用)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It transparently mentions the automatic initialization on first use, which is a side effect, and lists the output fields. However, it omits the behavior of the 'init' parameter (force reinitialization) and its potential consequences, only the schema warns 'use with caution'. This gap leaves some behavioral ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary purpose, followed by a concise list of displayed items. There is no redundant or extraneous information; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional parameter and no output schema, the description covers the core aspects: purpose, side effect (auto-initialization), and displayed content. It does not mention the 'init' parameter, but the schema describes it, and the description is otherwise complete. Minor gaps exist around when reinitialization is needed, but overall adequately complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning the only parameter 'init' is fully described with '強制重新初始化(謹慎使用)'. The tool description adds no additional meaning about parameters, so a baseline score of 3 is appropriate since the schema already handles parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb '查看' (view) and resource '記憶系統狀態' (memory system status), and enumerates the displayed items (connection status, Core Memory usage, Archival record count). This distinguishes it from sibling tools like memory_recall, memory_update, memory_archive, and memory_search, which focus on different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it is for viewing memory system status and mentions automatic initialization on first use. It implies when to use the tool, but does not explicitly state when not to use it or mention alternatives (siblings). No exclusions are given, but the context is sufficient for basic usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_updateA

更新 Core Memory,記錄專案進度和決策。 注意:Core Memory 有 ~2000 token 限制,超過時建議使用 memory_archive。

ParametersJSON Schema
NameRequiredDescriptionDefault
blockYes要更新的記憶區塊
appendNo附加內容(加到現有內容後)
contentNo新內容(完整替換)
auto_summarizeNo超過限制時自動摘要(預設 false)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

由於未提供 annotations,描述承擔行為揭露的責任。它新增了 token 限制與 overflow 時改用 archive 的行為提示,這些是 schema 未提供的。但未說明 append 與 content 的實際更新行為(附加或覆寫)、auto_summarize 的具體效果,或更新的權限與後果,行為揭露仍有明顯缺口。

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

兩句話即達成目的:第一句點出工具用途,第二句提供關鍵限制與替代工具建議。資訊密度高,無冗詞,結構精簡且前置重要資訊。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

工具操作相對簡單,搭配 100% 的 schema 參數說明已足夠使用。描述的 token 限制警告補充了重要的操作情境,並引導至 archive。但缺少輸出格式說明,也未描述更新後的驗證方式,因此略有不足。

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema 參數描述覆蓋率為 100%,每個參數都有明確說明,描述本身未增加額外的參數語意。僅有 token 限制的警告間接關聯 auto_summarize,但未直接解釋參數用法,因此依基線給 3 分。

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

描述明確使用動詞「更新」搭配資源「Core Memory」,並指出記錄專案進度和決策的用途。與 siblings 的讀取、搜尋、狀態、封存操作有清楚區隔,且特別提及 memory_archive 作為 overflow 的替代,進一步強化目的區分。

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

描述明確指出當 Core Memory 超過 ~2000 token 限制時建議改用 memory_archive,提供了具體的使用條件與替代工具。但未說明與 memory_recall、memory_search、memory_status 的使用時機,僅依賴工具名稱本身來暗示更新的用途。

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv1.0.0
    • First observedmemory_archive
    • First observedmemory_recall
    • First observedmemory_search
    • First observedmemory_status
    • First observedmemory_update

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct memory operation: recall reads core memory, update writes core memory, archive moves to archival, search queries archival, and status inspects the system. The distinction between recall and search is clear from their descriptions, avoiding ambiguity.

Naming Consistency5/5

All tools follow the consistent pattern of 'memory_' prefix followed by a lowercase verb (recall, update, archive, search, status). This predictable naming makes it easy to infer the function of each tool.

Tool Count5/5

With 5 tools, the set is well-scoped for a memory management system, covering read, write, archival, search, and status without unnecessary redundancy.

Completeness5/5

The tool surface covers the full lifecycle of a memory system: accessing core memory, updating it, archiving to long-term storage, searching that storage, and monitoring system state. This is a complete set for the stated purpose, with no obvious gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides persistent cross-session memory for Claude Code, enabling it to remember user preferences, decisions, and project context across new sessions.
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides long-term memory and lossless context management for Claude Code, enabling automatic context compression, cross-session memory sharing, and semantic search across all history.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miles990/claude-dev-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server