@colbymchenry/cmem 0.2.20
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.
Potentially problematic release.
This version of @colbymchenry/cmem might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +219 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +3197 -0
- package/dist/cli.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Colby Mchenry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# π§ cmem
|
|
4
|
+
|
|
5
|
+
### Your Claude Code Conversations, Remembered Forever
|
|
6
|
+
|
|
7
|
+
**Don't just explore your code or foldersβexplore your conversations, or pick up where you left off.**
|
|
8
|
+
|
|
9
|
+
**Semantic search β’ Auto-sync β’ 100% local**
|
|
10
|
+
|
|
11
|
+
[](https://opensource.org/licenses/MIT)
|
|
12
|
+
[](https://nodejs.org/)
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
### Get Started
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @colbymchenry/cmem
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
<sub>Interactive installer configures Claude Code automatically</sub>
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
Ever closed your terminal and lost that perfect Claude conversation? The one where you finally figured out that tricky bug, or designed that elegant architecture?
|
|
29
|
+
|
|
30
|
+
**cmem** gives Claude Code a long-term memory. Every conversation is automatically saved, indexed, and searchableβso you (and Claude) can pick up right where you left off.
|
|
31
|
+
|
|
32
|
+
### MCP Integration
|
|
33
|
+
|
|
34
|
+
> **Using CMEM MCP to fetch conversational data about previous chat sessions**
|
|
35
|
+
>
|
|
36
|
+
> Claude can search through your conversation history and synthesize answersβall without cluttering your main session context.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Session Navigation
|
|
43
|
+
|
|
44
|
+
> **Easily navigate between previous chat sessions and pick back up right where you left off**
|
|
45
|
+
>
|
|
46
|
+
> Browse, search, filter, rename, and restore any conversation with the interactive TUI.
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
#### Open all previous chat sessions in current directory
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Why cmem?
|
|
56
|
+
|
|
57
|
+
π§ **Sub-Agent Summarization** β When Claude needs context from past sessions, cmem spawns a separate Claude instance to read and synthesizeβkeeping your main conversation context clean. Just like Explore agents, but for your conversation history.
|
|
58
|
+
|
|
59
|
+
π **Semantic Search** β Find conversations by meaning, not keywords. "That React hooks discussion" or "the database migration plan" just works.
|
|
60
|
+
|
|
61
|
+
π€ **Claude Can Remember** β Via MCP integration, Claude can search your past conversations. "What did we decide about auth last week?" Finally, context that persists.
|
|
62
|
+
|
|
63
|
+
π **Automatic Sync** β A background daemon watches your Claude Code sessions and keeps everything indexed in real-time.
|
|
64
|
+
|
|
65
|
+
π¦ **100% Local & Private** β Everything runs on your machine. No cloud services, no API keys, no external servers. Just SQLite + local AI embeddings.
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx @colbymchenry/cmem
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The setup wizard will:
|
|
74
|
+
1. Install `cmem` globally
|
|
75
|
+
2. Download the embedding model (~130MB, one-time)
|
|
76
|
+
3. Optionally set up auto-sync on login (macOS)
|
|
77
|
+
4. Configure MCP server in `~/.claude.json` + permissions in `~/.claude/settings.json`
|
|
78
|
+
|
|
79
|
+
That's it. Your conversations are now being remembered.
|
|
80
|
+
|
|
81
|
+
## Requirements
|
|
82
|
+
|
|
83
|
+
- **Node.js 18+**
|
|
84
|
+
|
|
85
|
+
No other dependencies. The AI embedding model downloads automatically on first use and runs entirely in Node.js.
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cmem # Browse sessions in beautiful TUI
|
|
91
|
+
cmem --local # Browse sessions from current folder only
|
|
92
|
+
cmem search "query" # Semantic search across all conversations
|
|
93
|
+
cmem watch # Start the sync daemon
|
|
94
|
+
cmem stats # See what's stored
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## How It Works
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Claude Code sessions β cmem watch daemon β SQLite + Vector DB
|
|
101
|
+
β
|
|
102
|
+
Claude Code β MCP Server β Semantic Search
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
1. **Watch**: The daemon monitors `~/.claude/` for new/changed sessions
|
|
106
|
+
2. **Index**: Conversations are parsed and embedded locally using `nomic-embed-text-v1.5`
|
|
107
|
+
3. **Search**: Query by meaning using vector similarity
|
|
108
|
+
4. **Remember**: Claude can access past conversations via MCP tools
|
|
109
|
+
|
|
110
|
+
### Background Daemon
|
|
111
|
+
|
|
112
|
+
The `cmem watch` daemon runs in the background and automatically syncs your Claude Code sessions:
|
|
113
|
+
|
|
114
|
+
- **With daemon installed**: Sessions sync automatically whenever you use Claude Code
|
|
115
|
+
- **Without daemon**: Run `cmem watch` manually, or sessions sync when you open the TUI
|
|
116
|
+
|
|
117
|
+
On macOS, you can install the daemon to start automatically on login:
|
|
118
|
+
```bash
|
|
119
|
+
cmem install # Enable auto-start
|
|
120
|
+
cmem uninstall # Disable auto-start
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## MCP Tools
|
|
124
|
+
|
|
125
|
+
Once configured, Claude Code gains these abilities:
|
|
126
|
+
|
|
127
|
+
| Tool | What it does |
|
|
128
|
+
|------|--------------|
|
|
129
|
+
| `search_and_summarize` | **The star feature** β Ask a question, get an AI-synthesized answer from past sessions |
|
|
130
|
+
| `search_sessions` | Find sessions by semantic similarity |
|
|
131
|
+
| `list_sessions` | Browse recent sessions |
|
|
132
|
+
| `get_session` | Retrieve full conversation history |
|
|
133
|
+
| `get_session_context` | Get context to continue a past conversation |
|
|
134
|
+
|
|
135
|
+
### How `search_and_summarize` Works
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Main Claude Session cmem MCP Server
|
|
139
|
+
β β
|
|
140
|
+
β "What did we decide about auth?" β
|
|
141
|
+
βββββββββββββββββββββββββββββββββββββββββββββΊβ
|
|
142
|
+
β β
|
|
143
|
+
β ββββββββββ΄βββββββββ
|
|
144
|
+
β β 1. Vector search β
|
|
145
|
+
β β 2. Find sessions β
|
|
146
|
+
β β 3. Read content β
|
|
147
|
+
β ββββββββββ¬βββββββββ
|
|
148
|
+
β β
|
|
149
|
+
β ββββββββββ΄βββββββββ
|
|
150
|
+
β β Spawn Claude CLI β
|
|
151
|
+
β β (sub-agent) β
|
|
152
|
+
β β β
|
|
153
|
+
β β Reads sessions, β
|
|
154
|
+
β β synthesizes β
|
|
155
|
+
β β answer β
|
|
156
|
+
β ββββββββββ¬βββββββββ
|
|
157
|
+
β β
|
|
158
|
+
β "Based on your Jan 15 session, you β
|
|
159
|
+
β decided to use JWT with refresh..." β
|
|
160
|
+
ββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
161
|
+
β β
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This keeps your main context cleanβonly the concise summary comes back, not the raw session content. Uses Haiku by default for speed, configurable to Sonnet or Opus.
|
|
165
|
+
|
|
166
|
+
## Commands
|
|
167
|
+
|
|
168
|
+
| Command | Description |
|
|
169
|
+
|---------|-------------|
|
|
170
|
+
| `cmem` | Launch interactive TUI |
|
|
171
|
+
| `cmem --local` | Launch TUI filtered to current folder |
|
|
172
|
+
| `cmem setup` | Run setup wizard |
|
|
173
|
+
| `cmem search <query>` | Semantic search |
|
|
174
|
+
| `cmem list` | List all sessions |
|
|
175
|
+
| `cmem restore <id>` | Output session context |
|
|
176
|
+
| `cmem watch` | Start sync daemon |
|
|
177
|
+
| `cmem install` | Auto-start daemon on login (macOS) |
|
|
178
|
+
| `cmem uninstall` | Remove auto-start |
|
|
179
|
+
| `cmem stats` | Storage statistics |
|
|
180
|
+
| `cmem mcp` | Start MCP server |
|
|
181
|
+
|
|
182
|
+
## TUI Keyboard Shortcuts
|
|
183
|
+
|
|
184
|
+
| Key | Action |
|
|
185
|
+
|-----|--------|
|
|
186
|
+
| `β/β` or `j/k` | Navigate sessions |
|
|
187
|
+
| `Enter` | Resume selected session |
|
|
188
|
+
| `f` | Filter to selected session's folder |
|
|
189
|
+
| `r` | Rename selected session |
|
|
190
|
+
| `R` | Clear custom name |
|
|
191
|
+
| `d` | Delete session |
|
|
192
|
+
| `/` | Search |
|
|
193
|
+
| `q` | Quit |
|
|
194
|
+
|
|
195
|
+
## Data Storage
|
|
196
|
+
|
|
197
|
+
All data is stored locally in `~/.cmem/`:
|
|
198
|
+
- `sessions.db` β SQLite database with vector embeddings
|
|
199
|
+
- `models/` β Downloaded embedding model (~130MB)
|
|
200
|
+
|
|
201
|
+
Claude Code sessions are read from `~/.claude/`.
|
|
202
|
+
|
|
203
|
+
## Tech Stack
|
|
204
|
+
|
|
205
|
+
- **SQLite** + **sqlite-vec** β Embedded vector database
|
|
206
|
+
- **transformers.js** + **nomic-embed-text-v1.5** β Local AI embeddings (768 dimensions, runs in Node.js)
|
|
207
|
+
- **ink** β Beautiful terminal UI (React for CLI)
|
|
208
|
+
- **MCP** β Model Context Protocol for Claude integration
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
MIT
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
<p align="center">
|
|
217
|
+
<b>Stop losing your best conversations.</b><br>
|
|
218
|
+
<code>npx @colbymchenry/cmem</code>
|
|
219
|
+
</p>
|
package/dist/cli.d.ts
ADDED