claude-recall 0.18.1 → 0.18.2

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.
@@ -8,7 +8,7 @@ source: claude-recall
8
8
 
9
9
  # Corrections
10
10
 
11
- Auto-generated from 22 memories. Last updated: 2026-03-20.
11
+ Auto-generated from 23 memories. Last updated: 2026-03-20.
12
12
 
13
13
  ## Rules
14
14
 
@@ -27,6 +27,7 @@ Auto-generated from 22 memories. Last updated: 2026-03-20.
27
27
  - CORRECTION: Memory with complex metadata
28
28
  - CORRECTION: Memory with complex metadata
29
29
  - CORRECTION: Memory with complex metadata
30
+ - CORRECTION: Memory with complex metadata
30
31
  - CORRECTION: Replace expired access token with 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
31
32
  - CORRECTION: use spaces not tabs for indentation
32
33
  - CORRECTION: cited (loaded 5+ times): 19
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "topicId": "corrections",
3
- "sourceHash": "71d234bd5cea462bcfc192c4b421fc4d28d920f188c8393f0b3621e86092febe",
4
- "memoryCount": 22,
5
- "generatedAt": "2026-03-20T09:33:07.652Z",
3
+ "sourceHash": "2508acf74409f4f19e47ba4a5c159b28afa9db68dc70fceb90fc1cc90a806538",
4
+ "memoryCount": 23,
5
+ "generatedAt": "2026-03-20T15:33:09.502Z",
6
6
  "memoryKeys": [
7
+ "memory_1774020789453_x9xkjhbug",
7
8
  "memory_1773999187635_v9sxfphej",
8
9
  "memory_1773740608781_ae2bn7zos",
9
10
  "memory_1773659723317_o738xfbyw",
@@ -8,11 +8,13 @@ source: claude-recall
8
8
 
9
9
  # Failure Lessons
10
10
 
11
- Auto-generated from 25 memories. Last updated: 2026-03-20.
11
+ Auto-generated from 27 memories. Last updated: 2026-03-20.
12
12
 
13
13
  ## Rules
14
14
 
15
+ - Check command syntax, file paths, and prerequisites before running
15
16
  - SQLite query syntax error: LIKE clause requires single quotes around string literal, not double quotes
17
+ - Avoid: Command failed: npx jest tests/unit/outcome-storage.test.ts tests/unit/promotion-engine.test.ts tests/unit/memory... → Instead: Check command syntax, file paths, and prerequisites before running
16
18
  - Avoid: Command failed: npx jest tests/unit/bash-failure-watcher.test.ts 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
17
19
  - Avoid: Command failed: npx jest tests/unit/memory-sync-hook.test.ts 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
18
20
  - Avoid: Command failed: npm whoami 2>&1 && npm config get registry 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "topicId": "failure-lessons",
3
- "sourceHash": "81c103e377f0523953c7512cbd3e06f5773ac5d57ddb8ec52e23b1effea1d1fe",
4
- "memoryCount": 25,
5
- "generatedAt": "2026-03-20T09:33:07.603Z",
3
+ "sourceHash": "22208b1347904abc47e0ee6878777d047cd32a0593385ead5ca666cbc2960fe6",
4
+ "memoryCount": 27,
5
+ "generatedAt": "2026-03-20T15:33:09.349Z",
6
6
  "memoryKeys": [
7
+ "promoted_1774019382782_acm9j0h8u",
7
8
  "hook_failure_1772637584921_0tj4rrxnt",
9
+ "hook_failure_non-zero-exit_1773999564001_82kcdp0ag",
8
10
  "hook_failure_non-zero-exit_1773784543398_siidzp55g",
9
11
  "hook_failure_non-zero-exit_1773669669860_9mcdbx51y",
10
12
  "hook_failure_non-zero-exit_1773409269877_ful451241",
@@ -8,10 +8,15 @@ source: claude-recall
8
8
 
9
9
  # Preferences
10
10
 
11
- Auto-generated from 98 memories. Last updated: 2026-03-20.
11
+ Auto-generated from 103 memories. Last updated: 2026-03-20.
12
12
 
13
13
  ## Rules
14
14
 
15
+ - Session test preference 1774020789925
16
+ - Test preference 1774020789520-2
17
+ - Test preference 1774020789520-1
18
+ - Test preference 1774020789520-0
19
+ - Test memory content
15
20
  - Session test preference 1773999187736
16
21
  - Test preference 1773999187658-2
17
22
  - Test preference 1773999187658-1
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "topicId": "preferences",
3
- "sourceHash": "e48e55f7de632696ce32c04f23c2e470a590547bb8541501214650efe670496e",
4
- "memoryCount": 98,
5
- "generatedAt": "2026-03-20T09:33:07.756Z",
3
+ "sourceHash": "e03fbec0a2b07a6eaa355b96d76fedae8a5908955d2d2eb02fd15c60fbc87788",
4
+ "memoryCount": 103,
5
+ "generatedAt": "2026-03-20T15:33:09.994Z",
6
6
  "memoryKeys": [
7
+ "memory_1774020789927_g99mrubvu",
8
+ "memory_1774020789705_xhubujrxv",
9
+ "memory_1774020789618_m1p55yhtz",
10
+ "memory_1774020789521_saryqj7kw",
11
+ "memory_1774020789257_wla5q38wq",
7
12
  "memory_1773999187737_qrdwbas47",
8
13
  "memory_1773999187696_gymxhasno",
9
14
  "memory_1773999187680_p6rxtp38v",
package/README.md CHANGED
@@ -129,6 +129,8 @@ action → outcome event → episode → candidate lesson → promotion → acti
129
129
  claude-recall stats # Memory statistics
130
130
  claude-recall search "query" # Search memories
131
131
  claude-recall failures # View failure memories
132
+ claude-recall outcomes # Outcome-aware learning status
133
+ claude-recall outcomes --section lessons # Just candidate lessons
132
134
  claude-recall export backup.json # Export memories to JSON
133
135
  claude-recall import backup.json # Import memories from JSON
134
136
  claude-recall --version # Check version
@@ -153,6 +155,9 @@ claude-recall import backup.json # Import memories from JSON
153
155
  claude-recall clear --force # Clear all memories
154
156
  claude-recall failures # View failure memories
155
157
  claude-recall failures --limit 20 # Limit results
158
+ claude-recall outcomes # Outcome-aware learning status
159
+ claude-recall outcomes --section lessons # Just candidate lessons
160
+ claude-recall outcomes --limit 20 # More items per section
156
161
  claude-recall monitor # Memory search monitoring stats
157
162
 
158
163
  # ── Skills ───────────────────────────────────────────────────────────
@@ -261,6 +261,90 @@ class ClaudeRecallCLI {
261
261
  });
262
262
  this.logger.info('CLI', 'Failures displayed', { count: displayFailures.length });
263
263
  }
264
+ /**
265
+ * Show outcome-aware learning status: episodes, outcome events, candidate lessons, memory stats
266
+ */
267
+ showOutcomes(options) {
268
+ const limit = options.limit || 10;
269
+ const section = options.section;
270
+ const db = this.memoryService.getDatabase();
271
+ // Check if outcome tables exist
272
+ const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('episodes','outcome_events','candidate_lessons','memory_stats')").all();
273
+ const tableNames = new Set(tables.map((t) => t.name));
274
+ if (tableNames.size < 4) {
275
+ console.log('\n⚠️ Outcome tables not found. Upgrade to v0.18.0+ and restart the MCP server.\n');
276
+ return;
277
+ }
278
+ console.log('\n📊 Outcome-Aware Learning Status\n');
279
+ // Summary counts
280
+ const episodeCount = db.prepare('SELECT COUNT(*) as c FROM episodes').get().c;
281
+ const eventCount = db.prepare('SELECT COUNT(*) as c FROM outcome_events').get().c;
282
+ const candidateCount = db.prepare('SELECT COUNT(*) as c FROM candidate_lessons').get().c;
283
+ const promotedCount = db.prepare("SELECT COUNT(*) as c FROM candidate_lessons WHERE status = 'promoted'").get().c;
284
+ const statsCount = db.prepare('SELECT COUNT(*) as c FROM memory_stats').get().c;
285
+ console.log(` Episodes: ${episodeCount}`);
286
+ console.log(` Outcome events: ${eventCount}`);
287
+ console.log(` Candidate lessons: ${candidateCount} (${promotedCount} promoted)`);
288
+ console.log(` Tracked memories: ${statsCount}`);
289
+ console.log('');
290
+ // Episodes
291
+ if (!section || section === 'episodes') {
292
+ const episodes = db.prepare('SELECT id, outcome_type, severity, outcome_summary, source, created_at FROM episodes ORDER BY created_at DESC LIMIT ?').all(limit);
293
+ if (episodes.length > 0) {
294
+ console.log(`── Recent Episodes (${episodes.length}) ──\n`);
295
+ for (const ep of episodes) {
296
+ const icon = ep.outcome_type === 'failure' ? '❌' : ep.outcome_type === 'success' ? '✅' : '⚪';
297
+ const time = new Date(ep.created_at).toLocaleString();
298
+ console.log(` ${icon} [${ep.outcome_type || 'unclear'}] ${ep.outcome_summary || 'No summary'}`);
299
+ console.log(` severity: ${ep.severity || '-'} source: ${ep.source || '-'} ${time}`);
300
+ }
301
+ console.log('');
302
+ }
303
+ }
304
+ // Outcome events
305
+ if (!section || section === 'events') {
306
+ const events = db.prepare('SELECT event_type, actor, exit_code, substr(next_state_summary, 1, 100) as summary, created_at FROM outcome_events ORDER BY created_at DESC LIMIT ?').all(limit);
307
+ if (events.length > 0) {
308
+ console.log(`── Recent Outcome Events (${events.length}) ──\n`);
309
+ for (const ev of events) {
310
+ const exitStr = ev.exit_code !== null ? ` (exit ${ev.exit_code})` : '';
311
+ const time = new Date(ev.created_at).toLocaleString();
312
+ console.log(` [${ev.event_type}] ${ev.actor}${exitStr}: ${ev.summary}`);
313
+ console.log(` ${time}`);
314
+ }
315
+ console.log('');
316
+ }
317
+ }
318
+ // Candidate lessons
319
+ if (!section || section === 'lessons') {
320
+ const lessons = db.prepare('SELECT status, evidence_count, confidence, lesson_kind, substr(lesson_text, 1, 100) as text, created_at FROM candidate_lessons ORDER BY created_at DESC LIMIT ?').all(limit);
321
+ if (lessons.length > 0) {
322
+ console.log(`── Candidate Lessons (${lessons.length}) ──\n`);
323
+ for (const l of lessons) {
324
+ const icon = l.status === 'promoted' ? '⬆️' : l.status === 'rejected' ? '⬇️' : '⏳';
325
+ console.log(` ${icon} [${l.status}] (${l.evidence_count}x, ${(l.confidence * 100).toFixed(0)}%) ${l.text}`);
326
+ console.log(` kind: ${l.lesson_kind} ${new Date(l.created_at).toLocaleString()}`);
327
+ }
328
+ console.log('');
329
+ }
330
+ }
331
+ // Memory stats (top helpful)
332
+ if (!section || section === 'stats') {
333
+ const memStats = db.prepare('SELECT memory_key, times_retrieved, times_helpful, times_unhelpful, last_confirmed_at FROM memory_stats WHERE times_retrieved > 0 ORDER BY times_helpful DESC, times_retrieved DESC LIMIT ?').all(limit);
334
+ if (memStats.length > 0) {
335
+ console.log(`── Memory Stats — Top Retrieved (${memStats.length}) ──\n`);
336
+ for (const s of memStats) {
337
+ const ratio = s.times_retrieved > 0 ? ((s.times_helpful / s.times_retrieved) * 100).toFixed(0) : '0';
338
+ console.log(` ${s.memory_key}`);
339
+ console.log(` retrieved: ${s.times_retrieved} helpful: ${s.times_helpful} unhelpful: ${s.times_unhelpful} (${ratio}% helpful)`);
340
+ }
341
+ console.log('');
342
+ }
343
+ }
344
+ if (episodeCount === 0 && eventCount === 0) {
345
+ console.log('No outcome data yet. Use Claude Code normally — outcomes are captured automatically.\n');
346
+ }
347
+ }
264
348
  /**
265
349
  * Search memories by query
266
350
  */
@@ -1179,6 +1263,20 @@ async function main() {
1179
1263
  });
1180
1264
  process.exit(0);
1181
1265
  });
1266
+ // Outcomes command (v0.18.0)
1267
+ program
1268
+ .command('outcomes')
1269
+ .description('Show outcome-aware learning status: episodes, events, lessons, stats')
1270
+ .option('--limit <number>', 'Maximum items per section', '10')
1271
+ .option('--section <name>', 'Show only one section: episodes, events, lessons, stats')
1272
+ .action((options) => {
1273
+ const cli = new ClaudeRecallCLI(program.opts());
1274
+ cli.showOutcomes({
1275
+ limit: parseInt(options.limit),
1276
+ section: options.section
1277
+ });
1278
+ process.exit(0);
1279
+ });
1182
1280
  // Export command
1183
1281
  program
1184
1282
  .command('export <output>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Persistent memory for Claude Code with native Skills integration, automatic capture, failure learning, and project scoping via MCP server",
5
5
  "main": "dist/index.js",
6
6
  "bin": {