Skip to content

Latest commit

 

History

History
209 lines (151 loc) · 6.2 KB

File metadata and controls

209 lines (151 loc) · 6.2 KB
title Add Memory to Claude Code — Persistent Context Across Sessions
description Give Claude Code persistent memory with Basic Memory. Your AI remembers decisions, code patterns, and project context across every session.

Claude Code provides native support for Basic Memory through the Model Context Protocol (MCP), enabling persistent context across development sessions and building comprehensive coding knowledge.

Why Add Memory to Claude Code?

Claude Code is powerful, but every new session starts from zero. Basic Memory changes that:

  • Persistent context — Your AI remembers project architecture, past decisions, and coding patterns
  • Cross-session knowledge — Pick up exactly where you left off, no re-explaining
  • Searchable history — Find any past conversation, decision, or code review instantly
  • Plain text you own — Everything stored as Markdown files you can read, edit, and version control

Cloud Setup

::steps

Sign Up

Create your account at app.basicmemory.com

Add Remote MCP Server

In Claude Code, add the remote MCP server:

claude mcp add -s user -t http basic-memory-cloud https://cloud.basicmemory.com/mcp

Authenticate

Follow the OAuth flow in Claude Code to grant permissions

Verify Setup

In Claude Code, check available tools:

You: "What tools do you have access to?"

You should see Basic Memory tools listed

::

::tip See the Cloud Guide for detailed instructions and troubleshooting. ::


Local Setup

Configure Claude Code

Install with:

claude mcp add basic-memory basic-memory mcp

::note For Basic Memory installation, see Quickstart: Local. ::

Verify Installation

In Claude Code, check that Basic Memory tools are available:

You: "What tools do you have access to?"

You should see Basic Memory tools listed, including note creation, search, and project management.

Quick Start

Once configured, you can immediately start using Basic Memory in your development workflow:

You: "Create a note about our authentication strategy for the API"
Claude: I'll document the authentication strategy we discussed...
[Creates structured note with technical details and rationale]

You: "Switch to my personal coding project"
Claude: [Changes context to personal project knowledge base]

MCP Integration Benefits

Claude Code's native MCP support provides:

  • Automatic tool access - No manual setup required
  • Project-aware context - Maintains separate knowledge bases per project
  • Real-time sync - Changes are immediately available
  • Persistent memory - Context survives between sessions
  • Structured knowledge - Uses Basic Memory's semantic format

Available Tools

Through MCP, Claude Code can access all Basic Memory functionality:

  • write_note - Create and update documentation
  • read_note - Access existing knowledge and context
  • search_notes - Find relevant information across projects
  • edit_note - Update documentation incrementally
  • recent_activity - Check what you've been working on
  • project management - Switch between different knowledge bases
  • build_context - Load conversation context from memory:// URLs

Integration with Development

CLAUDE.md Enhancement

Claude Code uses CLAUDE.md files for project instructions. Basic Memory complements this by:

  • Storing detailed knowledge outside the context window
  • Enabling search across your entire knowledge base
  • Maintaining history of decisions and learnings
  • Linking related concepts through relations

Project Context

Basic Memory maintains separate knowledge bases for different projects:

You: "Switch to my work project"
Claude: [Loads work project context and knowledge]

You: "Based on our API design notes, what's the next step?"
Claude: [References existing documentation to provide contextual guidance]

Troubleshooting

Claude Code can't access Basic Memory

Solutions:

  • Verify Basic Memory is installed: basic-memory --version
  • Check MCP server status: /mcp in Claude Code
  • Reinstall if needed: claude mcp remove basic-memory then claude mcp add basic-memory basic-memory mcp

Context not loading from memory:// URLs

Solutions:

  • Confirm files exist in current project
  • Check memory:// URL syntax (e.g., memory://folder/note)
  • Verify sync is working: basic-memory status

Notes not updating

Solutions:

  • Check file permissions in knowledge base directory
  • Check ~/.basic-memory for logs containing error messages
  • Report error messages to the Basic Memory team

Frequently Asked Questions

Does Claude Code have built-in memory?

Claude Code doesn't have persistent memory between sessions by default. Basic Memory adds this capability through MCP, giving Claude Code access to your knowledge base across every session.

How do I add memory to Claude Code?

Install Basic Memory and configure it as an MCP server: claude mcp add basic-memory basic-memory mcp. See the setup guide above for detailed instructions.

Does Basic Memory work with Claude Code's CLAUDE.md?

Yes! Basic Memory complements CLAUDE.md by storing detailed knowledge outside the context window. CLAUDE.md handles project instructions; Basic Memory handles everything else — decisions, context, history.


::note Basic Memory also works with: Cursor · OpenAI Codex · Claude Desktop · VS Code · Obsidian ::

Next Steps

:::card-group ::card

title: Project Documentation icon: i-lucide-folder-kanban to: /how-to/project-documentation

Learn how to document your development projects. ::

::card

title: Research & Learning icon: i-lucide-graduation-cap to: /how-to/research-learning

Build knowledge from your coding sessions. ::

::card

title: CLI Reference icon: i-lucide-terminal to: /reference/cli-reference

Master Basic Memory command line tools. ::

::card

title: Knowledge Format icon: i-lucide-file-text to: /concepts/knowledge-format

Structure effective development documentation. :: :::