MemMesh — persistent, self-improving memory for AI agents. Get started →
IntegrationsClaude Code

Claude Code

This guide connects Claude Code to MemMesh so your agent remembers across sessions. The path is fully local: install the thinkfleet-memory engine, run one command, and Claude Code talks to it over a local stdio MCP server. No API key, no server, no Docker.

Do I need an API key? No. The local engine stores everything in a SQLite file on your machine (~/.thinkfleet-memory/memory.db) and runs on the Free tier out of the box. A managed Mesh Router (hosted) endpoint is coming soon — until then, everything here is local.

Prerequisites

  • Claude Code installed and working.
  • Node.js 18+ to run the npx installer.
  • A thinkfleet-memory engine binary. The prebuilt release channel isn’t live yet, so until then set THINKFLEET_BINARY to a binary you have, or build one from source with cargo build --release (see the Quickstart).

Install

One command wires everything into Claude Code:

npx @thinkfleet/memmesh install --tool claude-code

That’s it. The installer:

  • writes the MCP server entry into ~/.claude.json,
  • drops the agent teaching skill into ~/.claude/skills/thinkfleet-memory/,
  • adds an auto-observe hook to ~/.claude/settings.json,

preserving any MCP servers and hooks you already have. The engine runs as a child process of Claude Code, stores memory in ~/.thinkfleet-memory/memory.db, and serves the Free tier.

💡

Until the binary release channel is live, prefix the command with your binary path: THINKFLEET_BINARY=/path/to/thinkfleet-memory npx @thinkfleet/memmesh install --tool claude-code. If the binary is already on your $PATH, you can run thinkfleet-memory install --tool claude-code directly.

Then restart Claude Code so it reloads the config.

What the installer writes

1. The MCP server — an entry keyed thinkfleet-memory under mcpServers in ~/.claude.json. It’s a stdio server: a command Claude Code launches, not a URL.

~/.claude.json
{
  "mcpServers": {
    "thinkfleet-memory": {
      "command": "/path/to/thinkfleet-memory",
      "args": ["--db", "/Users/you/.thinkfleet-memory/memory.db", "mcp"]
    }
  }
}

2. The agent skillSKILL.md at ~/.claude/skills/thinkfleet-memory/, which teaches the agent when and how to use the memory tools.

3. The auto-observe hook — a UserPromptSubmit hook in ~/.claude/settings.json that runs thinkfleet-memory observe on every prompt, so the engine extracts and saves facts automatically without you asking:

~/.claude/settings.json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/thinkfleet-memory observe --role user --json 2>/dev/null || true"
          }
        ]
      }
    ]
  }
}

The hook is heuristic-only and fast, and it fails open (|| true) so it never blocks a prompt. Don’t want it? Pass --no-hooks at install time and the hook is skipped.

Installer flags

  • --tool <id> — target one tool (repeatable): claude-code, cursor, windsurf, codex. Omit to wire every detected tool.
  • --dry-run — preview what would be written, change nothing.
  • --force — install even if the tool isn’t auto-detected (creates the config from scratch).
  • --skill-only — install just the agent skill, skip the MCP config.
  • --mcp-only — install just the MCP config, skip the skill.
  • --no-hooks — skip the Claude Code auto-observe hook.

See Installer & doctor for the full reference, including the doctor diagnostic and env knobs.

Verify it works

  1. Restart Claude Code so it reloads ~/.claude.json.

  2. Confirm thinkfleet-memory shows as a connected MCP server.

  3. Or run the diagnostic, which checks the MCP entry, skill, hook, and DB health:

    thinkfleet-memory doctor
  4. Smoke test in the Claude Code chat:

    • “Remember that the EU region requires data residency in eu-west-1.” → should call memory_save.
    • “What data-residency rules do we have?” → should recall the memory you just saved.

The full set of tools the agent can call is in the MCP tool reference.

Remove it

The installer is merge-only. To remove MemMesh, delete the thinkfleet-memory entry under mcpServers in ~/.claude.json, the UserPromptSubmit hook entry in ~/.claude/settings.json, and (optionally) the ~/.claude/skills/thinkfleet-memory/ directory. Your other MCP servers and hooks are untouched.

Other tools

The installer wires other MCP clients too — --tool cursor, --tool windsurf, --tool codex. See Cursor and the MCP overview for client-specific config shapes.