All posts
·4 min read

How to Give Claude Code Persistent Memory in 2 Minutes

Claude Code is powerful, but it forgets everything between sessions. Here's how to add persistent cloud memory with a single config file — no SDK, no boilerplate.

Claude CodeMCPTutorial

Claude Code is one of the most powerful AI coding agents available today. It can read your codebase, write code, run tests, and manage git — but it has one major limitation: it forgets everything between sessions.

Every new conversation starts from zero. Your agent doesn't remember the architecture decisions you made yesterday, the coding style you prefer, or the bugs you've already fixed. You end up repeating context, re-explaining preferences, and watching your agent make the same mistakes twice.

The solution: cloud memory via MCP

Agent-Memo.AI solves this by giving Claude Code persistent cloud memory through the Model Context Protocol (MCP). Once configured, your agent can store and recall memories across sessions — decisions, preferences, feedback, architecture context, and more.

The setup takes less than 2 minutes and requires zero code changes. You just add two config files to your project.

Step 1: Get your API token

Sign up for a free account at agent-memo.ai and copy your API token from the dashboard.

Step 2: Create .mcp.json

Create this file in your project root:

{
  "mcpServers": {
    "agent-memo": {
      "command": "npx",
      "args": ["-y", "@agent-memo/mcp-client"],
      "env": {
        "AGENTMEMO_TOKEN": "your-token-here"
      }
    }
  }
}

Step 3: Add hooks for auto-memory

Create .claude/settings.local.json with three hooks: SessionStart (recalls memories on wake-up), Stop (auto-saves periodically), and PreCompact (saves before context compression).

See the full configuration in our setup guide.

What happens next

Once configured, your agent has 14 memory tools available. It can store decisions, recall context from previous sessions, search memories semantically, and even build a knowledge graph of entity relationships in your project.

The best part? Hooks handle the entire memory lifecycle automatically. The SessionStart hook recalls your context on wake-up, the Stop hook periodically saves important context, and the PreCompact hook captures critical information before context compression.

Real-world impact

With persistent memory, your Claude Code sessions become dramatically more productive:

  • No more repeating "I prefer minimal PRs" every session
  • Architecture decisions are recalled instantly
  • The agent learns your coding style over time
  • Project context persists across weeks, not just minutes

Get started free — it takes less than 2 minutes.

Give your AI agent persistent memory today.

Get started free