Claude Code / a working model

FIELD GUIDE 02 / MEMORY & CONTEXT

Remember the work.
Not everything.

A file on disk is not a fact in the model’s head.
What gets saved, what gets retrieved, and what actually reaches the prompt.

Claude Code · OpenViking · Magic Context · Letta · Mem0

Compare the systems

Primary documentation checked 17 September 2026. Architecture comparison, not a performance benchmark or installation guide. Features depend on version and configuration. Interactive examples are local teaching models, not live memory services.

01 / THE SHORT ANSWER

Yes, the native memory
is plain text.

Claude Code’s documented built-in memory uses Markdown files. You write instructions in CLAUDE.md; Claude writes selected learnings into auto memory. A bounded MEMORY.md index is loaded into context, and Claude reads detailed topic files with its standard file tools when needed. [1]

No separate embedding model or vector database is required for that documented path. It is file loading and model-directed reading—not a documented nearest-neighbor lookup over a vector index. This describes native memory, not every internal Claude Code feature or third-party plugin.

PERSISTMarkdownInstructions + selected notes
SELECTIndex + file readClaude chooses relevant detail
USEPrompt contextText the model can reason over

No embeddings ≠ no model work. Claude still decides what to save, reads notes, and reasons about them. Notes consume input tokens when loaded; writing them involves ordinary model/tool work. Memory does not train or update the model’s weights.

What does an embedding add?

An embedding model maps text to numerical vectors. A retrieval system compares a query vector with stored vectors to find semantically similar material, even when the wording differs. It then supplies selected text to the main model.

That can improve discovery across a large archive. It also adds indexing, model dependencies, scope filters and stale-index concerns. Similarity is not truth, permission, or a guarantee that the right fact was retrieved.

A system can store Markdown and index it with embeddings. Storage format and retrieval method are separate choices; OpenViking is a useful example.

02 / WHAT LIVES WHERE

Your instructions.
Claude’s notebook.

