claude-recall 0.20.2 → 0.20.4

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 9 memories. Last updated: 2026-04-02.
11
+ Auto-generated from 11 memories. Last updated: 2026-04-02.
12
12
 
13
13
  ## Rules
14
14
 
@@ -19,6 +19,8 @@ Auto-generated from 9 memories. Last updated: 2026-04-02.
19
19
  - CORRECTION: Memory with complex metadata
20
20
  - CORRECTION: Memory with complex metadata
21
21
  - CORRECTION: Memory with complex metadata
22
+ - CORRECTION: Memory with complex metadata
23
+ - CORRECTION: Memory with complex metadata
22
24
  - CORRECTION: License copyright should include user's name instead of 'Claude Recall Contributors'
23
25
  - CORRECTION: License copyright should list your name instead of 'Claude Recall Contributors'
24
26
 
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "topicId": "corrections",
3
- "sourceHash": "bc99031d99dbd5f9baeff51cd1b1d609f0a231dc120f5559a98080419ba54be6",
4
- "memoryCount": 9,
5
- "generatedAt": "2026-04-02T22:34:33.293Z",
3
+ "sourceHash": "5c1daafe3680229de9578ac9662cfe0bf88f182ba021c3c6a3f6bbf5271952af",
4
+ "memoryCount": 11,
5
+ "generatedAt": "2026-04-02T22:41:44.657Z",
6
6
  "memoryKeys": [
7
+ "memory_1775169704632_wzwczltzu",
8
+ "memory_1775169639101_rmxkftqtk",
7
9
  "memory_1775169273281_4fod7ku6f",
8
10
  "memory_1775169256118_y7kc07y6y",
9
11
  "memory_1775169244673_d6d0uc33a",
@@ -8,10 +8,20 @@ source: claude-recall
8
8
 
9
9
  # Preferences
10
10
 
11
- Auto-generated from 39 memories. Last updated: 2026-04-02.
11
+ Auto-generated from 49 memories. Last updated: 2026-04-02.
12
12
 
13
13
  ## Rules
14
14
 
15
+ - Session test preference 1775169704849
16
+ - Test preference 1775169704668-2
17
+ - Test preference 1775169704668-1
18
+ - Test preference 1775169704668-0
19
+ - Test memory content
20
+ - Session test preference 1775169639212
21
+ - Test preference 1775169639121-2
22
+ - Test preference 1775169639121-1
23
+ - Test preference 1775169639121-0
24
+ - Test memory content
15
25
  - Session test preference 1775169273366
16
26
  - Test preference 1775169273296-2
17
27
  - Test preference 1775169273296-1
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "topicId": "preferences",
3
- "sourceHash": "d609433b68eba6dbfaea5244e666c564e76ad1be0f75373c555fdd83405390cd",
4
- "memoryCount": 39,
5
- "generatedAt": "2026-04-02T22:34:33.383Z",
3
+ "sourceHash": "d1432e49e98d6e35259821bf6ebfbcc069c3a7ff9ec78618c660c979a7337842",
4
+ "memoryCount": 49,
5
+ "generatedAt": "2026-04-02T22:41:44.902Z",
6
6
  "memoryKeys": [
7
+ "memory_1775169704852_ezdebznpz",
8
+ "memory_1775169704771_ak9vkaswc",
9
+ "memory_1775169704739_dg78h7lte",
10
+ "memory_1775169704670_f1yhtrmsz",
11
+ "memory_1775169704515_lby33vw9c",
12
+ "memory_1775169639213_w3i85h357",
13
+ "memory_1775169639170_iewh2evi0",
14
+ "memory_1775169639145_x9s0519l7",
15
+ "memory_1775169639123_fa53agp0a",
16
+ "memory_1775169639037_f290kffwd",
7
17
  "memory_1775169273368_c1e5jdl9r",
8
18
  "memory_1775169273337_wozxe12k3",
9
19
  "memory_1775169273319_3o1ww90na",
@@ -19,6 +19,22 @@ const LOAD_RULES_DIRECTIVE = 'Before your FIRST action, briefly state which rule
19
19
  '(applied from memory: <short rule name>)\n' +
20
20
  'Place citations next to the action they influenced — not at the end of unrelated text.\n' +
21
21
  'If a rule conflicts with your plan, follow the rule — it reflects a user decision.';
22
+ function truncateStr(s, max) {
23
+ return s.length <= max ? s : s.substring(0, max - 3) + '...';
24
+ }
25
+ /** Check if tool output indicates a failure (mirrors event-processors logic). */
26
+ function isFailureOutput(toolName, output) {
27
+ if (toolName === 'bash' || toolName === 'Bash') {
28
+ return /Exit code (\d+)/.test(output) && !/Exit code 0/.test(output);
29
+ }
30
+ if (['edit', 'write', 'Edit', 'Write'].includes(toolName)) {
31
+ return /permission denied|EACCES|ENOENT|file not found|old_string.*not found|not unique in the file/i.test(output);
32
+ }
33
+ if (output.length < 500) {
34
+ return /error|failed|exception|timeout/i.test(output);
35
+ }
36
+ return false;
37
+ }
22
38
  /** Format a memory value for display. */
23
39
  function extractVal(value) {
24
40
  if (typeof value === 'string')
@@ -90,12 +106,26 @@ function default_1(pi) {
90
106
  }
91
107
  });
92
108
  // --- Event: capture tool outcomes ---
93
- pi.on('tool_result', (event, _ctx) => {
109
+ pi.on('tool_result', (event, ctx) => {
94
110
  const output = event.content
95
111
  .filter((c) => c.type === 'text')
96
112
  .map(c => c.text)
97
113
  .join('\n');
98
- (0, event_processors_1.processToolOutcome)(event.toolName, event.input, output, event.isError, sessionId);
114
+ const result = (0, event_processors_1.processToolOutcome)(event.toolName, event.input, output, event.isError, sessionId);
115
+ if (ctx.hasUI) {
116
+ const label = event.input?.command
117
+ ? truncateStr(event.input.command, 40)
118
+ : event.toolName;
119
+ try {
120
+ if (result.captured) {
121
+ ctx.ui.notify(`Recall: failure stored — ${label}`, 'info');
122
+ }
123
+ else if (result.fixPaired) {
124
+ ctx.ui.notify(`Recall: fix paired — ${label} (learned from previous failure)`, 'info');
125
+ }
126
+ }
127
+ catch { /* non-critical */ }
128
+ }
99
129
  });
100
130
  // --- Event: detect corrections from user input ---
101
131
  pi.on('input', (event, _ctx) => {
@@ -140,18 +140,20 @@ function firstLine(s) {
140
140
  * Works for any tool type (Bash, Edit, Write, MCP, generic).
141
141
  */
142
142
  function processToolOutcome(toolName, toolInput, toolOutput, isError, sessionId) {
143
+ const result = { captured: false, fixPaired: false };
143
144
  try {
144
145
  // Skip own tools
145
146
  if (toolName.includes('claude-recall') || toolName.includes('claude_recall') ||
146
147
  toolName.startsWith('recall_'))
147
- return;
148
+ return result;
148
149
  const isFail = isError || isToolFailureOutput(toolName, toolOutput);
149
150
  if (isFail) {
150
151
  storeToolFailure(toolName, toolInput, toolOutput, sessionId);
152
+ result.captured = true;
151
153
  }
152
154
  else {
153
155
  // Success — check if this fixes a recent failure
154
- tryPairFix(toolName, toolInput, toolOutput);
156
+ result.fixPaired = tryPairFix(toolName, toolInput, toolOutput);
155
157
  }
156
158
  // Record outcome event for all tools
157
159
  recordOutcomeEvent(toolName, toolInput, toolOutput);
@@ -159,6 +161,7 @@ function processToolOutcome(toolName, toolInput, toolOutput, isError, sessionId)
159
161
  catch (err) {
160
162
  logFn('event-processor', `processToolOutcome error: ${(0, shared_1.safeErrorMessage)(err)}`);
161
163
  }
164
+ return result;
162
165
  }
163
166
  function isToolFailureOutput(toolName, output) {
164
167
  if (toolName === 'Bash' || toolName === 'bash') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.20.2",
3
+ "version": "0.20.4",
4
4
  "description": "Persistent memory for Claude Code and Pi with native Skills integration, automatic capture, failure learning, and project scoping",
5
5
  "main": "dist/index.js",
6
6
  "bin": {