Works with Claude Code CLI & VSCode Extension

Claude Code gets a
persistent memory

Claude forgets everything when you close the tab. DevMemory automatically saves what it learns — and loads it back every session.

Get started View on GitHub
$ npm install -g dev-memory
— install once, works everywhere —

$ dev-memory --goal "implement rate limiting"

[dev-memory] Loaded 17 memory entries (3 matched goal)
[dev-memory] Starting Claude Code session...

← Claude works with full project context →

[dev-memory] Session ended. Compiling memory...
[dev-memory] ✓ Memory updated — 5 new entries saved

The problem

Every session starts from zero

You spend the first 10 minutes re-explaining your project architecture. Every. Single. Time.

🧠

No context between sessions

Claude doesn't remember your architecture decisions, past bugs, or project conventions — you have to re-explain everything each time.

🔄

Repeating the same mistakes

Without memory, Claude can't learn from past debugging sessions. It'll suggest the same bad fix it already tried last week.

📋

Manual context dumps

Pasting your README or copying context into every conversation is tedious and wastes tokens on irrelevant information.

How it works

Automatic. No extra steps.

DevMemory hooks into Claude Code — before and after each session.

Before session

📂 Load .ai/memory/*.md
🔍 TF-IDF search by session goal
💉 Inject relevant context into Claude
session runs

After session

📄 Parse Claude's JSONL transcript
✂️ Summarize → extract knowledge
💾 Append to .ai/memory/*.md

Features

Built for developer workflows

Lightweight, offline-capable, and git-friendly.

Zero-latency inject

Memory is already on disk as Markdown. If context is fresh, inject exits in milliseconds — no API calls, no waiting.

🔌

Hooks-native auto mode

Wire inject and compile as Claude Code hooks. Memory loads before every prompt and compiles in the background when done.

📦

No external dependencies

TF-IDF search via natural + SQLite. No ONNX runtime, no 100MB model downloads, no API keys for search.

📁

Plain Markdown storage

Memory lives in .ai/memory/*.md. Readable, diffable, committable. No proprietary formats or locked databases.

🎯

Goal-based relevance

Pass a session goal and DevMemory surfaces only the most relevant entries — less noise in context, more focused Claude.

🔀

CLI + VSCode extension

Works via the dev-memory wrapper in terminal, or via CLAUDE.md injection for the VSCode extension.

Memory structure

Four types of memory

Claude automatically categorises what it learns into structured files.

architecture.md

Architecture

System design decisions, patterns, and structural choices.

decisions.md

Decisions

Why you chose X over Y. Rationale that future sessions can rely on.

bugs.md

Bugs

Issues found and how they were fixed — prevent re-investigating the same root causes.

learnings.md

Learnings

Gotchas, non-obvious behaviours, and key insights from real sessions.

Quickstart

Up and running in 2 minutes

Choose between fully automatic (hooks) or manual mode.

Option A — Auto mode (recommended)

1

Install

Install globally via npm.

npm install -g dev-memory
2

Add hooks to your project

Create or update .claude/settings.json:

{
  "hooks": {
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "dev-memory inject 2>/dev/null || true"
      }]
    }],
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "nohup dev-memory compile > /dev/null 2>&1 &"
      }]
    }]
  }
}

nvm users: hooks run without loading your shell profile, so node won't be in PATH. Prefix each command with your node bin directory:
PATH=$(nvm which node | xargs dirname):$PATH dev-memory inject 2>/dev/null || true Find your path: nvm which node | xargs dirname

3

Done

Memory loads before every prompt. Knowledge compiles in the background after each session.

Option B — Manual / CLI mode

1

Install

npm install -g dev-memory
2

Start a session

Run from any project directory.

dev-memory --goal "fix auth bug"
3

Inject for VSCode

Before opening VSCode:

dev-memory inject --goal "..."
4

Compile after VSCode session

dev-memory compile

Give Claude Code a memory

Open source. MIT licensed. Under 500 lines of TypeScript.

View on GitHub npm package