显示 HN:完全回忆 – 为 Claude Code 编写的门控记忆
Show HN: Total Recall – write-gated memory for Claude Code

原始链接: https://github.com/davegoldblatt/total-recall

## 总回忆:为Claude Code精心策划的持久记忆 总回忆是为Claude Code设计的记忆系统,旨在避免“噪音”和幻觉,这些问题常见于保存*所有内容*的系统。与自动摄取工具不同,它使用严格的“写入门控”——仅保存能够明确改变未来行为的信息(承诺、决策、稳定事实或明确的记住请求)。 所有数据最初记录在每日日志中,需要*用户控制*才能提升到长期“寄存器”,最终进入一个简洁的工作记忆(约1500字),由Claude自动加载。这种分层系统(每日日志、寄存器、工作记忆、归档)优先考虑质量而非数量。 主要功能包括强大的纠正协议(即时更新所有层级)、透明的Markdown存储以及通过原生Claude Code机制进行确定性加载。它可以作为插件或独立程序安装,无需网络调用或外部依赖。 总回忆专注于*记住什么*,补充了像Superpowers这样专注于*如何工作*的工具。它专为本地使用而设计,优先考虑隐私和可审计性,所有数据都存储为纯文本文件。

相关文章

原文

Curated persistent memory for Claude Code. Not auto-ingest — a write gate that asks "Does this change future behavior?" before anything gets saved.

Other memory tools dump everything into context. Total Recall does the opposite: it filters aggressively, captures to a daily log first, and only promotes to long-term memory when you say so. The result is a lean, trustworthy memory that doesn't bloat your context window with noise.

As a plugin (recommended):

/plugin marketplace add davegoldblatt/recall-marketplace
/plugin install recall@recall-marketplace

