recall

io.github.fainir由 GitHub 帳號 fainir 發布v0.3.0更新於 Nov 1, 2026

Read and write Claude Code auto memory from Codex, Cursor or any MCP client. Zero dependencies.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

把 Claude Code 依專案保存的 Markdown 記憶共享給其他 MCP 代理,讓助理可以列出、讀取、沿連結擴充、寫入與刪除這些記憶。

可以做什麼
  • 列出並篩選已儲存的記憶,含類型與一行描述
  • 完整讀取單一記憶,名稱比對較寬鬆
  • 依名稱召回記憶並沿 wiki 連結擴充,依 token 預算裁剪
  • 列出已到複核期限、不宜直接依賴的記憶
  • 儲存或取代記憶並更新索引,或刪除過時記憶
適用情境
適合在 Claude Code 與 Codex、Cursor、Cline、Gemini CLI 等其他代理之間切換時,希望沿用同一份專案記憶;也適合想要一個以純檔案保存、助理可讀可寫的長期記憶。
執行需求
透過 npx 以 stdio 在本機執行 npm 套件,需要 Node.js 18 以上版本。需指定儲存庫路徑(Claude Code 模式)或其他記憶目錄。設定 RECALL_READ_ONLY=1 或唯讀參數可限制為唯讀。不需帳號或 API 金鑰。
安裝前請注意
把 Claude Code 的記憶提供給其他代理,會將這些記憶傳送給該代理的模型供應商,建議使用唯讀模式並只指向願意分享的專案。寫入與刪除會變更磁碟檔案,且後寫覆蓋先寫,與執行中的 Claude Code 工作階段之間沒有鎖定。金鑰遮蔽只涵蓋已知格式,並非保證,允許金鑰的選項會將其關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 recall,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

recall

[CI] [License: MIT] [npm] [fainir/recall MCP server] [Mentioned in Awesome MCP Servers]

Your Claude Code memory, in every agent. recall reads and writes the memory Claude Code keeps for each project, so Codex, Cursor or an agent you build yourself can use the same memories, over MCP or from code. Zero dependencies, no vectors, no database: the memories stay plain Markdown files.

Claude Code now remembers things on its own: your corrections, how you like to work, project decisions, where things live. It saves them as Markdown files with [[wiki-links]] under ~/.claude/projects/<project>/memory/. That is a good format, but only Claude Code reads it. Switch to another agent and it starts from zero.

recall makes that memory portable. It finds the same directory Claude Code uses (same rules, down to its folder-naming hash), reads every file Claude Code writes, and writes files Claude Code reads back.

[Codex calling recall: memory_list shows three memories Claude Code wrote, then memory_recall returns feedback_testing and follows its [[reference_ci]] link on its own, in 180 tokens.]

Quick start: share it over MCP

Point any MCP client at recall and the project's repository. --read-only lets the other agent read what Claude Code remembers without changing it; leave it off to let both write.

Codex

bash
codex mcp add recall -- npx -y @fainir/recall --claude-code /path/to/your/repo --read-only

Cursor (.cursor/mcp.json in the project, or ~/.cursor/mcp.json)

