claude-self-reflect 2.5.2 → 2.5.3

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.
Files changed (2) hide show
  1. package/README.md +81 -254
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -26,18 +26,9 @@ Your conversations become searchable. Your decisions stay remembered. Your conte
26
26
  - **Node.js** 16+ (for the setup wizard)
27
27
  - **Claude Desktop** app
28
28
 
29
- ## System Requirements
29
+ ## Quick Install
30
30
 
31
- ### Memory
32
- - **Docker Memory**: 2GB minimum (4GB recommended for initial setup)
33
- - **First Import**: May take 2-7 minutes to process all conversations
34
- - **Subsequent Imports**: <60 seconds (only processes new/changed files)
35
-
36
- 💡 **First-Time User Note**: The initial import processes your entire conversation history. This is a one-time operation. After that, the system only imports new conversations, making it much faster and using less memory.
37
-
38
- ## Install
39
-
40
- ### Quick Start (Local Mode - Default)
31
+ ### Local Mode (Default - Your Data Stays Private)
41
32
  ```bash
42
33
  # Install and run automatic setup
43
34
  npm install -g claude-self-reflect
@@ -50,8 +41,6 @@ claude-self-reflect setup
50
41
  # ✅ Start monitoring for new conversations
51
42
  # ✅ Verify the reflection tools work
52
43
  # 🔒 Keep all data local - no API keys needed
53
- # 🚀 Import watcher runs every 60 seconds
54
- # ⚡ Memory decay enabled by default (90-day half-life)
55
44
  ```
56
45
 
57
46
  ### Cloud Mode (Better Search Accuracy)
@@ -67,15 +56,6 @@ claude-self-reflect setup --voyage-key=YOUR_ACTUAL_KEY_HERE
67
56
 
68
57
  5 minutes. Everything automatic. Just works.
69
58
 