Or standalone (copies files into your project's .claude/ directory):

git clone https://github.com/davegoldblatt/total-recall.git
cd total-recall
./install.sh /path/to/your/project

After installing: restart Claude Code or run /hooks to activate hooks. Claude Code snapshots hooks at startup.

Most memory systems have a capture problem — they save too much. Every observation, every intermediate thought, every transient detail gets persisted. Your context fills with stale facts and the model starts hallucinating from its own outdated notes.

Total Recall's write gate is a five-point filter:

  1. Does it change future behavior? (preference, boundary, recurring pattern)
  2. Is it a commitment with consequences? (deadline, deliverable, follow-up)
  3. Is it a decision with rationale? (why X over Y, worth preserving)
  4. Is it a stable fact that will matter again? (not transient, not obvious)
  5. Did the user explicitly say "remember this"?

If none are true, it doesn't get saved. Period.

Four tiers of memory, two loaded deterministically:

Tier What How It Loads
Working Memory CLAUDE.local.md — essential context, ~1500 words Auto-loaded by Claude Code
Registers memory/registers/*.md — structured domain knowledge On demand (searched when relevant)
Daily Logs memory/daily/YYYY-MM-DD.md — timestamped raw capture Checked on session start
Archive memory/archive/ — completed/superseded items On search

The protocol lives in .claude/rules/total-recall.md (standalone) or rules/total-recall.md (plugin) and auto-loads every session — no "please remember to follow these rules" needed.

All writes go to the daily log first. Promotion to registers is a separate, user-controlled step via /recall-promote. This prevents the model from prematurely solidifying inferences.

Corrections propagate immediately. When you correct Claude, it updates the daily log + register + working memory in one shot. The same mistake never recurs.

When installed as a plugin, commands are namespaced: /recall:recall-write. Standalone install uses /recall-write.

Command What it does
recall-init Scaffold the memory directory structure
recall-write <note> Write to daily log with gate evaluation (suggests promotion)
recall-log <note> Quick append to daily log (no gate)
recall-search <query> Search across all memory tiers
recall-promote Review daily logs, promote to registers
recall-status Memory system health check
recall-maintain Verify stale entries, prune, clean up
recall-forget <query> Mark entries as superseded
recall-context Show what memory is loaded this session
Conversation (ephemeral — compacted/discarded)
    │
    ▼ WRITE GATE: "Does this change future behavior?"
    │
Daily Log (memory/daily/YYYY-MM-DD.md)
    All writes land here first. Raw, timestamped.
    │
    ▼ PROMOTION: user-controlled via /recall-promote
    │
Registers (memory/registers/*.md)
    Structured claims with metadata (confidence, evidence, last_verified)
    │
    ▼ DISTILLATION: only what's essential for every session
    │
Working Memory (CLAUDE.local.md)
    ~1500 words. Auto-loaded. The persistent "personality."
    │
    ▼ EXPIRY
    │
Archive (memory/archive/)
    Searchable history. Never auto-loaded.

Write Gate — Filters out noise. Only behavior-changing facts, commitments, decisions, and explicit "remember this" requests pass through.

Daily Log First — All writes land in the daily log. Promotion to registers is a separate step, controlled by the user. This prevents the model from prematurely solidifying inferences.

Contradiction Protocol — Never silently overwrites. Old claims are marked [superseded] with date and reason. The pattern of change is preserved.

Correction Gate — Human corrections get highest priority. One correction triggers writes to daily log + register + working memory.

Recall Nudges — Optional, off-by-default behavior where Claude appends a small footer suggesting a memory candidate when you make a correction, commitment, decision, or state a durable preference. Max 2 per session, never mid-response, never during code output. Controlled by recall_suggestions: low | off in CLAUDE.local.md.

Hook When What
SessionStart Session begins Injects open loops + recent daily log highlights into Claude's context
PreCompact Before compaction Writes compaction marker to daily log (file write only, not injected)

How they differ: SessionStart stdout is injected as model-visible context — Claude sees it. PreCompact stdout is not visible to the model; it only writes files to disk. This is by design: SessionStart primes the session, PreCompact preserves a record.

Hooks use $CLAUDE_PROJECT_DIR (standalone) or ${CLAUDE_PLUGIN_ROOT} (plugin) to resolve paths portably. All hooks fail open — errors never block Claude Code.

No transcript parsing. The PreCompact hook only writes a timestamp marker to the daily log. It does not read or parse conversation transcripts. This complies with Anthropic's directory policy on conversation data.

What Auto-Loads (Deterministic)

These use Claude Code's native mechanisms — they load every session without any prompting:

File Mechanism Purpose
rules/total-recall.md .claude/rules/ auto-discovery Write gate, correction protocol, session behavior
CLAUDE.local.md Claude Code local memory Working memory (~1500 words, gitignored)

Plugin format (installed via /plugin install):

total-recall/                     # Plugin root
├── .claude-plugin/
│   └── plugin.json               # Plugin manifest
├── skills/                       # Slash commands (namespaced)
│   ├── recall-write/SKILL.md
│   ├── recall-search/SKILL.md
│   └── ...
├── hooks/
│   ├── hooks.json                # Hook configuration
│   ├── session-start.sh
│   └── pre-compact.sh
├── rules/
│   └── total-recall.md           # Protocol (auto-loaded)
└── templates/                    # Scaffolding templates
    ├── SCHEMA.md
    ├── CLAUDE.local.md
    └── registers/

Standalone format (installed via install.sh):

your-project/
├── .claude/
│   ├── commands/recall-*.md      # Slash commands
│   ├── rules/total-recall.md     # Protocol (auto-loaded)
│   ├── hooks/*.sh                # Hook scripts
│   └── settings.local.json       # Hook configuration
├── memory/
│   ├── SCHEMA.md
│   ├── daily/YYYY-MM-DD.md
│   ├── registers/*.md
│   └── archive/
├── CLAUDE.md
└── CLAUDE.local.md               # Working memory (gitignored)

Compared to Other Memory Tools

Total Recall Auto-ingest tools
What gets saved Only what passes the write gate Everything
Default destination Daily log (promote later) Permanent storage
Context cost ~1500 words working memory Grows unbounded
Corrections Propagate to all tiers immediately Varies
User control Promotion is explicit Automatic
Architecture 4-tier with metadata Flat or 2-tier

Total Recall complements Superpowers. No conflicts:

Superpowers Total Recall
How to work (methodology) What to remember (persistence)
Plans in docs/plans/ Memory in memory/
TDD enforcement Write gate enforcement
  • Memory that doesn't change future behavior shouldn't exist
  • Daily log first — capture safely, promote deliberately
  • Human corrections propagate immediately and permanently
  • Deterministic loading via native Claude Code mechanisms
  • Transparent markdown files, not a black-box database
  • Local only. No network calls. No telemetry. No external dependencies.
  • All memory is stored as plain markdown files in your project directory
  • No transcript parsing — hooks never read conversation history or transcripts
  • Hooks only read/write files inside your project's memory/ directory
  • To audit: all hook code is in hooks/*.sh, all memory is in memory/ — plain text, fully inspectable
  • To uninstall: remove memory/, CLAUDE.local.md, and the .claude/ entries (or /plugin uninstall recall)

What's gitignored by default

The installer adds a labeled block to .gitignore:

# Total Recall (local memory — see README for team mode)
CLAUDE.local.md
.claude/settings.local.json
memory/

Nothing leaks into git. This is the safe default for personal and work repos.

Team mode (shared memory)

If your team wants to version shared decisions and project context while keeping personal notes local, replace the memory/ line with a selective pattern:

# Total Recall (team mode)
CLAUDE.local.md
.claude/settings.local.json

# ignore all memory by default
memory/**

# but allow team-shared registers
!memory/registers/
!memory/registers/decisions.md
!memory/registers/projects.md
!memory/registers/tech-stack.md

# keep private registers ignored
memory/registers/people.md
memory/registers/preferences.md
memory/daily/
memory/archive/

This commits "why we chose X over Y" without accidentally committing daily logs or personal preferences.

MIT

联系我们 contact @ memedata.com