json
{  "mcpServers": {    "recall": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@fainir/recall", "--claude-code", "/path/to/your/repo", "--read-only"]    }  }}

Cline: in the MCP Servers panel choose Configure, and add the same recall entry as for Cursor to cline_mcp_settings.json. Or ask Cline to "set up the MCP server from https://github.com/fainir/recall": in a test on 2026-11-01 it read this README, added the entry, started the server and listed its tools.

Gemini CLI: gemini extensions install https://github.com/fainir/recall (it serves the memory of the folder you start Gemini in).

Any other MCP client: run npx -y @fainir/recall with the same arguments as a stdio server. Needs Node.js 18+.

The agent then has these tools. Here is a real run against a repository with three memories Claude Code wrote:

text
> memory_list3 memories in /Users/you/.claude/projects/-Users-you-code-acme-api/memory:- feedback_testing (feedback) - run the integration suite before saying a change works- reference_ci (reference) - where CI runs and how to rerun a flaky job- user_role (user) - backend lead, prefers short answers with the command to run
> memory_recall {"requires": ["feedback_testing"]}## feedback_testing (feedback) - run the integration suite before saying a change worksRun `npm run test:int` (needs the local Postgres from docker compose), not just `npm test`.**Why:** the unit tests mock the database; two "done" changes broke prod queries.**How to apply:** any change under src/db/ or src/queries/. CI details in [[reference_ci]].
## reference_ci (reference) - where CI runs and how to rerun a flaky jobCI is GitHub Actions, workflow `ci.yml`. Rerun a flaky job with `gh run rerun --failed`.
tokens_used: 180

memory_recall followed the [[reference_ci]] link on its own. In testing, a Codex agent given only this server answered a question by calling memory_list and then memory_get.

ToolWhat it does
memory_listEvery memory with its type and one-line description. Optional type filter.
memory_getOne memory in full. feedback-testing and feedback_testing both work.
memory_recallThe named memories plus the ones they [[link]] to, trimmed to a token budget. Unknown names come back as missing.
memory_dueMemories old enough to re-confirm before relying on them.
memory_writeSave or replace a memory in Claude Code's format, and add it to the MEMORY.md index. Not offered with --read-only.
memory_deleteDelete a memory and its index line. Not offered with --read-only.

recall-mcp options: --claude-code [repo] (the default, using the current directory), --dir <dir> for any other memory directory (add --format claude-code to write Claude Code's file format there), --read-only, and --allow-secrets. RECALL_DIR, RECALL_READ_ONLY=1 and RECALL_ALLOW_SECRETS=1 work as environment variables.

Use it from code

bash
npm install @fainir/recall
js
import { Recall } from '@fainir/recall';
const memory = Recall.forClaudeCode('/Users/you/code/acme-api');console.log(memory.dir);
for (const m of await memory.list()) console.log(m.name, '|', m.type, '|', m.description);
const slice = await memory.recall({ requires: ['feedback-testing'] });console.log(slice.memories.map(m => m.name), slice.tokens_used);
// Save something Claude Code will see in its next session.await memory.write({  name: 'project_freeze',  type: 'project',  description: 'merge freeze until the 3rd for the mobile release',  body: 'No merges to main until Nov 3. **Why:** mobile release cut.',});

Output (before the write):

text
/Users/you/.claude/projects/-Users-you-code-acme-api/memoryfeedback_testing | feedback | run the integration suite before saying a change worksreference_ci | reference | where CI runs and how to rerun a flaky jobuser_role | user | backend lead, prefers short answers with the command to run[ 'feedback_testing', 'reference_ci' ] 180

write() produces the file Claude Code itself writes:

markdown
---name: project_freezedescription: merge freeze until the 3rd for the mobile releasemetadata:  node_type: memory  type: project  modified: 2026-10-27T17:51:14.486Z---
No merges to main until Nov 3. **Why:** mobile release cut.

and adds a line to MEMORY.md, the index Claude Code loads at the start of every session, leaving the existing lines alone:

markdown
- [Testing](feedback_testing.md) - run the integration suite before saying a change works- [CI](reference_ci.md) - where CI runs and how to rerun a flaky job- [Role](user_role.md) - backend lead, prefers short answers- [project_freeze](project_freeze.md) - merge freeze until the 3rd for the mobile release

Rewriting an existing memory keeps the fields recall does not own, such as Claude Code's originSessionId.

Where Claude Code keeps the memory

claudeCodeMemoryDir(repo) returns the directory, using Claude Code's rules:

  • The project is the git repository root, so subfolders share one memory, and a worktree uses the memory of its main checkout. Outside git, it is the folder itself.
  • The folder name is the project path with every character other than a-z, A-Z and 0-9 turned into -. Paths longer than 200 characters are cut and given the same hash suffix Claude Code adds.
  • CLAUDE_CONFIG_DIR replaces ~/.claude. CLAUDE_CODE_PROJECT_DIR_NAME (next to CLAUDE_CONFIG_DIR) names the folder. An autoMemoryDirectory setting in the project's .claude/settings.local.json or your ~/.claude/settings.json wins over both.

This was checked against a real ~/.claude/projects folder: the rule reproduced 40 of 41 project folder names, including all three long, hashed ones (the other one belonged to a session that was moved after it started). recall listed and parsed all 194 memory files in it.

API

The package exports the Recall class and claudeCodeMemoryDir(). Every method is async.

CallArgumentsReturns
Recall.forClaudeCode(repo)path inside a project; default the current directorya Recall on Claude Code's memory directory, in claude-code format
new Recall({ dir, format })dir: memory directory. format: recall (default) or claude-codea Recall instance
write({ name, type, description, decay_class, body, extra })name: slug (required). type: user | feedback | project | reference (required). description: one line, default ''. decay_class: permanent | slow | fast | ephemeral, default slow. body: Markdown, default ''. extra: more frontmatter fields{ name, type, decay_class, updated_at }. Creates or replaces <dir>/<name>.md; in claude-code format also updates MEMORY.md
get(name)a memory name; - and _ are interchangeable, and a frontmatter name also matchesa Memory, or null
list({ type })optional type filterMemory[], sorted by name
recall({ requires, link_depth, budget_tokens })requires: names. link_depth: [[link]] hops to follow, default 1. budget_tokens: default 2000{ memories: Memory[], tokens_used, missing: string[], dropped: string[] }
dueForReview(asOf)Date or date string, default nowMemory[] past their review window, each with age_days
delete(name)exact memory nametrue if a file was removed, false if it did not exist
claudeCodeMemoryDir(repo)path inside a projectthe directory path (it may not exist yet)

A Memory is { name, type, description, updated_at, frontmatter, body, links }. type and updated_at come from the flat fields or from Claude Code's metadata: block, whichever the file has. links lists the memory names the body links to, deduplicated and in order.

write, get and delete throw on an unsafe name; write also throws on an invalid type or decay_class, a non-string body or description, or a reserved extra key. recall never throws on unknown names; it lists them in missing.

Memory file format

One file per memory, <name>.md, with frontmatter and a Markdown body. recall reads both shapes, whichever format you pick for writing.

Claude Code's format (format: 'claude-code'; older Claude Code files have a flat type: instead of metadata:, and recall reads those too):

markdown
---name: feedback_testingdescription: run the integration suite before saying a change worksmetadata:  node_type: memory  type: feedback  modified: 2026-10-20T09:12:44.120Z---
Run `npm run test:int` first. CI details in [[reference_ci]].

recall's own format (format: 'recall', the default, which earlier versions wrote):

markdown
---name: top-customerstype: projectdescription: paying customers above $10K ACVdecay_class: slowupdated_at: 2026-05-25---- Northwind - $48K ACV (see [[northwind-account]])
  • Names: a-z, 0-9, - and _, starting with a letter or digit, up to 128 characters. That keeps file names safe on every OS.
  • Links: [[name]], [[name|label]] and [[name#heading]] all point at name. They are case-insensitive, - and _ match each other, and links inside code are ignored.
  • Frontmatter is a small YAML subset: key: value lines, quoted strings, # comments, and one level of nesting (Claude Code's metadata: block).
  • Other files (MEMORY.md, README.md, My Notes.md, folders) are not memories and are skipped.

How recall() picks the slice

  1. Every name in requires. No embeddings, no fuzzy search.
  2. Every memory reachable through [[wiki-links]] from those, breadth-first, up to link_depth hops.
  3. If the total is over budget_tokens (estimated as characters / 4), memories are dropped until it fits: the deepest links first, so the required memories go last; at the same depth, ephemeral first, then fast, slow, permanent. Their names come back in dropped, and the rest keep their walk order.

For an agent that knows what it needs, explicit keys beat similarity search: asking for "voice" should return the voice memory, not four memories that mention the word.

Decay

decay_class says how often a memory should be re-confirmed. dueForReview() returns the ones whose last update (Claude Code's modified, or recall's updated_at) is older than their window. Nothing is deleted automatically.

decay_classDue for review after
permanent730 days
slow (default)90 days
fast30 days
ephemeral7 days

Limitations

  • Privacy: serving Claude Code's memory to another agent sends those memories to that agent's model provider. Use --read-only and point it only at projects you are happy to share.
  • Secrets: a memory can capture a credential from a debugging session. Before a memory leaves the server, recall replaces recognisable secrets with [redacted]: passwords in connection URLs, bearer tokens, private key blocks, and Anthropic, OpenAI, GitHub, Slack, AWS, Google and Stripe keys, plus JWTs, and says how many it hid. The files on disk are not changed. --allow-secrets turns this off. It is a safety net for known formats, not a guarantee: keep secrets out of memories.
  • Claude Code reads MEMORY.md at the start of a session, so a memory another agent writes shows up in Claude Code's next session, not the current one. Claude Code loads only the first 200 lines (or 25 KB) of that index.
  • Writes are atomic (temp file + rename), but the last writer wins. There is no locking between recall and a running Claude Code session.
  • Auto memory is per machine. recall does not sync it anywhere.
  • The token count is an estimate (characters / 4), not a tokenizer.

Development

No dependencies, so there is nothing to install:

bash
git clone https://github.com/fainir/recall.gitcd recallnpm test                 # node:test, no networknode examples/basic.js   # the library on a plain recall directory

License

MIT


More open source by Nir Feinstein

  • agent-harness - make Claude Code or Codex act as a product team, a CEO or a portfolio manager
  • frugal - your agent finds the cheaper honest way before it pays for anything
  • flipback - an automatic /goal for every turn: sends Claude Code back when it stops early
  • most-capable-agent-system-prompt - the copy-paste prompt for a self-improving agent system
  • All projects

來源:README.md,提交 af62c9e

工具

6

memory_list

List every saved memory with its type and one-line description. Start here to see what is known.

輸入參數type

memory_get

Read one memory in full. Names match file names; "-" and "_" are interchangeable.

輸入參數name必填

memory_recall

Read the named memories plus the memories they link to with [[wiki-links]], trimmed to a token budget. Unknown names are reported as missing instead of failing.

輸入參數requires必填link_depthbudget_tokens

memory_due

List memories old enough that they should be re-confirmed with the person before being relied on.

輸入參數as_of

memory_write

Save a memory, or replace the one with the same name. One fact per memory. Save only what a future session could not work out from the code or git history. Never save secrets. Link related memories in the body with [[name]]. user: who the person is and how they like to work. feedback: corrections and confirmed approaches. project: ongoing work, decisions and deadlines not in the code. reference: where to find things outside the project.

輸入參數body必填name必填type必填decay_classdescription必填

memory_delete

Delete a memory that turned out to be wrong or obsolete. Exact name only.

輸入參數name必填

版本歷史

2
  1. v0.3.0最新Nov 1, 2026
  2. v0.2.0Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分