Documented defaults; paths and behavior can be configured. [1]
LayerStorageHow it enters context
Shared instructionsCLAUDE.md or .claude/CLAUDE.mdApplicable ancestor and working-directory files load at launch. Nested files load when Claude reads in their subtree. Concatenated, not a settings-style override.
Personal instructions~/.claude/CLAUDE.md; project CLAUDE.local.mdPersistent conventions you author. Keep local project instructions out of git when private.
Scoped rules.claude/rules/*.mdUnscoped rules load at startup; rules with paths: load when matching files are read.
Auto memory index~/.claude/projects/<project>/memory/MEMORY.mdFirst 200 lines or 25KB, whichever comes first, at conversation start. This is not a 200-token budget.
Auto memory detailTopic files alongside MEMORY.mdRead on demand with file tools. The whole directory is not injected at startup.

Auto memory is enabled by default and machine-local. Worktrees and subdirectories of the same git repository share its auto memory directory by default; it is not automatically synchronized to another machine. Claude decides which useful learnings to save—not every message or every session. [1]

What Claude records

USER

Who you are

Your role, expertise, and working preferences.

FEEDBACK

What you corrected

Approaches to avoid or repeat, with the reason.

PROJECT

What code cannot tell it

Ongoing decisions, deadlines, and context not derivable from the repository.

REFERENCE

Where to look

Pointers to external sources such as an issue tracker.

The current memory documentation tells Claude not to duplicate facts it can derive from code or git, or instructions already in CLAUDE.md. Use CLAUDE.md for explicit standing conventions and skills for repeatable procedures.

Do subagents share the same notebook?

Not by default. The main conversation’s auto memory is not loaded into ordinary subagents. A fork inherits the parent context; a custom subagent can instead have its own persistent memory. [2]

Its frontmatter can set memory: user, memory: project, or memory: local. These use ~/.claude/agent-memory/<name>/, .claude/agent-memory/<name>/, or .claude/agent-memory-local/<name>/, respectively. Turning off auto memory also disables that subagent memory behavior.

Do not confuse the subagent’s own persistent notes with the parent conversation or assume every worker sees every memory.

03 / FOLLOW ONE MEMORY

Saved is not yet recalled.

A synthetic correction: “For reviews, lead with the user-visible failure and reproduction. Skip praise-only summaries.” Here is one possible lifecycle; saving and reading the note are model decisions, not guaranteed steps.

Claude writes a topic note and an index entry.

ON DISK / TOPIC FILE

---
name: Review feedback
description: How to structure code reviews
type: feedback
---
Lead with the user-visible failure and
reproduction. Skip praise-only summaries.

ON DISK / MEMORY.md

- [Review feedback](feedback_reviews.md)
  — Review structure and evidence.

The index points to the detail. This is an example note, not a prescribed filename or an observed Claude transcript.

The next conversation loads the index.

The short entry is in context, within the documented index limit. The topic file remains on disk. The model does not automatically receive every note or the old conversation just because it was saved.

IN CONTEXT:  applicable CLAUDE.md + MEMORY.md index
ON DISK:     feedback_reviews.md
NOT IMPLIED: full prior conversation

A relevant task leads to a file read.

You ask for a review. Claude can use the index to locate feedback_reviews.md and read it with a standard file tool. The returned text now occupies context and can influence the review.

Task → recognize relevant index entry
     → read feedback_reviews.md
     → use the returned text in this task

No embedding lookup is required in this flow. The possible failure is selection: a saved note can still be overlooked or misapplied.

Correct the stored source, not just the current answer.

If the preference changes, ask Claude to update the memory or edit it through /memory. Keep the index consistent with its topic files. To retire a note, remove its index entry and topic file intentionally.

Removing a file does not retroactively remove its text from an already-running context or older transcripts/backups. Check each store separately when deleting sensitive information.

The index is a retrieval aid, not the memory itself. Keep it short and descriptive. Moving a long note into a topic file saves startup context only if the index stays small.

04 / DON’T MIX THESE UP

Memory ≠ context
≠ compaction ≠ cache.

MechanismWhat it doesWhat it does not do
Persistent memoryKeeps selected information outside the current request so future work can reuse it.Guarantee every stored fact is loaded, current, or obeyed.
Context windowHolds the actual text and other supported input supplied for this model request.Automatically include everything on disk or give unlimited attention.
CompactionSummarizes conversation to make room. Root instructions and memory can be reloaded; summaries can omit detail. [3]Turn the model’s finite window into an infinite one or preserve every detail verbatim in the active prompt.
Prompt cachingReuses eligible prompt-prefix computation; affects latency and billing. [4]Find memories, save preferences, or remove cached text from the context budget.

Retained conversation transcripts are another store. Resuming a conversation is not the same as starting a fresh conversation with selected auto memories. Claude Code’s memory files are excluded from its old-session transcript retention sweep. [1]

Memory is guidance, not a security boundary. CLAUDE.md and recalled notes are context. Use permission rules, hooks, and sandbox/OS controls to enforce restrictions. Stored text can be stale, malicious, or simply wrong.

05 / SAME WORD, DIFFERENT ARCHITECTURES

Compare retrieval,
not the word “memory.”

These are different layers: a native feature, a context database, a harness plugin, an agent runtime, and an application memory API. They are not drop-in substitutes. Recommendations below are architectural judgments, not measured rankings.

Documented paths as checked 17 September 2026. Scroll horizontally for all columns.
SystemStorage & recallEmbedding requirementClaude Code relationship
Claude Code nativeMarkdown instructions + note index; on-demand file reads.None for the documented native memory path.Built in. No extra memory service.
OpenVikingURI filesystem + summaries + vector index; hierarchical semantic retrieval.Yes for semantic indexing/search; not for reading a known URI.Official hooks + MCP integration; separate service.
Magic ContextLocal SQLite, project facts, tiered history, lexical + optional semantic search.Optional; local embeddings documented as default. FTS5/BM25 works with embeddings off.Documented for OpenCode, Pi, OMP. No official Claude Code adapter verified.
Letta / MemFSGit-backed Markdown; system files always in context, other files read on demand.None for default MemFS. Optional semantic/hybrid search adds an index.Primarily its own runtime. Claude Subconscious integration is explicitly a demo.
Mem0Extracted facts + metadata; application calls add/search and injects results.Yes for the standard semantic path; generation also used for default extraction.Official Claude Code plugin targets Mem0 Platform and requires its API key.

01 / NATIVE FEATURE

Claude Code — a small, inspectable notebook.

Write
You author standing instructions. Claude selectively saves user, feedback, project and reference notes; you can edit or remove them.
Retrieve
Load applicable instructions and the bounded MEMORY.md index, then read topic files as needed. No separate vector index is documented for this flow.
Cost / privacy
No extra memory server or embedding service. Loaded notes still consume context and can be sent to the configured model provider; local storage is not a promise of local inference.
Best fit
Project conventions and a manageable set of durable corrections. Easy to inspect; recall depends on index quality and the model choosing the right file.
Watch for
Stale advice, a bloated/truncated index, notes that were saved but never read, and personal information accidentally committed or loaded into the wrong task.

Source: Anthropic memory documentation [1].

02 / CONTEXT DATABASE

OpenViking — a filesystem interface, plus vectors.

Store
Resources, memories and skills have viking:// addresses. Full content lives in filesystem storage; a separate vector index holds retrieval data. L0 abstracts and L1 overviews help select L2 full content.
Write
Ingest resources or commit a session. Background processing generates summaries, indexes content and extracts/deduplicates memories. A submitted job is not proof that searchable memory is ready.
Retrieve
find() performs semantic retrieval without LLM intent planning. search() adds session-aware LLM planning. Vector search identifies candidate directories, then retrieval explores their contents; reranking is optional.
Models
Embeddings for semantic search/indexing; a generation model for useful semantic summaries and memory extraction, plus planning when used. Known-URI reads do not need a semantic lookup. A no-VLM setup is not equivalent to full memory functionality.
Integration
Official Claude Code plugin uses lifecycle hooks and MCP to capture, recall and commit context. This is an external integration, not a change to native MEMORY.md mechanics.
Cost / privacy
Operate content/index storage and a service, plus embedding and generation work. Local storage can still call remote model providers. Review what the plugin captures—including tool results—before enabling it.
Best fit
A large, navigable collection of documents, skills and evolving memories. More infrastructure and asynchronous processing than a few plain-text notes.

Sources: OpenViking architecture, retrieval, configuration and Claude integration [5]. No retrieval benchmark run for this guide.

03 / CONVERSATION & CONTEXT PLUGIN

Magic Context — keep the history recoverable.

Store
The documented default implementation keeps structured project memories, summary compartments and search indexes in local SQLite. It is not just a Markdown file or a repository-wide source-code RAG index.
Write
A language-model historian compresses older conversation and extracts durable facts. The agent can write explicit memories. Optional dreamer jobs consolidate or check stored knowledge in the background.
Retrieve
ctx_search combines lexical retrieval with optional semantic ranking and can search memories, session history, notes and optional indexed commits. ctx_expand recovers original transcript ranges; ctx_reduce queues working-context reduction, not archive deletion.
Embeddings
Optional, with local embeddings enabled by the documented default. The standard local model is Xenova/all-MiniLM-L6-v2; an OpenAI-compatible endpoint is another option. Embeddings off leaves SQLite FTS5/BM25 keyword search. Off does not disable historian/dreamer generation costs.
Integration
Public project documents OpenCode, Pi and Oh My Pi support. Using a Claude model in one of those harnesses is not the same as using Claude Code. No official Claude Code installation was verified.
Cost / privacy
Local database/compute plus historian, optional dreamer and optional remote embedding calls. Background agents send context to their configured model providers. There is no automatic cross-machine synchronization.
Best fit
Long or recurring coding conversations where you need both selected project knowledge and access to older evidence. The model’s active context is still finite; summaries and recall can miss details.
What “persistent” does not guarantee

Project memories can cross sessions and supported harnesses. Raw-message search in the inspected default path is session-scoped; do not assume one query searches every transcript ever recorded.

Exact expansion depends on the original host transcript remaining available. Preserve the harness session store as well as Magic Context’s database. A summary is not a reversible encoding of the full conversation.

This describes the public default TypeScript implementation at the linked revision—not the configuration of any particular OMP installation, its experimental backend, or its other native memory systems.

Sources: Magic Context docs and pinned source [6]; inspected revision 3b797e5, 17 September 2026.

04 / STATEFUL AGENT RUNTIME

Letta — versioned memory owned by an agent.

Store
Current MemFS documentation describes an agent-owned Git repository projected as editable Markdown files. system/ files load into the system prompt every turn; other files stay outside context until read, with their file tree available as a guide.
Write / retrieve
The agent edits and commits durable notes; optional dreaming subagents review recent work. Default memory lookup uses ordinary file search and reads. Commit/push boundaries matter for durable synchronized state.
Embeddings
No vector index by default in current MemFS. The optional MemFS Search mod supports keyword search; semantic/hybrid modes require QMD and indexing. Cloud conversation-history search is a separate feature with vector/hybrid options.
Integration
Principally Letta’s own agent harness and SDK. The official Claude Subconscious project links a background Letta agent to Claude Code, but labels itself a demo, not intended for production.
Cost / privacy
Agent inference, optional dreaming/review, and local or cloud operations. Local-only agents need their own backups. Self-hosted state can still use remote inference.
Best fit
Building around a persistent agent identity and versioned memory workflow. This is a broader runtime choice, not a transparent replacement for native Claude Code notes.

Sources: Current Letta MemFS, dreaming, self-hosting and demo integration [7]. Older Letta/MemGPT descriptions of archival vector memory should not be assumed to describe today’s default MemFS.

05 / APPLICATION MEMORY LAYER

Mem0 — facts behind an add/search API.

Store
Extracted facts and metadata with embedding-backed retrieval. It is not a full transcript by default. Managed Platform and open-source deployments have different storage and retrieval capabilities.
Write / retrieve
Call add() after useful interactions, then search() before a model call. The application chooses which results enter the prompt. Current docs describe additive extraction; use explicit update/delete to correct old facts rather than assume new statements overwrite them.
Models
Embeddings for standard semantic retrieval and a generation model for default extraction. infer=False skips extraction generation in OSS, not embedding. Providers and backing stores are configurable; reranking is optional.
Integration
The documented Claude Code plugin targets Mem0 Platform and requires its API key. That plugin should not be presented as an offline OSS setup.
Cost / privacy
Managed usage or operated storage, plus extraction, embedding and optional reranking. Scope every query to the intended user/agent/project. Plugin capture and redaction need review; local capture can still be sent to a remote service.
Best fit
Adding per-user or per-agent facts to an existing application. You retain responsibility for lifecycle, injection, conflict handling and deletion; extracted facts can lose the original context.

Sources: Mem0 architecture, OSS configuration/source and Claude Code plugin [8]. Current Platform graph/temporal features are not interchangeable with the current OSS path.

06 / MATCH THE PROBLEM

Start small.
Add retrieval for a reason.

  1. “Stop making the same project mistake.” Start with concise CLAUDE.md instructions, scoped rules and native auto memory. Low setup cost; inspect exactly what was saved.
  2. “Recover a decision buried in a long coding conversation.” Investigate Magic Context’s supported harness integration and transcript retrieval. Keep exact-history recovery distinct from curated project facts.
  3. “Search many documents, skills and memories together.” OpenViking’s hierarchical context store and semantic retrieval target this problem. Budget for models, indexing and a service.
  4. “Build an agent with versioned, editable memory.” Letta provides an agent runtime with Git-backed MemFS and optional background dreaming; it is not just a CLAUDE.md replacement.
  5. “Add per-user memory to my own application.” Mem0 supplies an add/search memory layer. Your application still needs to decide when to save, retrieve and inject results.

Evaluate on your actual failure cases. Did it recall the right decision? Can it show the source? Does a correction replace stale advice? Can it isolate users/projects and delete data? Measure total model calls, tokens and latency—not just storage size or a vendor benchmark.

07 / INSPECT & MAINTAIN

Keep the notebook
small and accountable.

Claude Code · commands to type in a session
/memory   # browse/edit notes and toggle auto memory
/context  # inspect current context and loaded memory files

For explicit team instructions, ask to update CLAUDE.md or edit it directly. For a personal learning, ask Claude to remember it, then inspect what was actually saved. Do not infer persistence solely from an answer saying “I’ll remember.”

Optional · merge into settings.json, don’t replace it
{
  "autoMemoryEnabled": false
}

This disables auto memory, not CLAUDE.md instructions, and does not itself delete existing notes. The environment alternative is CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. See the current official settings.

  • Store rationale and source pointers. Separate confirmed decisions from guesses. Recheck against current code and user instructions.
  • Don’t save secrets. Machine-local notes can still enter a model request; a remote embedding or extraction provider may also receive text in external systems.
  • Scope first. A cross-project notebook can leak advice or data into the wrong project. Shared services need explicit tenant/project controls.
  • Correct all copies deliberately. Source notes, summaries, vector indexes, archives and backups can have different deletion lifecycles.
  • Keep procedures separate. A skill describes how to perform a repeatable task; memory records durable facts and feedback. Neither guarantees execution or compliance.

SOURCES / 17 SEPTEMBER 2026

Read the implementation
contract.

Native-memory claims follow Anthropic’s public documentation, not an audit of private internals. External comparisons follow each project’s public documentation/source; no memory service was installed or benchmarked for this guide.

Download this guide · standalone HTML ↓Download the seminar ↓

Fonts, styles and interactions are embedded. The saved guide works offline; source links and site navigation require a connection. Nothing typed or clicked in the teaching model is sent to a memory service.