70
- ### 🔒 Privacy & Data Exchange
71
-
72
- | Mode | Data Storage | External API Calls | Data Sent | Search Quality |
73
- |------|--------------|-------------------|-----------|----------------|
74
- | **Local (Default)** | Your machine only | None | Nothing leaves your computer | Good - uses efficient local embeddings |
75
- | **Cloud (Opt-in)** | Your machine | Voyage AI | Conversation text for embedding generation | Better - uses state-of-the-art models |
76
-
77
- **Note**: Cloud mode sends conversation content to Voyage AI for processing. Review their [privacy policy](https://www.voyageai.com/privacy) before enabling.
78
-
79
59
  ## The Magic
80
60
 
81
61
  ![Self Reflection vs The Grind](docs/images/red-reflection.webp)
@@ -103,25 +83,65 @@ Claude: "3 conversations found:
103
83
  - Nov 20: Added rate limiting per authenticated connection"
104
84
  ```
105
85
 
106
- ## The Secret Sauce: Sub-Agents
107
-
108
- Here's what makes this magical: **The Reflection Specialist sub-agent**.
109
-
110
- When you ask about past conversations, Claude doesn't search in your main chat. Instead, it spawns a specialized sub-agent that:
111
- - Searches your conversation history in its own context
112
- - Brings back only the relevant results
113
- - Keeps your main conversation clean and focused
114
-
115
- **Your main context stays pristine**. No clutter. No token waste.
116
-
117
- ![Reflection Agent in Action](docs/images/Reflection-specialist.png)
118
-
119
- ## How It Works (10 Second Version)
86
+ ## How It Works
120
87
 
121
88
  Your conversations → Vector embeddings → Semantic search → Claude remembers
122
89
 
123
90
  Technical details exist. You don't need them to start.
124
91
 
92
+ ## Import Architecture
93
+
94
+ Here's how your conversations get imported and prioritized:
95
+
96
+ ```mermaid
97
+ flowchart TB
98
+ subgraph "Real-Time Import System"
99
+ NewFile([New/Modified<br/>Conversation]) --> Watcher{Streaming<br/>Watcher}
100
+
101
+ Watcher -->|Every 60s| Check[Check Files]
102
+ Check --> Priority{File Age?}
103
+
104
+ Priority -->|< 5 min| Hot[🔥 HOT<br/>2-sec mode]
105
+ Priority -->|< 24 hr| Warm[🌡️ WARM<br/>Normal]
106
+ Priority -->|> 24 hr| Cold[❄️ COLD<br/>Batch-5]
107
+
108
+ Hot --> FastMode[Fast Mode<br/>2-sec intervals<br/>Can interrupt]
109
+ Warm --> NormalMode[Normal Mode<br/>60-sec intervals]
110
+ Cold --> BatchMode[Batch Mode<br/>Max 5 files]
111
+
112
+ FastMode --> Import{Import<br/>Strategy}
113
+ NormalMode --> Import
114
+ BatchMode --> Import
115
+
116
+ Import -->|Never seen| Full[Baseline Import<br/>From start]
117
+ Import -->|Gap > 100 lines| Catchup[Catch-up Import<br/>From position]
118
+ Import -->|Small changes| Stream[Stream Import<br/>Continue]
119
+
120
+ Full --> Process[Process<br/>& Embed]
121
+ Catchup --> Process
122
+ Stream --> Process
123
+
124
+ Process --> Memory{Memory<br/>< 50MB?}
125
+ Memory -->|Yes| Store[(Qdrant<br/>Vector DB)]
126
+ Memory -->|No| GC[Garbage<br/>Collect]
127
+
128
+ GC --> Store
129
+ Store --> State[Update State]
130
+ State --> Wait[Wait for<br/>next cycle]
131
+ Wait --> Watcher
132
+
133
+ style Hot fill:#ff6b6b
134
+ style Warm fill:#ffd93d
135
+ style Cold fill:#6bcf7f
136
+ style FastMode stroke:#ff6b6b,stroke-width:3px
137
+ end
138
+ ```
139
+
140
+ **The system intelligently prioritizes your conversations:**
141
+ - **🔥 HOT** (< 5 minutes): Switches to 2-second intervals for near real-time import
142
+ - **🌡️ WARM** (< 24 hours): Normal priority, processed every 60 seconds
143
+ - **❄️ COLD** (> 24 hours): Batch processed, max 5 per cycle to prevent blocking
144
+
125
145
  ## Using It
126
146
 
127
147
  Once installed, just talk naturally:
@@ -132,54 +152,10 @@ Once installed, just talk naturally:
132
152
 
133
153
  The reflection specialist automatically activates. No special commands needed.
134
154
 
135
- ## Performance & Usage Guide
136
-
137
- ### 🚀 Lightning Fast Search
138
- Optimized to deliver results in **200-350ms** (10-40x faster than v2.4.4)
139
-
140
- ### 🎯 Recommended Usage: Through Reflection-Specialist Agent
141
-
142
- **Why use the agent instead of direct MCP tools?**
143
- - **Preserves your main conversation context** - Search results don't clutter your working memory
144
- - **Rich formatted responses** - Clean markdown instead of raw XML in your conversation
145
- - **Better user experience** - Real-time streaming feedback and progress indicators
146
- - **Proper tool counting** - Shows actual tool usage instead of "0 tool uses"
147
- - **Automatic cross-project search** - Agent suggests searching across projects when relevant
148
- - **Specialized search tools** - Access to quick_search, search_summary, and pagination
149
-
150
- **Context Preservation Benefit:**
151
- When you use the reflection-specialist agent, all the search results and processing happen in an isolated context. This means:
152
- - Your main conversation stays clean and focused
153
- - No XML dumps or raw data in your chat history
154
- - Multiple searches won't exhaust your context window
155
- - You get just the insights, not the implementation details
156
-
157
- **Example:**
158
- ```
159
- You: "What Docker issues did we solve?"
160
- [Claude automatically spawns reflection-specialist agent]
161
- ⏺ reflection-specialist(Search Docker issues)
162
- ⎿ Searching 57 collections...
163
- ⎿ Found 5 relevant conversations
164
- ⎿ Done (1 tool use · 12k tokens · 2.3s)
165
- [Returns clean, formatted insights without cluttering your context]
166
- ```
167
-
168
- ### ⚡ Performance Baselines
169
-
170
- | Method | Search Time | Total Time | Context Impact | Best For |
171
- |--------|------------|------------|----------------|----------|
172
- | Direct MCP | 200-350ms | 200-350ms | Uses main context | Programmatic use, when context space matters |
173
- | Via Agent | 200-350ms | 24-30s* | Isolated context | Interactive use, exploration, multiple searches |
174
-
175
- *Note: The 24-30s includes context preservation overhead, which keeps your main conversation clean
176
-
177
- **Note**: The specialized tools (`quick_search`, `search_summary`, `get_more_results`) only work through the reflection-specialist agent due to MCP protocol limitations.
178
-
179
155
  ## Key Features
180
156
 
181
157
  ### 🎯 Project-Scoped Search
182
- Searches are **project-aware by default** (v2.4.3+). Claude automatically searches within your current project:
158
+ Searches are **project-aware by default**. Claude automatically searches within your current project:
183
159
 
184
160
  ```
185
161
  # In ~/projects/MyApp
@@ -191,133 +167,23 @@ You: "Search all projects for WebSocket implementations"
191
167
  Claude: [Searches across ALL your projects]
192
168
  ```
193
169
 
194
- | Search Scope | How to Trigger | Example |
195
- |------------|----------------|---------|
196
- | Current Project (default) | Just ask normally | "What did we discuss about caching?" |
197
- | All Projects | Say "all projects" | "Search all projects for error handling" |
198
- | Specific Project | Name the project | "Find auth code in MyApp project" |
199
-
200
- ## Memory Decay
201
-
170
+ ### ⏱️ Memory Decay
202
171
  Recent conversations matter more. Old ones fade. Like your brain, but reliable.
203
172
 
204
- Works perfectly out of the box. [Configure if you're particular](docs/memory-decay.md).
205
-
206
- ## Theoretical Foundation
207
-
208
- Claude Self-Reflect addresses the "reality gap" in AI memory systems - the distance between perfect recall expectations and practical utility. Our approach aligns with the SPAR Framework (Sense, Plan, Act, Reflect) for agentic AI systems. [Learn more about our design philosophy](docs/architecture/SPAR-alignment.md).
173
+ ### 🚀 Performance
174
+ - **Search**: 200-350ms response time
175
+ - **Import**: 2-second response for new conversations
176
+ - **Memory**: 50MB operational target with smart chunking
209
177
 
210
- ## For the Skeptics
211
-
212
- **"Just use grep"** - Sure, enjoy your 10,000 matches for "database"
213
- **"Overengineered"** - Two functions: store_reflection, reflect_on_past
214
- **"Another vector DB"** - Yes, because semantic > string matching
215
-
216
- Built by developers tired of re-explaining context every conversation.
217
-
218
- ## Requirements
219
-
220
- - Claude Code or Claude Desktop
221
- - Docker Desktop (macOS/Windows) or Docker Engine (Linux)
222
- - Node.js 16+ (for the setup wizard only)
223
- - 5 minutes for setup
224
-
225
- ## Upgrading from Earlier Versions
226
-
227
- **v2.4.0+ includes major improvements:**
228
- - **Docker-Only Setup**: No more Python environment issues!
229
- - **Privacy First**: Local embeddings by default - your data never leaves your machine
230
- - **Smarter Setup**: Handles existing installations gracefully
231
- - **Better Security**: Automated vulnerability scanning
232
- - **Real-Time Import**: Watcher checks for new conversations every 60 seconds
233
- - **Fixed MCP Server**: Now uses correct server implementation with local embedding support
234
-
235
- **To upgrade:**
236
- ```bash
237
- npm update -g claude-self-reflect
238
- claude-self-reflect setup # Re-run setup, it handles everything
239
- ```
240
-
241
- The setup wizard now detects and fixes common upgrade issues automatically. Your existing conversations remain searchable.
242
-
243
- ## Advanced Setup
244
-
245
- Want to customize? See [Configuration Guide](docs/installation-guide.md).
246
-
247
- ## The Technical Stuff
248
-
249
- If you must know:
178
+ ## The Technical Stack
250
179
 
251
180
  - **Vector DB**: Qdrant (local, your data stays yours)
252
181
  - **Embeddings**:
253
- - Local (Default): FastEmbed with sentence-transformers/all-MiniLM-L6-v2
254
- - Cloud (Optional): Voyage AI (200M free tokens/month)
182
+ - Local (Default): FastEmbed with all-MiniLM-L6-v2
183
+ - Cloud (Optional): Voyage AI
255
184
  - **MCP Server**: Python + FastMCP
256
185
  - **Search**: Semantic similarity with time decay
257
186
 
258
- Both embedding options work well. Local mode uses FastEmbed for privacy and offline use. Cloud mode uses Voyage AI for enhanced accuracy when internet is available. We are not affiliated with Voyage AI.
259
-
260
- ### Want More Details?
261
-
262
- - [Architecture Deep Dive](docs/architecture-details.md) - How it actually works
263
- - [Components Guide](docs/components.md) - Each piece explained
264
- - [Why We Built This](docs/motivation-and-history.md) - The full story
265
- - [Advanced Usage](docs/advanced-usage.md) - Power user features
266
-
267
- ## Security
268
-
269
- ### Container Security Notice
270
- ⚠️ **Known Vulnerabilities**: Our Docker images are continuously monitored by Snyk and may show vulnerabilities in base system libraries. We want to be transparent about this:
271
-
272
- - **Why they exist**: We use official Python Docker images based on Debian stable, which prioritizes stability over latest versions
273
- - **Actual risk is minimal** because:
274
- - Most CVEs are in unused system libraries or require local access
275
- - Security patches are backported by Debian (version numbers don't reflect patches)
276
- - Our containers run as non-root users with minimal permissions
277
- - This is a local-only tool with no network exposure
278
- - **What we're doing**: Regular updates, security monitoring, and evaluating alternative base images
279
-
280
- **For production or security-sensitive environments**, consider:
281
- - Building your own hardened images
282
- - Running with additional security constraints (see below)
283
- - Evaluating if the tool meets your security requirements
284
-
285
- For maximum security:
286
- ```bash
287
- # Run containers with read-only root filesystem
288
- docker run --read-only --tmpfs /tmp claude-self-reflect
289
- ```
290
-
291
- ### Privacy & Data Security
292
- - **Local by default**: Your conversations never leave your machine unless you explicitly enable cloud embeddings
293
- - **No telemetry**: We don't track usage or collect any data
294
- - **Secure storage**: All data stored in Docker volumes with proper permissions
295
- - **API keys**: Stored in .env file with 600 permissions (read/write by owner only)
296
-
297
- See our [Security Policy](SECURITY.md) for vulnerability reporting and more details.
298
-
299
- ## ⚠️ Important Disclaimers
300
-
301
- ### Tool Operation
302
- - **Resource Usage**: The import process can be CPU and memory intensive, especially during initial import of large conversation histories
303
- - **Data Processing**: This tool reads and indexes your Claude conversation files. Ensure you have adequate disk space
304
- - **No Warranty**: This software is provided "AS IS" under the MIT License, without warranty of any kind
305
- - **Data Responsibility**: You are responsible for your conversation data and any API keys used
306
-
307
- ### Limitations
308
- - **Not Official**: This is a community tool, not officially supported by Anthropic
309
- - **Experimental Features**: Some features like memory decay are experimental and may change
310
- - **Import Delays**: Large conversation histories may take significant time to import initially
311
- - **Docker Dependency**: Requires Docker to be running, which uses system resources
312
-
313
- ### Best Practices
314
- - **Backup Your Data**: Always maintain backups of important conversations
315
- - **Monitor Resources**: Check Docker resource usage if you experience system slowdowns
316
- - **Test First**: Try with a small subset of conversations before full import
317
- - **Review Logs**: Check import logs if conversations seem missing
318
-
319
- By using this tool, you acknowledge these disclaimers and limitations.
320
-
321
187
  ## Problems?
322
188
 
323
189
  - [Troubleshooting Guide](docs/troubleshooting.md)
@@ -326,69 +192,30 @@ By using this tool, you acknowledge these disclaimers and limitations.
326
192
 
327
193
  ## What's New
328
194
 
329
- ### Recent Updates
330
- - **v2.4.5** - 10-40x performance boost, context preservation
331
- - **v2.4.3** - Project-scoped search (breaking change)
332
- - **v2.3.7** - Local embeddings by default for privacy
195
+ - **v2.5.2** - State file compatibility fix
196
+ - **v2.4.5** - 10-40x performance boost
197
+ - **v2.4.3** - Project-scoped search
198
+ - **v2.3.7** - Local embeddings by default
333
199
 
334
- 📚 [Full Release History](docs/release-history.md) | 💬 [Discussions](https://github.com/ramakay/claude-self-reflect/discussions)
200
+ [Full changelog](docs/release-history.md)
335
201
 
336
- ## Contributing
202
+ ## Advanced Topics
337
203
 
338
- See our [Contributing Guide](CONTRIBUTING.md) for development setup and guidelines.
204
+ - [Performance tuning](docs/performance-guide.md)
205
+ - [Security & privacy](docs/security.md)
206
+ - [Windows setup](docs/windows-setup.md)
207
+ - [Architecture details](docs/architecture-details.md)
208
+ - [Contributing](CONTRIBUTING.md)
339
209
 
340
- ### Releasing New Versions (Maintainers)
210
+ ## Contributors
341
211
 
342
- Since our GitHub Actions automatically publish to npm, the release process is simple:
343
-
344
- ```bash
345
- # 1. Ensure you're logged into GitHub CLI
346
- gh auth login # Only needed first time
347
-
348
- # 2. Create and push a new tag
349
- git tag v2.3.0 # Use appropriate version number
350
- git push origin v2.3.0
351
-
352
- # 3. Create GitHub release (this triggers npm publish)
353
- gh release create v2.3.0 \
354
- --title "Release v2.3.0" \
355
- --notes-file CHANGELOG.md \
356
- --draft=false
357
-
358
- # The GitHub Action will automatically:
359
- # - Build the package
360
- # - Run tests
361
- # - Publish to npm
362
- # - Update release assets
363
- ```
364
-
365
- Monitor the release at: https://github.com/ramakay/claude-self-reflect/actions
212
+ Special thanks to our contributors:
213
+ - **[@TheGordon](https://github.com/TheGordon)** - Fixed timestamp parsing (#10)
214
+ - **[@akamalov](https://github.com/akamalov)** - Ubuntu WSL insights
215
+ - **[@kylesnowschwartz](https://github.com/kylesnowschwartz)** - Security review (#6)
366
216
 
367
217
  ---
368
218
 
369
219
  Stop reading. Start installing. Your future self will thank you.
370
220
 
371
- ## Contributors & Acknowledgments
372
-
373
- Special thanks to our contributors and security researchers:
374
-
375
- - **[@TheGordon](https://github.com/TheGordon)** - Fixed critical timestamp parsing bug for Claude conversation exports (#10)
376
- - **[@akamalov](https://github.com/akamalov)** - Highlighted Ubuntu WSL bug and helped educate about filesystem nuances
377
- - **[@kylesnowschwartz](https://github.com/kylesnowschwartz)** - Comprehensive security review leading to v2.3.3+ security improvements (#6)
378
-
379
- ## Windows Configuration
380
-
381
- ### Recommended: Use WSL
382
- For the best experience on Windows, we recommend using WSL (Windows Subsystem for Linux) which provides native Linux compatibility for Docker operations.
383
-
384
- ### Alternative: Native Windows
385
- If using Docker Desktop on native Windows, you need to adjust the CONFIG_PATH in your `.env` file to use Docker-compatible paths:
386
-
387
- ```bash
388
- # Replace USERNAME with your Windows username
389
- CONFIG_PATH=/c/Users/USERNAME/.claude-self-reflect/config
390
- ```
391
-
392
- This ensures Docker can properly mount the config directory. The setup wizard creates the directory, but Windows users need to update the path format for Docker compatibility.
393
-
394
221
  MIT License. Built with ❤️ for the Claude community.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-self-reflect",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Give Claude perfect memory of all your conversations - Installation wizard for Python MCP server",
5
5
  "keywords": [
6
6
  "claude",