claude-self-reflect 6.0.5 → 7.1.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/.claude/agents/csr-validator.md +87 -1
- package/.env.example +49 -0
- package/Dockerfile.batch-monitor +36 -0
- package/Dockerfile.batch-watcher +38 -0
- package/README.md +189 -29
- package/docker-compose.yaml +114 -15
- package/installer/setup-wizard-docker.js +195 -8
- package/installer/update-manager.js +88 -1
- package/mcp-server/src/standalone_client.py +314 -0
- package/package.json +1 -1
- package/src/runtime/batch_monitor.py +300 -0
- package/src/runtime/batch_watcher.py +455 -0
- package/src/runtime/config.py +61 -0
- package/src/runtime/hooks/__init__.py +21 -0
- package/src/runtime/hooks/ralph_state.py +397 -0
- package/src/runtime/hooks/session_end_hook.py +245 -0
- package/src/runtime/hooks/session_start_hook.py +259 -0
- package/src/runtime/precompact-hook.sh +60 -3
- package/src/runtime/qdrant_connection.py +73 -0
- package/src/runtime/unified_state_manager.py +35 -10
|
@@ -93,7 +93,79 @@ find . -type f \( -name "*test_*.py" -o -name "test_*.py" -o -name "*benchmark*.
|
|
|
93
93
|
echo "=== Suggest archiving to: tests/throwaway/ ==="
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
### 8.
|
|
96
|
+
### 8. Ralph Loop Integration Validation (v7.1+)
|
|
97
|
+
|
|
98
|
+
**What is Ralph Loop?**
|
|
99
|
+
The Ralph Wiggum technique helps Claude maintain focus on long, complex tasks. With CSR integration, Ralph loops gain cross-session memory through hooks.
|
|
100
|
+
|
|
101
|
+
**CRITICAL: Runaway Loop Prevention**
|
|
102
|
+
- ALWAYS use `--max-iterations` (PLURAL!) as safety net
|
|
103
|
+
- `--max-iteration` (singular) is IGNORED - loop runs forever!
|
|
104
|
+
- Setting `active: false` does NOT stop loops - must DELETE file
|
|
105
|
+
- To stop: `rm .claude/ralph-loop.local.md`
|
|
106
|
+
|
|
107
|
+
**v7.1+ Enhanced Features:**
|
|
108
|
+
- **Error Signature Deduplication**: Normalizes errors to avoid storing duplicates
|
|
109
|
+
- **Output Decline Detection**: Circuit breaker pattern (detects >70% output drop)
|
|
110
|
+
- **Confidence-Based Exit**: 0-100 scoring for exit decisions
|
|
111
|
+
- **Anti-Pattern Injection**: "DON'T RETRY THESE" surfaced first
|
|
112
|
+
- **Work Type Tracking**: IMPLEMENTATION/TESTING/DEBUGGING/DOCUMENTATION
|
|
113
|
+
- **Error-Centric Search**: Find past sessions by error pattern, not just task
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Check Ralph hooks in settings.json
|
|
117
|
+
echo "=== Ralph Hooks Validation ==="
|
|
118
|
+
grep -c "session_start_hook\|session_end_hook\|precompact" ~/.claude/settings.json && echo "✅ Hooks configured" || echo "❌ Hooks missing"
|
|
119
|
+
|
|
120
|
+
# Verify hook scripts exist
|
|
121
|
+
echo "=== Hook Scripts ==="
|
|
122
|
+
ls -la src/runtime/hooks/session_start_hook.py 2>/dev/null && echo "✅ SessionStart" || echo "❌ SessionStart missing"
|
|
123
|
+
ls -la src/runtime/hooks/session_end_hook.py 2>/dev/null && echo "✅ SessionEnd" || echo "❌ SessionEnd missing"
|
|
124
|
+
ls -la src/runtime/precompact-hook.sh 2>/dev/null && echo "✅ PreCompact" || echo "❌ PreCompact missing"
|
|
125
|
+
|
|
126
|
+
# Test RalphState import (NOT RalphStateParser)
|
|
127
|
+
python3 -c "
|
|
128
|
+
import sys
|
|
129
|
+
sys.path.insert(0, 'src/runtime/hooks')
|
|
130
|
+
from ralph_state import RalphState
|
|
131
|
+
print('✅ RalphState imports')
|
|
132
|
+
" || echo "❌ RalphState import failed"
|
|
133
|
+
|
|
134
|
+
# Check for Ralph-related CLI integration
|
|
135
|
+
grep -l "ralph" installer/setup-wizard-docker.js && echo "✅ CLI integration" || echo "❌ CLI missing Ralph"
|
|
136
|
+
|
|
137
|
+
# Test v7.1+ enhanced features
|
|
138
|
+
echo "=== Testing v7.1+ Enhanced Features ==="
|
|
139
|
+
python3 -c "
|
|
140
|
+
import sys
|
|
141
|
+
sys.path.insert(0, 'src/runtime/hooks')
|
|
142
|
+
from ralph_state import RalphState
|
|
143
|
+
|
|
144
|
+
# Quick feature check
|
|
145
|
+
state = RalphState.create_new('test', 'test')
|
|
146
|
+
state.add_error('Error at line 42')
|
|
147
|
+
state.track_output(1000)
|
|
148
|
+
state.update_confidence({'all_tasks_complete': True})
|
|
149
|
+
state.work_type = 'TESTING'
|
|
150
|
+
|
|
151
|
+
print('✅ Error dedup:', len(state.error_signatures), 'signatures')
|
|
152
|
+
print('✅ Output tracking:', len(state.output_lengths), 'samples')
|
|
153
|
+
print('✅ Confidence:', state.exit_confidence, '%')
|
|
154
|
+
print('✅ Work type:', state.work_type)
|
|
155
|
+
print('✅ All v7.1+ features work')
|
|
156
|
+
"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Test CSR Search for Ralph Sessions:**
|
|
160
|
+
```python
|
|
161
|
+
# Search for past Ralph sessions
|
|
162
|
+
results = await csr_reflect_on_past("Ralph loop session", limit=3, min_score=0.3)
|
|
163
|
+
|
|
164
|
+
# Quick check
|
|
165
|
+
quick = await csr_quick_check("Ralph Wiggum")
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 9. NPM Package Validation (Regression Check for #71)
|
|
97
169
|
```bash
|
|
98
170
|
echo "=== NPM Package Contents Check ==="
|
|
99
171
|
|
|
@@ -166,6 +238,20 @@ CodeRabbit Analysis: [PASS/FAIL]
|
|
|
166
238
|
- PR feedback checked: [✓/✗]
|
|
167
239
|
- Issues found: [none/list]
|
|
168
240
|
|
|
241
|
+
Ralph Loop Integration (v7.1+): [PASS/FAIL]
|
|
242
|
+
- Hooks in settings.json: [✓/✗]
|
|
243
|
+
- SessionStart hook: [✓/✗]
|
|
244
|
+
- SessionEnd hook: [✓/✗]
|
|
245
|
+
- PreCompact hook: [✓/✗]
|
|
246
|
+
- RalphState module: [✓/✗]
|
|
247
|
+
- CLI integration: [✓/✗]
|
|
248
|
+
- CSR search for Ralph: [✓/✗]
|
|
249
|
+
- v7.1+ Enhanced Features:
|
|
250
|
+
- Error signature dedup: [✓/✗]
|
|
251
|
+
- Output decline detection: [✓/✗]
|
|
252
|
+
- Confidence scoring: [✓/✗]
|
|
253
|
+
- Work type tracking: [✓/✗]
|
|
254
|
+
|
|
169
255
|
Critical Issues: [none/list]
|
|
170
256
|
|
|
171
257
|
CLEANUP NEEDED:
|
package/.env.example
CHANGED
|
@@ -28,3 +28,52 @@ CHUNK_SIZE=50
|
|
|
28
28
|
MAX_FILES_PER_CYCLE=10
|
|
29
29
|
HOT_WINDOW_MINUTES=15
|
|
30
30
|
MAX_COLD_FILES_PER_CYCLE=3
|
|
31
|
+
|
|
32
|
+
# ====================================================================================
|
|
33
|
+
# Batch Automation Configuration (OPTIONAL - Requires Anthropic API Key)
|
|
34
|
+
# ====================================================================================
|
|
35
|
+
# Batch automation provides 9.3x better search quality with automated narratives
|
|
36
|
+
# Disabled by default - enable via CLI during installation or manually
|
|
37
|
+
|
|
38
|
+
# Anthropic API Key (required for batch automation)
|
|
39
|
+
# Get your key from https://console.anthropic.com
|
|
40
|
+
ANTHROPIC_API_KEY=
|
|
41
|
+
|
|
42
|
+
# Qdrant API Key (optional for standalone mode, required for shared/multi-user)
|
|
43
|
+
# STANDALONE: Leave empty if running locally just for yourself
|
|
44
|
+
# SHARED: Set a strong API key if multiple people access this Qdrant instance
|
|
45
|
+
QDRANT_API_KEY=
|
|
46
|
+
|
|
47
|
+
# Batch Automation Directories
|
|
48
|
+
CSR_HOME=~/.claude-self-reflect
|
|
49
|
+
CSR_CONFIG_DIR=~/.claude-self-reflect/config
|
|
50
|
+
CSR_BATCH_STATE_DIR=~/.claude-self-reflect/batch_state
|
|
51
|
+
CSR_BATCH_QUEUE_DIR=~/.claude-self-reflect/batch_queue
|
|
52
|
+
|
|
53
|
+
# Batch Triggers
|
|
54
|
+
BATCH_SIZE_TRIGGER=10 # Trigger batch after N files
|
|
55
|
+
BATCH_TIME_TRIGGER_MINUTES=30 # Or after N minutes
|
|
56
|
+
|
|
57
|
+
# Subprocess Settings
|
|
58
|
+
SUBPROCESS_TIMEOUT_SECONDS=1800 # 30 minute timeout for batch operations
|
|
59
|
+
|
|
60
|
+
# Watcher Timing
|
|
61
|
+
HOT_CHECK_INTERVAL_S=2 # Check hot files every N seconds
|
|
62
|
+
NORMAL_CHECK_INTERVAL_S=60 # Normal check interval
|
|
63
|
+
WARM_WINDOW_HOURS=24 # Files < N hours are warm
|
|
64
|
+
MAX_COLD_FILES=5 # Max cold files per cycle
|
|
65
|
+
|
|
66
|
+
# ====================================================================================
|
|
67
|
+
# Evaluation System Configuration (OPTIONAL - Session Health Checks)
|
|
68
|
+
# ====================================================================================
|
|
69
|
+
# Automatically runs health checks on session start to verify MCP tools,
|
|
70
|
+
# search quality, and performance are functioning correctly
|
|
71
|
+
|
|
72
|
+
# Enable automatic evaluation at session start
|
|
73
|
+
EVAL_ON_STARTUP=false # Set to true for session-start health checks
|
|
74
|
+
|
|
75
|
+
# Evaluation timeout settings
|
|
76
|
+
EVAL_TIMEOUT_SECONDS=30 # Maximum time for evaluation run
|
|
77
|
+
|
|
78
|
+
# Performance targets
|
|
79
|
+
EVAL_PERFORMANCE_TARGET_MS=500 # Target search latency in milliseconds
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install system dependencies
|
|
6
|
+
RUN apt-get update && apt-get install -y \
|
|
7
|
+
gcc \
|
|
8
|
+
g++ \
|
|
9
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
+
|
|
11
|
+
# Copy requirements
|
|
12
|
+
COPY requirements.txt .
|
|
13
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
14
|
+
|
|
15
|
+
# Copy source code
|
|
16
|
+
COPY src/ ./src/
|
|
17
|
+
COPY docs/design/ ./docs/design/
|
|
18
|
+
|
|
19
|
+
# Create non-root user
|
|
20
|
+
RUN groupadd -r appuser && \
|
|
21
|
+
useradd -r -g appuser -u 1001 appuser
|
|
22
|
+
|
|
23
|
+
# Create directories for batch state and set ownership
|
|
24
|
+
RUN mkdir -p /home/appuser/.claude-self-reflect/batch_state && \
|
|
25
|
+
chown -R appuser:appuser /home/appuser/.claude-self-reflect && \
|
|
26
|
+
chown -R appuser:appuser /app
|
|
27
|
+
|
|
28
|
+
# Set Python path
|
|
29
|
+
ENV PYTHONPATH=/app
|
|
30
|
+
ENV HOME=/home/appuser
|
|
31
|
+
|
|
32
|
+
# Switch to non-root user
|
|
33
|
+
USER appuser
|
|
34
|
+
|
|
35
|
+
# Run batch monitor
|
|
36
|
+
CMD ["python", "/app/src/runtime/batch_monitor.py"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install system dependencies
|
|
6
|
+
RUN apt-get update && apt-get install -y \
|
|
7
|
+
gcc \
|
|
8
|
+
g++ \
|
|
9
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
+
|
|
11
|
+
# Copy requirements
|
|
12
|
+
COPY requirements.txt .
|
|
13
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
14
|
+
|
|
15
|
+
# Copy source code
|
|
16
|
+
COPY src/ ./src/
|
|
17
|
+
COPY docs/design/ ./docs/design/
|
|
18
|
+
|
|
19
|
+
# Create non-root user
|
|
20
|
+
RUN groupadd -r appuser && \
|
|
21
|
+
useradd -r -g appuser -u 1001 appuser
|
|
22
|
+
|
|
23
|
+
# Create directories for state and queue and set ownership
|
|
24
|
+
RUN mkdir -p /home/appuser/.claude-self-reflect/config && \
|
|
25
|
+
mkdir -p /home/appuser/.claude-self-reflect/batch_queue && \
|
|
26
|
+
mkdir -p /home/appuser/.claude-self-reflect/batch_state && \
|
|
27
|
+
chown -R appuser:appuser /home/appuser/.claude-self-reflect && \
|
|
28
|
+
chown -R appuser:appuser /app
|
|
29
|
+
|
|
30
|
+
# Set Python path
|
|
31
|
+
ENV PYTHONPATH=/app
|
|
32
|
+
ENV HOME=/home/appuser
|
|
33
|
+
|
|
34
|
+
# Switch to non-root user
|
|
35
|
+
USER appuser
|
|
36
|
+
|
|
37
|
+
# Run batch watcher
|
|
38
|
+
CMD ["python", "/app/src/runtime/batch_watcher.py"]
|
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@ Give Claude perfect memory of all your conversations. Search past discussions in
|
|
|
26
26
|
|
|
27
27
|
**100% Local by Default** • **20x Faster** • **Zero Configuration** • **Production Ready**
|
|
28
28
|
|
|
29
|
+
> **Latest: v7.0 Automated Narratives** - 9.3x better search quality via AI-powered summaries. [Learn more →](#v70-automated-narrative-generation)
|
|
30
|
+
|
|
29
31
|
## Why This Exists
|
|
30
32
|
|
|
31
33
|
Claude starts fresh every conversation. You've solved complex bugs, designed architectures, made critical decisions - all forgotten. Until now.
|
|
@@ -39,6 +41,7 @@ Claude starts fresh every conversation. You've solved complex bugs, designed arc
|
|
|
39
41
|
- [Real Examples](#real-examples)
|
|
40
42
|
- [NEW: Real-time Indexing Status](#new-real-time-indexing-status-in-your-terminal)
|
|
41
43
|
- [Key Features](#key-features)
|
|
44
|
+
- [Ralph Loop Memory Integration](#ralph-loop-memory-integration)
|
|
42
45
|
- [Code Quality Insights](#code-quality-insights)
|
|
43
46
|
- [Architecture](#architecture)
|
|
44
47
|
- [Requirements](#requirements)
|
|
@@ -63,7 +66,7 @@ claude-self-reflect setup
|
|
|
63
66
|
```
|
|
64
67
|
|
|
65
68
|
> [!TIP]
|
|
66
|
-
> **
|
|
69
|
+
> **Auto-Migration**: Updates automatically handle breaking changes. Simply run `npm update -g claude-self-reflect`.
|
|
67
70
|
|
|
68
71
|
<details open>
|
|
69
72
|
<summary>Cloud Mode (Better Search Accuracy)</summary>
|
|
@@ -84,18 +87,15 @@ claude-self-reflect setup --voyage-key=YOUR_ACTUAL_KEY_HERE
|
|
|
84
87
|
|
|
85
88
|
## Performance
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
| Metric | v3.x | v4.0 | Improvement |
|
|
91
|
-
|--------|------|------|-------------|
|
|
90
|
+
| Metric | Before | After | Improvement |
|
|
91
|
+
|--------|--------|-------|-------------|
|
|
92
92
|
| **Status Check** | 119ms | 6ms | **20x faster** |
|
|
93
93
|
| **Storage Usage** | 100MB | 50MB | **50% reduction** |
|
|
94
94
|
| **Import Speed** | 10/sec | 100/sec | **10x faster** |
|
|
95
95
|
| **Memory Usage** | 500MB | 50MB | **90% reduction** |
|
|
96
96
|
| **Search Latency** | 15ms | 3ms | **5x faster** |
|
|
97
97
|
|
|
98
|
-
###
|
|
98
|
+
### Competitive Comparison
|
|
99
99
|
|
|
100
100
|
| Feature | Claude Self-Reflect | MemGPT | LangChain Memory |
|
|
101
101
|
|---------|---------------------|---------|------------------|
|
|
@@ -106,8 +106,6 @@ claude-self-reflect setup --voyage-key=YOUR_ACTUAL_KEY_HERE
|
|
|
106
106
|
| **Setup time** | 5 min | 30+ min | 20+ min |
|
|
107
107
|
| **Docker required** | Yes | Python | Python |
|
|
108
108
|
|
|
109
|
-
</details>
|
|
110
|
-
|
|
111
109
|
## The Magic
|
|
112
110
|
|
|
113
111
|

|
|
@@ -177,32 +175,115 @@ Your code quality displayed live as you work:
|
|
|
177
175
|
|
|
178
176
|
</details>
|
|
179
177
|
|
|
178
|
+
## v7.0 Automated Narrative Generation
|
|
179
|
+
|
|
180
|
+
**9.3x Better Search Quality** • **50% Cost Savings** • **Fully Automated**
|
|
181
|
+
|
|
182
|
+
v7.0 introduces AI-powered conversation narratives that transform raw conversation excerpts into rich problem-solution summaries with comprehensive metadata extraction.
|
|
183
|
+
|
|
184
|
+
### Before/After Comparison
|
|
185
|
+
|
|
186
|
+
| Metric | v6.x (Raw Excerpts) | v7.0 (AI Narratives) | Improvement |
|
|
187
|
+
|--------|---------------------|----------------------|-------------|
|
|
188
|
+
| **Search Quality** | 0.074 | 0.691 | **9.3x better** |
|
|
189
|
+
| **Token Compression** | 100% | 18% | **82% reduction** |
|
|
190
|
+
| **Cost per Conversation** | $0.025 | $0.012 | **50% savings** |
|
|
191
|
+
| **Metadata Richness** | Basic | Tools + Concepts + Files | **Full context** |
|
|
192
|
+
|
|
193
|
+
### What You Get
|
|
194
|
+
|
|
195
|
+
**Enhanced Search Results:**
|
|
196
|
+
- **Problem-Solution Patterns**: Conversations structured as challenges encountered and solutions implemented
|
|
197
|
+
- **Rich Metadata**: Automatic extraction of tools used, technical concepts, and files modified
|
|
198
|
+
- **Context Compression**: 82% token reduction while maintaining searchability
|
|
199
|
+
- **Better Relevance**: Search scores improved from 0.074 to 0.691 (9.3x)
|
|
200
|
+
|
|
201
|
+
**Cost-Effective Processing:**
|
|
202
|
+
- Anthropic Batch API: $0.012 per conversation (vs $0.025 standard)
|
|
203
|
+
- Automatic batch queuing and processing
|
|
204
|
+
- Progress monitoring via Docker containers
|
|
205
|
+
- Evaluation generation for quality assurance
|
|
206
|
+
|
|
207
|
+
**Fully Automated Workflow:**
|
|
208
|
+
```bash
|
|
209
|
+
# 1. Watch for new conversations
|
|
210
|
+
docker compose up batch-watcher
|
|
211
|
+
|
|
212
|
+
# 2. Auto-trigger batch processing when threshold reached
|
|
213
|
+
# (Configurable: BATCH_THRESHOLD_FILES, default 10)
|
|
214
|
+
|
|
215
|
+
# 3. Monitor batch progress
|
|
216
|
+
docker compose logs batch-monitor -f
|
|
217
|
+
|
|
218
|
+
# 4. Enhanced narratives automatically imported to Qdrant
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Example: Raw Excerpt vs AI Narrative
|
|
222
|
+
|
|
223
|
+
**Before (v6.x)** - Raw excerpt showing basic conversation flow:
|
|
224
|
+
```
|
|
225
|
+
User: How do I fix the Docker memory issue?
|
|
226
|
+
Assistant: The container was limited to 2GB but only using 266MB...
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**After (v7.0)** - Rich narrative with metadata:
|
|
230
|
+
```
|
|
231
|
+
PROBLEM: Docker container memory consumption investigation revealed
|
|
232
|
+
discrepancy between limits (2GB) and actual usage (266MB). Analysis
|
|
233
|
+
required to determine if memory limit was appropriate.
|
|
234
|
+
|
|
235
|
+
SOLUTION: Discovered issue occurred with MAX_QUEUE_SIZE=1000 outside
|
|
236
|
+
Docker environment. Implemented proper Docker resource constraints
|
|
237
|
+
stabilizing memory at 341MB.
|
|
238
|
+
|
|
239
|
+
TOOLS USED: Docker, grep, Edit
|
|
240
|
+
CONCEPTS: container-memory, resource-limits, queue-sizing
|
|
241
|
+
FILES: docker-compose.yaml, batch_watcher.py
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Getting Started with Narratives
|
|
245
|
+
|
|
246
|
+
Narratives are automatically generated for new conversations. To process existing conversations:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Process all existing conversations in batch
|
|
250
|
+
python docs/design/batch_import_all_projects.py
|
|
251
|
+
|
|
252
|
+
# Monitor batch progress
|
|
253
|
+
docker compose logs batch-monitor -f
|
|
254
|
+
|
|
255
|
+
# Check completion status
|
|
256
|
+
curl http://localhost:6333/collections/csr_claude-self-reflect_local_384d
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
For complete documentation, see [Batch Automation Guide](docs/testing/NARRATIVE_TESTING_SUMMARY.md).
|
|
260
|
+
|
|
180
261
|
## Key Features
|
|
181
262
|
|
|
182
263
|
<details>
|
|
183
264
|
<summary><b>MCP Tools Available to Claude</b></summary>
|
|
184
265
|
|
|
185
|
-
**Search & Memory
|
|
266
|
+
**Search & Memory:**
|
|
186
267
|
- `reflect_on_past` - Search past conversations using semantic similarity with time decay (supports quick/summary modes)
|
|
187
268
|
- `store_reflection` - Store important insights or learnings for future reference
|
|
188
269
|
- `get_next_results` - Paginate through additional search results
|
|
189
270
|
- `search_by_file` - Find conversations that analyzed specific files
|
|
190
271
|
- `search_by_concept` - Search for conversations about development concepts
|
|
191
|
-
- `get_full_conversation` - Retrieve complete JSONL conversation files
|
|
272
|
+
- `get_full_conversation` - Retrieve complete JSONL conversation files
|
|
192
273
|
|
|
193
|
-
**
|
|
274
|
+
**Temporal Queries:**
|
|
194
275
|
- `get_recent_work` - Answer "What did we work on last?" with session grouping
|
|
195
276
|
- `search_by_recency` - Time-constrained search like "docker issues last week"
|
|
196
277
|
- `get_timeline` - Activity timeline with statistics and patterns
|
|
197
278
|
|
|
198
|
-
**Runtime Configuration
|
|
279
|
+
**Runtime Configuration:**
|
|
199
280
|
- `switch_embedding_mode` - Switch between local/cloud modes without restart
|
|
200
281
|
- `get_embedding_mode` - Check current embedding configuration
|
|
201
282
|
- `reload_code` - Hot reload Python code changes
|
|
202
283
|
- `reload_status` - Check reload state
|
|
203
284
|
- `clear_module_cache` - Clear Python cache
|
|
204
285
|
|
|
205
|
-
**Status & Monitoring
|
|
286
|
+
**Status & Monitoring:**
|
|
206
287
|
- `get_status` - Real-time import progress and system status
|
|
207
288
|
- `get_health` - Comprehensive system health check
|
|
208
289
|
- `collection_status` - Check Qdrant collection health and stats
|
|
@@ -244,6 +325,64 @@ Claude: [Searches across ALL your projects]
|
|
|
244
325
|
|
|
245
326
|
</details>
|
|
246
327
|
|
|
328
|
+
<details>
|
|
329
|
+
<summary><b>Ralph Loop Memory Integration (v7.1+)</b></summary>
|
|
330
|
+
|
|
331
|
+
<div align="center">
|
|
332
|
+
<img src="docs/images/ralph-loop-csr.png" alt="Ralph Loop with CSR Memory - From hamster wheel to upward spiral" width="800"/>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
Use the [ralph-wiggum plugin](https://github.com/anthropics/claude-code-plugins/tree/main/ralph-wiggum) for long tasks? CSR automatically gives Ralph loops **cross-session memory**:
|
|
336
|
+
|
|
337
|
+
**Core Features:**
|
|
338
|
+
- **Automatic backup** before context compaction
|
|
339
|
+
- **Past session retrieval** when starting new Ralph loops
|
|
340
|
+
- **Failed approach tracking** - never repeat the same mistakes
|
|
341
|
+
- **Success pattern learning** - reuse what worked before
|
|
342
|
+
|
|
343
|
+
**v7.1+ Enhanced Features:**
|
|
344
|
+
- **Error Signature Deduplication** - Normalizes errors (removes line numbers, paths, timestamps) to avoid redundant storage
|
|
345
|
+
- **Output Decline Detection** - Circuit breaker pattern that detects >70% drop in output length
|
|
346
|
+
- **Confidence-Based Exit** - 0-100 scoring based on signals (tasks complete, tests passing, no errors)
|
|
347
|
+
- **Anti-Pattern Injection** - "DON'T RETRY THESE" section surfaces failed approaches first
|
|
348
|
+
- **Work Type Tracking** - Categorizes sessions as IMPLEMENTATION/TESTING/DEBUGGING/DOCUMENTATION
|
|
349
|
+
- **Error-Centric Search** - Finds past sessions by error pattern, not just task description
|
|
350
|
+
|
|
351
|
+
**Setup (one-time):**
|
|
352
|
+
```bash
|
|
353
|
+
./scripts/ralph/install_hooks.sh # Install CSR hooks
|
|
354
|
+
./scripts/ralph/install_hooks.sh --check # Verify installation
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**How it works:**
|
|
358
|
+
1. Start a Ralph loop: `/ralph-wiggum:ralph-loop "Build feature X"`
|
|
359
|
+
2. Work naturally - state is tracked in `.claude/ralph-loop.local.md`
|
|
360
|
+
3. When compaction occurs, state is backed up to CSR
|
|
361
|
+
4. New sessions retrieve past learnings from CSR automatically
|
|
362
|
+
5. Anti-patterns and winning strategies are surfaced first
|
|
363
|
+
|
|
364
|
+
**Files created:**
|
|
365
|
+
- `.ralph_past_sessions.md` - Injected context from past sessions (auto-generated)
|
|
366
|
+
|
|
367
|
+
**Verified proof (2026-01-04):**
|
|
368
|
+
```
|
|
369
|
+
# Session start hook injects past sessions:
|
|
370
|
+
INFO: Found 2 relevant results:
|
|
371
|
+
- Anti-patterns: 0
|
|
372
|
+
- Winning strategies: 0
|
|
373
|
+
- Similar tasks: 2
|
|
374
|
+
|
|
375
|
+
# Sessions stored in Qdrant:
|
|
376
|
+
{
|
|
377
|
+
"tags": ["ralph_session", "outcome_completed"],
|
|
378
|
+
"timestamp": "2026-01-04T18:13:03.711262+00:00"
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
[Full documentation →](docs/development/ralph-memory-integration.md)
|
|
383
|
+
|
|
384
|
+
</details>
|
|
385
|
+
|
|
247
386
|
<details>
|
|
248
387
|
<summary><b>Memory Decay</b></summary>
|
|
249
388
|
|
|
@@ -296,9 +435,6 @@ Files are categorized by age and processed with priority queuing to ensure newes
|
|
|
296
435
|
|
|
297
436
|
## Requirements
|
|
298
437
|
|
|
299
|
-
> [!WARNING]
|
|
300
|
-
> **Breaking Change in v4.0**: Collections now use prefixed naming (e.g., `csr_project_local_384d`). Run migration automatically via `npm update`.
|
|
301
|
-
|
|
302
438
|
<details>
|
|
303
439
|
<summary><b>System Requirements</b></summary>
|
|
304
440
|
|
|
@@ -376,20 +512,44 @@ npm uninstall -g claude-self-reflect
|
|
|
376
512
|
|
|
377
513
|
## Keeping Up to Date
|
|
378
514
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
<details>
|
|
383
|
-
<summary>Recent Improvements</summary>
|
|
515
|
+
```bash
|
|
516
|
+
npm update -g claude-self-reflect
|
|
517
|
+
```
|
|
384
518
|
|
|
385
|
-
|
|
386
|
-
- **Runtime configuration** - Switch modes without restarting
|
|
387
|
-
- **Unified state management** - Single source of truth
|
|
388
|
-
- **AST-GREP integration** - Code quality analysis
|
|
389
|
-
- **Temporal search tools** - Find recent work and time-based queries
|
|
390
|
-
- **Auto-migration** - Updates handle breaking changes automatically
|
|
519
|
+
Updates are automatic and preserve your data. See [full changelog](docs/release-history.md) for details.
|
|
391
520
|
|
|
392
|
-
|
|
521
|
+
<details>
|
|
522
|
+
<summary><b>Release Evolution</b></summary>
|
|
523
|
+
|
|
524
|
+
### v7.0 - Automated Narratives (Oct 2025)
|
|
525
|
+
- **9.3x better search quality** via AI-powered conversation summaries
|
|
526
|
+
- **50% cost savings** using Anthropic Batch API ($0.012 per conversation)
|
|
527
|
+
- **82% token compression** while maintaining searchability
|
|
528
|
+
- Rich metadata extraction (tools, concepts, files)
|
|
529
|
+
- Problem-solution narrative structure
|
|
530
|
+
- Automated batch processing with Docker monitoring
|
|
531
|
+
|
|
532
|
+
### v4.0 - Performance Revolution (Sep 2025)
|
|
533
|
+
- **20x faster** status checks (119ms → 6ms)
|
|
534
|
+
- **50% storage reduction** via unified state management
|
|
535
|
+
- **10x faster imports** (10/sec → 100/sec)
|
|
536
|
+
- **90% memory reduction** (500MB → 50MB)
|
|
537
|
+
- Runtime mode switching (no restart required)
|
|
538
|
+
- Prefixed collection naming (breaking change)
|
|
539
|
+
- Code quality tracking with AST-GREP (100+ patterns)
|
|
540
|
+
|
|
541
|
+
### v3.3 - Temporal Intelligence (Aug 2025)
|
|
542
|
+
- Time-based search: "docker issues last week"
|
|
543
|
+
- Session grouping: "What did we work on last?"
|
|
544
|
+
- Activity timelines with statistics
|
|
545
|
+
- Recency-aware queries
|
|
546
|
+
|
|
547
|
+
### v2.8 - Full Context Access (Jul 2025)
|
|
548
|
+
- Complete conversation retrieval
|
|
549
|
+
- JSONL file access for deeper analysis
|
|
550
|
+
- Enhanced debugging capabilities
|
|
551
|
+
|
|
552
|
+
[View complete changelog →](docs/release-history.md)
|
|
393
553
|
|
|
394
554
|
</details>
|
|
395
555
|
|