claude-conversation-memory-mcp 1.6.5 β 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -769
- package/dist/ConversationMemory.d.ts.map +1 -1
- package/dist/ConversationMemory.js +7 -2
- package/dist/ConversationMemory.js.map +1 -1
- package/dist/parsers/ConversationParser.d.ts +19 -0
- package/dist/parsers/ConversationParser.d.ts.map +1 -1
- package/dist/parsers/ConversationParser.js +100 -14
- package/dist/parsers/ConversationParser.js.map +1 -1
- package/dist/tools/ToolHandlers.d.ts +5 -0
- package/dist/tools/ToolHandlers.d.ts.map +1 -1
- package/dist/tools/ToolHandlers.js +152 -9
- package/dist/tools/ToolHandlers.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,177 +1,51 @@
|
|
|
1
|
-
# Claude Conversation Memory
|
|
1
|
+
# Claude Conversation Memory MCP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server that gives Claude Code and Codex long-term memory by indexing conversation history with semantic search, decision tracking, and cross-project search.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **Context transfer** - Recall past work and apply it to current tasks ("remember X, now do Y based on that")
|
|
7
|
+
- **Search conversations** - Natural language search across your chat history
|
|
8
|
+
- **Track decisions** - Remember why you made technical choices
|
|
9
|
+
- **Prevent mistakes** - Learn from past errors
|
|
10
|
+
- **Git integration** - Link conversations to commits
|
|
11
|
+
- **Cross-project search** - Search across all your projects globally
|
|
12
|
+
- **Project migration** - Keep history when renaming/moving projects
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
- **Search across ALL projects** - Find conversations across your entire work history
|
|
17
|
-
- **Dual-source support** - Index from both Claude Code CLI AND Codex
|
|
18
|
-
- **Unified interface** - Search conversations from any source in one query
|
|
19
|
-
- **Project filtering** - Filter by source type (claude-code, codex, or all)
|
|
20
|
-
- **Hybrid architecture** - Per-project databases + global registry for fast, isolated access
|
|
21
|
-
|
|
22
|
-
### Project Management
|
|
23
|
-
- **Migrates conversation history** - Keep your history when renaming or moving projects
|
|
24
|
-
- **Forget selectively** - Delete conversations by topic/keyword with automatic backups
|
|
25
|
-
- **Cross-project insights** - Discover decisions and mistakes across all your work
|
|
26
|
-
|
|
27
|
-
## π― Dual Source Support
|
|
28
|
-
|
|
29
|
-
This MCP server works with **TWO** AI coding assistant platforms:
|
|
30
|
-
|
|
31
|
-
### β
Claude Code CLI
|
|
32
|
-
- **Official support**: Primary platform
|
|
33
|
-
- **Storage location**: `~/.claude/projects/`
|
|
34
|
-
- **Per-project databases**: Each project gets its own isolated database
|
|
35
|
-
- **Website**: https://github.com/anthropics/claude-code
|
|
36
|
-
|
|
37
|
-
### β
Codex
|
|
38
|
-
- **Full integration**: NEW in v1.5.0
|
|
39
|
-
- **Storage location**: `~/.codex/sessions/`
|
|
40
|
-
- **Date-hierarchical**: Sessions organized by `YYYY/MM/DD/`
|
|
41
|
-
- **Dedicated database**: Separate database at `~/.codex/.codex-conversations-memory.db`
|
|
42
|
-
|
|
43
|
-
### β Not Supported
|
|
44
|
-
- Claude Desktop (different conversation format)
|
|
45
|
-
- Claude Web (no local storage)
|
|
46
|
-
- Other Claude integrations
|
|
47
|
-
|
|
48
|
-
## π Global Cross-Project Search
|
|
49
|
-
|
|
50
|
-
The hybrid architecture enables powerful cross-project search capabilities:
|
|
51
|
-
|
|
52
|
-
### How It Works
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
56
|
-
β Global Architecture β
|
|
57
|
-
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
58
|
-
β β
|
|
59
|
-
β ~/.claude/.claude-global-index.db (Central Registry) β
|
|
60
|
-
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
|
61
|
-
β β Tracks all indexed projects: β β
|
|
62
|
-
β β β’ Project paths and source types β β
|
|
63
|
-
β β β’ Database locations β β
|
|
64
|
-
β β β’ Aggregate statistics β β
|
|
65
|
-
β β β’ Last indexed timestamps β β
|
|
66
|
-
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
|
67
|
-
β β β
|
|
68
|
-
β βββββββββββββββΌββββββββββββββ β
|
|
69
|
-
β βΌ βΌ βΌ β
|
|
70
|
-
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
|
71
|
-
β β Project A β β Project B β β Codex β β
|
|
72
|
-
β β Database β β Database β β Database β β
|
|
73
|
-
β β β β β β β β
|
|
74
|
-
β β β’ Convos β β β’ Convos β β β’ Sessions β β
|
|
75
|
-
β β β’ Messages β β β’ Messages β β β’ Messages β β
|
|
76
|
-
β β β’ Decisionsβ β β’ Decisionsβ β β’ Tools β β
|
|
77
|
-
β β β’ Mistakes β β β’ Mistakes β β β’ Commits β β
|
|
78
|
-
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
|
79
|
-
β β
|
|
80
|
-
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Benefits
|
|
84
|
-
|
|
85
|
-
**Isolation**: Each project has its own database - no cross-contamination
|
|
86
|
-
**Speed**: Direct database access - no central bottleneck
|
|
87
|
-
**Privacy**: Projects stay separate until you explicitly search globally
|
|
88
|
-
**Scalability**: Add unlimited projects without performance degradation
|
|
89
|
-
|
|
90
|
-
### Global Search Tools
|
|
91
|
-
|
|
92
|
-
Four new MCP tools enable cross-project search:
|
|
93
|
-
|
|
94
|
-
1. **`index_all_projects`** - Index all Claude Code projects + Codex in one command
|
|
95
|
-
2. **`search_all_conversations`** - Search messages across all indexed projects
|
|
96
|
-
3. **`get_all_decisions`** - Find decisions from any project (coming soon)
|
|
97
|
-
4. **`search_all_mistakes`** - Learn from mistakes across all work (coming soon)
|
|
98
|
-
|
|
99
|
-
## π¦ Installation
|
|
100
|
-
|
|
101
|
-
### Prerequisites
|
|
102
|
-
|
|
103
|
-
**Required:**
|
|
104
|
-
1. **Node.js**: Version 18 or higher
|
|
105
|
-
2. **Claude Code CLI** OR **Codex**: At least one AI assistant platform
|
|
106
|
-
- Claude Code: https://github.com/anthropics/claude-code
|
|
107
|
-
- Codex: Your Codex installation
|
|
108
|
-
3. **sqlite-vec extension**: Automatically loaded (bundled with package)
|
|
109
|
-
|
|
110
|
-
**Recommended for better semantic search:**
|
|
111
|
-
4. **Ollama**: For high-quality local embeddings
|
|
112
|
-
```bash
|
|
113
|
-
# macOS/Linux
|
|
114
|
-
curl -fsSL https://ollama.com/install.sh | sh
|
|
115
|
-
|
|
116
|
-
# Or download from: https://ollama.com
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
5. **Default embedding model** (if using Ollama):
|
|
120
|
-
```bash
|
|
121
|
-
# Pull the recommended model
|
|
122
|
-
ollama pull mxbai-embed-large
|
|
123
|
-
|
|
124
|
-
# Start Ollama service
|
|
125
|
-
ollama serve
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Note**: Without Ollama, the MCP automatically falls back to Transformers.js (slower but works offline with no setup).
|
|
129
|
-
|
|
130
|
-
### Install the MCP Server
|
|
14
|
+
## Installation
|
|
131
15
|
|
|
132
16
|
```bash
|
|
133
17
|
npm install -g claude-conversation-memory-mcp
|
|
134
18
|
```
|
|
135
19
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
**Manual Configuration** (if needed): If automatic configuration doesn't work, see the [Configure Claude Code CLI](#configure-claude-code-cli) section below.
|
|
139
|
-
|
|
140
|
-
**Discover Available Models:**
|
|
141
|
-
After installation, you can see all available embedding models and their dimensions:
|
|
142
|
-
- Run the CLI: `claude-conversation-memory-mcp`
|
|
143
|
-
- Type: `config` to see all available models organized by provider
|
|
144
|
-
- Or check the example config file: `.claude-memory-config.example.jsonc`
|
|
20
|
+
The installer automatically configures Claude Code. To verify:
|
|
145
21
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Claude Code checks for MCP server configurations in this order (highest to lowest priority):
|
|
151
|
-
|
|
152
|
-
1. **`.mcp.json`** - Project-level (in your project root) - **Highest Priority**
|
|
153
|
-
2. **`~/.claude.json`** - User-level global (in your home directory) - **Lower Priority**
|
|
22
|
+
```bash
|
|
23
|
+
claude-conversation-memory-mcp --version
|
|
24
|
+
```
|
|
154
25
|
|
|
155
|
-
|
|
26
|
+
### Embedding Providers (Optional)
|
|
156
27
|
|
|
157
|
-
|
|
28
|
+
For semantic search, install one of:
|
|
158
29
|
|
|
159
|
-
|
|
30
|
+
**Ollama** (recommended - fast, local):
|
|
31
|
+
```bash
|
|
32
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
33
|
+
ollama pull mxbai-embed-large
|
|
34
|
+
ollama serve
|
|
35
|
+
```
|
|
160
36
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"conversation-memory": {
|
|
165
|
-
"command": "claude-conversation-memory-mcp"
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
37
|
+
**Transformers.js** (no setup, slower):
|
|
38
|
+
```bash
|
|
39
|
+
npm install @xenova/transformers
|
|
169
40
|
```
|
|
170
41
|
|
|
171
|
-
|
|
42
|
+
Without either, the MCP falls back to full-text search.
|
|
172
43
|
|
|
173
|
-
|
|
44
|
+
## Configuration
|
|
174
45
|
|
|
46
|
+
The MCP auto-configures on install. Manual setup if needed:
|
|
47
|
+
|
|
48
|
+
**~/.claude/config.json** (Claude Code):
|
|
175
49
|
```json
|
|
176
50
|
{
|
|
177
51
|
"mcpServers": {
|
|
@@ -182,645 +56,88 @@ Create `.mcp.json` in your project root:
|
|
|
182
56
|
}
|
|
183
57
|
```
|
|
184
58
|
|
|
185
|
-
**
|
|
186
|
-
|
|
59
|
+
**Embedding config** (optional) - create `.claude-memory-config.json`:
|
|
187
60
|
```json
|
|
188
61
|
{
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
62
|
+
"embedding": {
|
|
63
|
+
"provider": "ollama",
|
|
64
|
+
"model": "mxbai-embed-large",
|
|
65
|
+
"dimensions": 1024
|
|
194
66
|
}
|
|
195
67
|
}
|
|
196
68
|
```
|
|
197
69
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
70
|
+
## MCP Tools
|
|
71
|
+
|
|
72
|
+
### Indexing
|
|
73
|
+
| Tool | Description |
|
|
74
|
+
|------|-------------|
|
|
75
|
+
| `index_conversations` | Index current project's conversations |
|
|
76
|
+
| `index_all_projects` | Index all Claude Code + Codex projects |
|
|
77
|
+
|
|
78
|
+
### Search
|
|
79
|
+
| Tool | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| `search_conversations` | Search messages in current project |
|
|
82
|
+
| `search_all_conversations` | Search across all indexed projects |
|
|
83
|
+
| `get_decisions` | Find architectural decisions |
|
|
84
|
+
| `get_all_decisions` | Decisions across all projects |
|
|
85
|
+
| `search_mistakes` | Find past errors and fixes |
|
|
86
|
+
| `search_all_mistakes` | Mistakes across all projects |
|
|
87
|
+
| `find_similar_sessions` | Find related conversations |
|
|
88
|
+
|
|
89
|
+
### Context
|
|
90
|
+
| Tool | Description |
|
|
91
|
+
|------|-------------|
|
|
92
|
+
| `check_before_modify` | Get context before editing a file |
|
|
93
|
+
| `get_file_evolution` | See file history with commits |
|
|
94
|
+
| `recall_and_apply` | Recall past work for current task |
|
|
95
|
+
| `get_requirements` | Look up component requirements |
|
|
96
|
+
| `get_tool_history` | Query tool usage history |
|
|
97
|
+
| `link_commits_to_conversations` | Connect git commits to sessions |
|
|
209
98
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
**Quick check**: After restart, you can verify the version with:
|
|
219
|
-
```bash
|
|
220
|
-
claude-conversation-memory-mcp --version
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## π₯οΈ Standalone CLI / REPL Mode
|
|
99
|
+
### Project Management
|
|
100
|
+
| Tool | Description |
|
|
101
|
+
|------|-------------|
|
|
102
|
+
| `discover_old_conversations` | Find folders from renamed projects |
|
|
103
|
+
| `migrate_project` | Migrate/merge conversation history |
|
|
104
|
+
| `forget_by_topic` | Delete conversations by keyword |
|
|
105
|
+
| `generate_documentation` | Generate docs from conversations |
|
|
224
106
|
|
|
225
|
-
|
|
107
|
+
## CLI Usage
|
|
226
108
|
|
|
227
|
-
|
|
109
|
+
The package includes a standalone CLI:
|
|
228
110
|
|
|
229
|
-
**1. Interactive REPL Mode** (Default)
|
|
230
111
|
```bash
|
|
112
|
+
# Interactive mode
|
|
231
113
|
claude-conversation-memory-mcp
|
|
232
|
-
# Starts interactive shell with 40+ commands
|
|
233
|
-
```
|
|
234
114
|
|
|
235
|
-
|
|
236
|
-
```bash
|
|
115
|
+
# Single commands
|
|
237
116
|
claude-conversation-memory-mcp status
|
|
117
|
+
claude-conversation-memory-mcp index
|
|
238
118
|
claude-conversation-memory-mcp "search authentication"
|
|
239
|
-
claude-conversation-memory-mcp mistakes --limit 5
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**3. MCP Server Mode** (Used by Claude Code CLI)
|
|
243
|
-
```bash
|
|
244
|
-
claude-conversation-memory-mcp --server
|
|
245
|
-
# Or automatically via stdio from Claude Code CLI
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
### Quick CLI Examples
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# View database status
|
|
252
|
-
claude-conversation-memory-mcp status
|
|
253
|
-
|
|
254
|
-
# Index conversations (current project)
|
|
255
|
-
claude-conversation-memory-mcp index --include-mcp
|
|
256
|
-
|
|
257
|
-
# Index ALL projects + Codex (NEW)
|
|
258
|
-
claude-conversation-memory-mcp index-all --codex --claude-code
|
|
259
|
-
|
|
260
|
-
# Search for topics
|
|
261
|
-
claude-conversation-memory-mcp "search database migration" --limit 3
|
|
262
|
-
|
|
263
|
-
# Search across ALL projects (NEW)
|
|
264
|
-
claude-conversation-memory-mcp "search-all authentication" --limit 10
|
|
265
|
-
|
|
266
|
-
# Find past mistakes
|
|
267
|
-
claude-conversation-memory-mcp mistakes "async" --type logic_error
|
|
268
|
-
|
|
269
|
-
# Check file context before editing
|
|
270
|
-
claude-conversation-memory-mcp check src/auth.ts
|
|
271
|
-
|
|
272
|
-
# Configure embedding model
|
|
273
|
-
claude-conversation-memory-mcp config
|
|
274
|
-
claude-conversation-memory-mcp set model mxbai-embed-large
|
|
275
|
-
claude-conversation-memory-mcp set dimensions 1024
|
|
276
|
-
|
|
277
|
-
# View help
|
|
278
119
|
claude-conversation-memory-mcp help
|
|
279
|
-
claude-conversation-memory-mcp "help search"
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### Configuration Management
|
|
283
|
-
|
|
284
|
-
The CLI includes built-in commands for managing embedding models and dimensions:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
# View current configuration
|
|
288
|
-
claude-conversation-memory-mcp config
|
|
289
|
-
|
|
290
|
-
# Switch to Ollama with mxbai-embed-large (1024 dimensions)
|
|
291
|
-
claude-conversation-memory-mcp set provider ollama
|
|
292
|
-
claude-conversation-memory-mcp set model mxbai-embed-large
|
|
293
|
-
claude-conversation-memory-mcp set dimensions 1024
|
|
294
|
-
|
|
295
|
-
# Switch to Transformers.js (offline, no setup)
|
|
296
|
-
claude-conversation-memory-mcp set provider transformers
|
|
297
|
-
claude-conversation-memory-mcp set model Xenova/all-MiniLM-L6-v2
|
|
298
|
-
claude-conversation-memory-mcp set dimensions 384
|
|
299
|
-
|
|
300
|
-
# Get specific config value
|
|
301
|
-
claude-conversation-memory-mcp get provider
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### Available Commands
|
|
305
|
-
|
|
306
|
-
- **π₯ Indexing**: `index`, `reindex`, `index-all` (NEW)
|
|
307
|
-
- **π Search**: `search`, `search-all` (NEW), `decisions`, `mistakes`, `similar`
|
|
308
|
-
- **π Files**: `check`, `history`
|
|
309
|
-
- **π Git**: `commits`
|
|
310
|
-
- **π Other**: `requirements`, `tools`, `docs`
|
|
311
|
-
- **βΉοΈ Info**: `status`, `version`, `help`
|
|
312
|
-
- **βοΈ Config**: `config`, `get`, `set`
|
|
313
|
-
- **π§Ή Maintenance**: `vacuum`, `reset`
|
|
314
|
-
|
|
315
|
-
**π See [Complete CLI Guide](docs/CLI-USAGE.md) for all commands, examples, and workflows**
|
|
316
|
-
|
|
317
|
-
## π― Usage Examples
|
|
318
|
-
|
|
319
|
-
### First Time Setup - Single Project
|
|
320
|
-
|
|
321
|
-
```
|
|
322
|
-
You: "Index my conversation history for this project"
|
|
323
|
-
|
|
324
|
-
Claude: I'll index all conversations for this project...
|
|
325
|
-
β Indexed 5 conversations with 2,341 messages
|
|
326
|
-
β Semantic search enabled (embeddings generated)
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### First Time Setup - All Projects + Codex β¨ NEW
|
|
330
|
-
|
|
331
|
-
```
|
|
332
|
-
You: "Index all my projects including Codex conversations"
|
|
333
|
-
|
|
334
|
-
Claude: I'll index all projects from both Claude Code and Codex...
|
|
335
|
-
β Indexed 3 Claude Code projects (47 conversations)
|
|
336
|
-
β Indexed Codex sessions (128 conversations)
|
|
337
|
-
β Global index created at ~/.claude/.claude-global-index.db
|
|
338
|
-
β Total: 175 conversations across 4 projects
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
### Search Across All Projects β¨ NEW
|
|
342
|
-
|
|
343
|
-
```
|
|
344
|
-
You: "Search all my conversations about authentication"
|
|
345
|
-
|
|
346
|
-
Claude: Searching across 4 indexed projects...
|
|
347
|
-
Found 12 results:
|
|
348
|
-
β’ Project: my-api (claude-code) - 5 conversations
|
|
349
|
-
β’ Project: mobile-app (claude-code) - 3 conversations
|
|
350
|
-
β’ Project: Codex (codex) - 4 conversations
|
|
351
|
-
[Returns relevant messages with project context]
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
### Search Within Current Project
|
|
355
|
-
|
|
356
|
-
```
|
|
357
|
-
You: "What did we discuss about the authentication system?"
|
|
358
|
-
|
|
359
|
-
Claude: Let me search our conversation history for this project...
|
|
360
|
-
[Returns relevant messages with context and timestamps]
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
### Before Modifying Files
|
|
364
|
-
|
|
365
|
-
```
|
|
366
|
-
You: "Before I change database.ts, what should I know?"
|
|
367
|
-
|
|
368
|
-
Claude: Let me check the context for database.ts...
|
|
369
|
-
[Shows recent changes, related decisions, and past mistakes]
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
### Track Decisions
|
|
373
|
-
|
|
374
|
-
```
|
|
375
|
-
You: "Why did we choose SQLite over PostgreSQL?"
|
|
376
|
-
|
|
377
|
-
Claude: Let me check our decision history...
|
|
378
|
-
[Returns the decision with rationale and alternatives considered]
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### Learn from Mistakes
|
|
382
|
-
|
|
383
|
-
```
|
|
384
|
-
You: "Have we had issues with async/await before?"
|
|
385
|
-
|
|
386
|
-
Claude: Let me search past mistakes...
|
|
387
|
-
[Shows previous errors and how they were fixed]
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
### Find Related Work Across Projects β¨ NEW
|
|
391
|
-
|
|
392
|
-
```
|
|
393
|
-
You: "Search all projects for similar API endpoint implementations"
|
|
394
|
-
|
|
395
|
-
Claude: Searching across all indexed projects...
|
|
396
|
-
Found similar work in:
|
|
397
|
-
β’ Project A: REST API design patterns
|
|
398
|
-
β’ Project B: GraphQL endpoint structure
|
|
399
|
-
β’ Codex: API versioning approach
|
|
400
|
-
[Returns relevant sessions from multiple projects]
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
### View File History
|
|
404
|
-
|
|
405
|
-
```
|
|
406
|
-
You: "Show me how auth.ts evolved over time"
|
|
407
|
-
|
|
408
|
-
Claude: Let me trace the file evolution...
|
|
409
|
-
[Shows complete timeline with conversations, commits, and decisions]
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Recall and Apply Context
|
|
413
|
-
|
|
414
|
-
```
|
|
415
|
-
You: "Recall how we implemented authentication, now add OAuth support using that same pattern"
|
|
416
|
-
|
|
417
|
-
Claude: Let me recall the authentication implementation context...
|
|
418
|
-
[Returns relevant conversations, decisions, mistakes, file changes, and commits]
|
|
419
|
-
[Provides suggestions for applying this context to OAuth implementation]
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
**More examples:**
|
|
423
|
-
- "Remember the bug we fixed in parser.ts, check if similar issue exists in lexer.ts"
|
|
424
|
-
- "Recall all decisions about database schema, now design the migration strategy"
|
|
425
|
-
- "Find mistakes we made with async/await, avoid them in this new async function"
|
|
426
|
-
- "Search all my projects for how I handled error boundaries" β¨ NEW
|
|
427
|
-
|
|
428
|
-
## π§ Advanced Usage
|
|
429
|
-
|
|
430
|
-
### Global Indexing Options β¨ NEW
|
|
431
|
-
|
|
432
|
-
#### Index All Projects
|
|
433
|
-
|
|
434
|
-
```
|
|
435
|
-
You: "Index all my projects from Claude Code and Codex"
|
|
436
|
-
|
|
437
|
-
# With options:
|
|
438
|
-
You: "Index all projects, include Codex at /custom/path/.codex, exclude MCP conversations"
|
|
439
120
|
```
|
|
440
121
|
|
|
441
|
-
|
|
442
|
-
- `include_codex` (default: true) - Index Codex sessions
|
|
443
|
-
- `include_claude_code` (default: true) - Index Claude Code projects
|
|
444
|
-
- `codex_path` - Custom Codex location (default: `~/.codex`)
|
|
445
|
-
- `claude_projects_path` - Custom Claude Code projects location (default: `~/.claude/projects`)
|
|
122
|
+
## Supported Platforms
|
|
446
123
|
|
|
447
|
-
|
|
124
|
+
| Platform | Status | Location |
|
|
125
|
+
|----------|--------|----------|
|
|
126
|
+
| Claude Code | Supported | `~/.claude/projects/` |
|
|
127
|
+
| Codex | Supported | `~/.codex/sessions/` |
|
|
128
|
+
| Claude Desktop | Not supported | Different format |
|
|
448
129
|
|
|
449
|
-
|
|
450
|
-
You: "Search only Claude Code projects for authentication"
|
|
451
|
-
# source_type: "claude-code"
|
|
452
|
-
|
|
453
|
-
You: "Search only Codex sessions for database design"
|
|
454
|
-
# source_type: "codex"
|
|
455
|
-
|
|
456
|
-
You: "Search all sources for error handling"
|
|
457
|
-
# source_type: "all" (default)
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### Index Specific Session
|
|
461
|
-
|
|
462
|
-
```
|
|
463
|
-
You: "Index conversation from session a1172af3-ca62-41be-9b90-701cef39daae"
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
### Exclude MCP Conversations
|
|
467
|
-
|
|
468
|
-
By default, conversations about the MCP itself are excluded to prevent self-referential loops. To include them:
|
|
469
|
-
|
|
470
|
-
```
|
|
471
|
-
You: "Index all conversations, including MCP conversations"
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
### Indexing Options
|
|
475
|
-
|
|
476
|
-
When indexing conversations, several options control what gets stored:
|
|
477
|
-
|
|
478
|
-
#### Include Thinking Blocks
|
|
479
|
-
|
|
480
|
-
**Default**: `false` (thinking blocks are excluded)
|
|
481
|
-
|
|
482
|
-
Thinking blocks contain Claude's internal reasoning process. They can be **very large** (3-5x more data) and are usually not needed for search.
|
|
483
|
-
|
|
484
|
-
```
|
|
485
|
-
# Default behavior (recommended)
|
|
486
|
-
You: "Index conversations"
|
|
487
|
-
# Thinking blocks are excluded
|
|
488
|
-
|
|
489
|
-
# Include thinking blocks (increases database size significantly)
|
|
490
|
-
You: "Index conversations with thinking blocks"
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
**When to enable**:
|
|
494
|
-
- β
You want to search Claude's reasoning process
|
|
495
|
-
- β
You're analyzing decision-making patterns
|
|
496
|
-
- β Don't enable if you just want to search visible conversation content
|
|
497
|
-
|
|
498
|
-
#### Exclude MCP Conversations
|
|
499
|
-
|
|
500
|
-
**Default**: `"self-only"` (excludes only conversation-memory MCP calls)
|
|
501
|
-
|
|
502
|
-
Controls which MCP tool interactions are indexed:
|
|
503
|
-
|
|
504
|
-
- `"self-only"` (default): Excludes messages about this conversation-memory MCP to prevent self-referential loops
|
|
505
|
-
- `false`: Index all MCP tool calls from all servers
|
|
506
|
-
- `"all-mcp"` or `true`: Exclude all MCP tool calls from all servers
|
|
507
|
-
- `["server1", "server2"]`: Exclude specific MCP servers
|
|
508
|
-
|
|
509
|
-
```
|
|
510
|
-
# Default - exclude only conversation-memory MCP
|
|
511
|
-
You: "Index conversations"
|
|
512
|
-
|
|
513
|
-
# Include all MCP conversations (including this one)
|
|
514
|
-
You: "Index conversations, include all MCP tools"
|
|
515
|
-
|
|
516
|
-
# Exclude all MCP tool calls
|
|
517
|
-
You: "Index conversations, exclude all MCP interactions"
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
**What gets filtered**: Only the specific **messages** that invoke MCP tools are excluded, not entire conversations. This preserves conversation context while preventing self-referential loops.
|
|
521
|
-
|
|
522
|
-
#### Enable Git Integration
|
|
523
|
-
|
|
524
|
-
**Default**: `true` (git commits are linked)
|
|
525
|
-
|
|
526
|
-
Links git commits to conversations based on timestamps and file changes.
|
|
527
|
-
|
|
528
|
-
```
|
|
529
|
-
# Default behavior
|
|
530
|
-
You: "Index conversations"
|
|
531
|
-
# Git commits are automatically linked
|
|
532
|
-
|
|
533
|
-
# Disable git integration
|
|
534
|
-
You: "Index conversations without git integration"
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
#### Index Output
|
|
538
|
-
|
|
539
|
-
After indexing, you'll see:
|
|
540
|
-
|
|
541
|
-
```
|
|
542
|
-
π Indexed from: /path/to/modern-folder, /path/to/legacy-folder
|
|
543
|
-
πΎ Database: /path/to/.claude-conversations-memory.db
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
For global indexing:
|
|
547
|
-
|
|
548
|
-
```
|
|
549
|
-
π Global index: ~/.claude/.claude-global-index.db
|
|
550
|
-
π Indexed 4 projects:
|
|
551
|
-
β’ 2 Claude Code projects
|
|
552
|
-
β’ 1 Codex project
|
|
553
|
-
πΎ Total: 175 conversations, 8,432 messages
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
This shows:
|
|
557
|
-
- **Indexed folders**: Which conversation folders were used (including legacy if it exists)
|
|
558
|
-
- **Database locations**: Where your indexed data is stored (per-project + global)
|
|
559
|
-
- **Statistics**: Total counts across all sources
|
|
560
|
-
|
|
561
|
-
### Search with Date Filters
|
|
562
|
-
|
|
563
|
-
```
|
|
564
|
-
You: "What were we working on last week?"
|
|
565
|
-
You: "Search all projects for discussions from January 2025"
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
### Generate Documentation
|
|
569
|
-
|
|
570
|
-
```
|
|
571
|
-
You: "Generate project documentation from our conversations"
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
Claude will create comprehensive docs combining code analysis with conversation history.
|
|
575
|
-
|
|
576
|
-
### Migrate Conversation History
|
|
577
|
-
|
|
578
|
-
When you rename or move a project directory, your conversation history becomes inaccessible because Claude Code creates a new folder for the new path. Use the migration tools to recover your history:
|
|
579
|
-
|
|
580
|
-
**Step 1: Discover old conversation folders**
|
|
581
|
-
|
|
582
|
-
```
|
|
583
|
-
You: "Discover old conversations for this project"
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
Claude will scan `~/.claude/projects/` and show you folders that match your current project, ranked by similarity score. The output includes:
|
|
587
|
-
- Folder name and path
|
|
588
|
-
- Original project path stored in the database
|
|
589
|
-
- Number of conversations and files
|
|
590
|
-
- Last activity timestamp
|
|
591
|
-
- Similarity score (higher = better match)
|
|
592
|
-
|
|
593
|
-
**Step 2: Migrate the history**
|
|
594
|
-
|
|
595
|
-
```
|
|
596
|
-
You: "Migrate conversations from /Users/name/.claude/projects/-old-project-name, old path was /Users/name/old-project, new path is /Users/name/new-project"
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
Claude will:
|
|
600
|
-
- Copy all conversation JSONL files to the new location
|
|
601
|
-
- Update the `project_path` in the database
|
|
602
|
-
- Create automatic backups (`.claude-conversations-memory.db.bak`)
|
|
603
|
-
- Preserve all original data (copy, not move)
|
|
604
|
-
|
|
605
|
-
**Example workflow:**
|
|
606
|
-
|
|
607
|
-
```markdown
|
|
608
|
-
# You renamed your project directory
|
|
609
|
-
# Old: /Users/alice/code/my-app
|
|
610
|
-
# New: /Users/alice/code/my-awesome-app
|
|
611
|
-
|
|
612
|
-
You: "Discover old conversations for this project"
|
|
613
|
-
|
|
614
|
-
Claude: Found 1 potential old conversation folder:
|
|
615
|
-
- Folder: -Users-alice-code-my-app
|
|
616
|
-
- Original path: /Users/alice/code/my-app
|
|
617
|
-
- Conversations: 15
|
|
618
|
-
- Files: 47
|
|
619
|
-
- Score: 95.3
|
|
620
|
-
|
|
621
|
-
You: "Migrate from /Users/alice/.claude/projects/-Users-alice-code-my-app, old path /Users/alice/code/my-app, new path /Users/alice/code/my-awesome-app"
|
|
130
|
+
## Architecture
|
|
622
131
|
|
|
623
|
-
Claude: Successfully migrated 47 conversation files.
|
|
624
|
-
Now you can index and search your full history!
|
|
625
132
|
```
|
|
626
|
-
|
|
627
|
-
**Dry run mode:**
|
|
628
|
-
|
|
629
|
-
Test the migration without making changes:
|
|
630
|
-
|
|
631
|
-
```
|
|
632
|
-
You: "Dry run: migrate from [source] old path [old] new path [new]"
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
This shows what would be migrated without actually copying files.
|
|
636
|
-
|
|
637
|
-
### Merge Conversations from Different Projects
|
|
638
|
-
|
|
639
|
-
Combine conversation history from different projects into one folder using merge mode.
|
|
640
|
-
|
|
641
|
-
**Use case**: You want to merge conversations from `/project-a/drafts/2025-01-05` into your current project `/project-b`.
|
|
642
|
-
|
|
643
|
-
**Step 1: Discover the source folder**
|
|
644
|
-
|
|
645
|
-
```
|
|
646
|
-
You: "Discover old conversations for project path /Users/name/project-a/drafts/2025-01-05"
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
**Step 2: Merge into current project**
|
|
650
|
-
|
|
651
|
-
```
|
|
652
|
-
You: "Merge conversations from /Users/name/.claude/projects/-project-a-drafts-2025-01-05, old path /Users/name/project-a/drafts/2025-01-05, new path /Users/name/project-b, mode merge"
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
Claude will:
|
|
656
|
-
- Copy only **new** conversation files (skip duplicates)
|
|
657
|
-
- Keep target conversations when IDs collide (no data loss)
|
|
658
|
-
- Merge all database entries using INSERT OR IGNORE
|
|
659
|
-
- Create backup of target database before merge
|
|
660
|
-
- Preserve all original source data
|
|
661
|
-
|
|
662
|
-
**Example workflow:**
|
|
663
|
-
|
|
664
|
-
```markdown
|
|
665
|
-
# Scenario: You have conversations from different projects to combine
|
|
666
|
-
|
|
667
|
-
Current project: /Users/alice/main-project (already has 20 conversations)
|
|
668
|
-
Source project: /Users/alice/drafts/experiment (has 10 conversations, 3 overlap with main)
|
|
669
|
-
|
|
670
|
-
You: "Discover old conversations for /Users/alice/drafts/experiment"
|
|
671
|
-
|
|
672
|
-
Claude: Found 1 folder:
|
|
673
|
-
- Folder: -Users-alice-drafts-experiment
|
|
674
|
-
- Original path: /Users/alice/drafts/experiment
|
|
675
|
-
- Conversations: 10
|
|
676
|
-
- Files: 10
|
|
677
|
-
|
|
678
|
-
You: "Merge from /Users/alice/.claude/projects/-Users-alice-drafts-experiment, old path /Users/alice/drafts/experiment, new path /Users/alice/main-project, mode merge"
|
|
679
|
-
|
|
680
|
-
Claude: Successfully merged 7 new conversation files into /Users/alice/.claude/projects/-Users-alice-main-project
|
|
681
|
-
(3 duplicate conversations were skipped to preserve target data)
|
|
682
|
-
Backup created at: .claude-conversations-memory.db.bak
|
|
683
|
-
|
|
684
|
-
# Result: main-project now has 27 conversations (20 original + 7 new from experiment)
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
**Key differences between migrate and merge:**
|
|
688
|
-
|
|
689
|
-
| Feature | Migrate Mode (default) | Merge Mode |
|
|
690
|
-
|---------|----------------------|------------|
|
|
691
|
-
| Target has data | β Rejected (conflict) | β
Allowed |
|
|
692
|
-
| Duplicate IDs | Overwrites target | Skips source (keeps target) |
|
|
693
|
-
| Use case | Renamed project | Combine different projects |
|
|
694
|
-
| Backup location | Source folder | Target folder |
|
|
695
|
-
|
|
696
|
-
### Forget Conversations by Topic
|
|
697
|
-
|
|
698
|
-
You can selectively delete conversations about specific topics or keywords. The tool automatically creates a backup before deletion.
|
|
699
|
-
|
|
700
|
-
**Step 1: Preview what would be deleted**
|
|
701
|
-
|
|
702
|
-
```
|
|
703
|
-
You: "Show me conversations about authentication redesign"
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
Claude will use `forget_by_topic` with `confirm=false` to preview:
|
|
707
|
-
```
|
|
708
|
-
Found 3 conversations (45 messages, 8 decisions, 2 mistakes) matching: authentication, redesign
|
|
709
|
-
|
|
710
|
-
Conversations:
|
|
711
|
-
- 2024-01-15: Session abc123 (15 messages)
|
|
712
|
-
- 2024-01-18: Session def456 (20 messages)
|
|
713
|
-
- 2024-01-20: Session ghi789 (10 messages)
|
|
714
|
-
|
|
715
|
-
Set confirm=true to delete these conversations.
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
**Step 2: Confirm deletion**
|
|
719
|
-
|
|
720
|
-
```
|
|
721
|
-
You: "Yes, forget all conversations about authentication redesign"
|
|
722
|
-
```
|
|
723
|
-
|
|
724
|
-
Claude will use `forget_by_topic` with `confirm=true`:
|
|
725
|
-
```
|
|
726
|
-
β Backup created: ~/.claude/backups/my-project/backup-20250107-143022.json
|
|
727
|
-
β Deleted 3 conversations (45 messages, 8 decisions, 2 mistakes)
|
|
728
|
-
β Git commits preserved (only unlinked)
|
|
729
|
-
```
|
|
730
|
-
|
|
731
|
-
**Safety features:**
|
|
732
|
-
- **Automatic backup** - Data exported to JSON before deletion
|
|
733
|
-
- **Preview mode** - Always shows what would be deleted first
|
|
734
|
-
- **Cascading deletion** - Automatically removes messages, decisions, mistakes, embeddings
|
|
735
|
-
- **Git preservation** - Git commits are unlinked but not deleted
|
|
736
|
-
|
|
737
|
-
**β οΈ Important Notes:**
|
|
738
|
-
- Deletion is irreversible (even with backups, restoration requires manual work)
|
|
739
|
-
- Backups are stored in `~/.claude/backups/{project-name}/`
|
|
740
|
-
- Keywords are matched using semantic + full-text search
|
|
741
|
-
- All related data (messages, decisions, mistakes) is deleted
|
|
742
|
-
|
|
743
|
-
**Example keywords:**
|
|
744
|
-
- "authentication", "redesign" - Broad topics
|
|
745
|
-
- "bug in parser" - Specific issues
|
|
746
|
-
- "refactoring", "cleanup" - Development phases
|
|
747
|
-
|
|
748
|
-
## ποΈ Architecture
|
|
749
|
-
|
|
750
|
-
### Hybrid Database Design
|
|
751
|
-
|
|
752
|
-
The MCP uses a **hybrid architecture** combining per-project isolation with global search capability:
|
|
753
|
-
|
|
754
|
-
```
|
|
755
|
-
Per-Project Databases (Isolation & Speed)
|
|
133
|
+
Per-Project Databases (isolation)
|
|
756
134
|
βββ ~/.claude/projects/{project}/.claude-conversations-memory.db
|
|
757
|
-
βββ ~/.claude/projects/{another-project}/.claude-conversations-memory.db
|
|
758
135
|
βββ ~/.codex/.codex-conversations-memory.db
|
|
759
136
|
|
|
760
|
-
Global Registry (
|
|
137
|
+
Global Registry (cross-project search)
|
|
761
138
|
βββ ~/.claude/.claude-global-index.db
|
|
762
|
-
βββ Tracks all indexed projects
|
|
763
|
-
βββ Stores project metadata
|
|
764
|
-
βββ Enables global search coordination
|
|
765
139
|
```
|
|
766
140
|
|
|
767
|
-
|
|
768
|
-
- **Privacy**: Projects remain isolated unless you explicitly search globally
|
|
769
|
-
- **Performance**: Direct database access per project - no central bottleneck
|
|
770
|
-
- **Scalability**: Add unlimited projects without performance degradation
|
|
771
|
-
- **Flexibility**: Search single project OR all projects as needed
|
|
772
|
-
|
|
773
|
-
### Database Schema
|
|
774
|
-
|
|
775
|
-
Each project database contains:
|
|
776
|
-
- **conversations**: Session metadata with source_type ('claude-code' or 'codex')
|
|
777
|
-
- **messages**: Chat messages with semantic embeddings
|
|
778
|
-
- **decisions**: Extracted architectural decisions
|
|
779
|
-
- **mistakes**: Tracked errors and corrections
|
|
780
|
-
- **git_commits**: Linked git history
|
|
781
|
-
- **file_edits**: File modification tracking
|
|
782
|
-
- **thinking_blocks**: Claude's reasoning (optional)
|
|
783
|
-
|
|
784
|
-
The global index contains:
|
|
785
|
-
- **project_metadata**: Registry of all indexed projects
|
|
786
|
-
- **source_type**: Distinguishes claude-code vs codex
|
|
787
|
-
- **aggregate stats**: Total conversations, messages, decisions, mistakes
|
|
788
|
-
|
|
789
|
-
## π Learn More
|
|
790
|
-
|
|
791
|
-
- **[Tool Examples](docs/TOOL-EXAMPLES.md)** - 50+ natural language examples for each tool (including new global search tools)
|
|
792
|
-
- **[Quick Reference](docs/QUICK-REFERENCE.md)** - Common phrases cheat sheet
|
|
793
|
-
- **[Embeddings FAQ](docs/EMBEDDINGS-FAQ.md)** - How semantic search works
|
|
794
|
-
- **[Functional Matrix](docs/FUNCTIONAL-MATRIX.md)** - Complete feature coverage
|
|
795
|
-
|
|
796
|
-
## π Troubleshooting
|
|
797
|
-
|
|
798
|
-
### "No conversations found"
|
|
799
|
-
|
|
800
|
-
Make sure you're running this in a directory where you've had Claude Code CLI conversations. Check `~/.claude/projects/` to verify conversation files exist.
|
|
801
|
-
|
|
802
|
-
For Codex: Check `~/.codex/sessions/` for session files.
|
|
803
|
-
|
|
804
|
-
### "Embeddings failed"
|
|
805
|
-
|
|
806
|
-
The MCP falls back to full-text search if embeddings fail. Everything still works, just without semantic search.
|
|
807
|
-
|
|
808
|
-
### "MCP not responding"
|
|
809
|
-
|
|
810
|
-
Restart Claude Code CLI to reload the MCP server.
|
|
811
|
-
|
|
812
|
-
### "Global index not found"
|
|
813
|
-
|
|
814
|
-
Run `index_all_projects` first to create the global registry before using cross-project search.
|
|
815
|
-
|
|
816
|
-
## π License
|
|
817
|
-
|
|
818
|
-
MIT License - See [LICENSE](LICENSE) file for details.
|
|
819
|
-
|
|
820
|
-
## π Acknowledgments
|
|
821
|
-
|
|
822
|
-
Inspired by [code-graph-rag-mcp](https://github.com/er77/code-graph-rag-mcp).
|
|
823
|
-
|
|
824
|
-
---
|
|
141
|
+
## License
|
|
825
142
|
|
|
826
|
-
|
|
143
|
+
MIT
|