claude-recall 0.18.9 → 0.20.0
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/skills/auto-corrections/SKILL.md +1 -16
- package/.claude/skills/auto-corrections/manifest.json +7 -22
- package/.claude/skills/auto-failure-lessons/SKILL.md +1 -9
- package/.claude/skills/auto-failure-lessons/manifest.json +3 -11
- package/.claude/skills/auto-preferences/SKILL.md +14 -19
- package/.claude/skills/auto-preferences/manifest.json +19 -24
- package/README.md +51 -58
- package/dist/cli/claude-recall-cli.js +13 -3
- package/dist/cli/commands/hook-commands.js +13 -2
- package/dist/hooks/memory-stop-hook.js +31 -4
- package/dist/hooks/memory-sync-hook.js +163 -77
- package/dist/hooks/tool-outcome-watcher.js +430 -0
- package/dist/mcp/prompts-handler.js +126 -0
- package/dist/mcp/server.js +17 -1
- package/dist/mcp/tools/memory-tools.js +18 -4
- package/dist/pi/extension.js +295 -0
- package/dist/services/memory.js +41 -0
- package/dist/services/outcome-storage.js +8 -0
- package/dist/shared/event-processors.js +327 -0
- package/package.json +7 -2
- package/skills/memory-management.md +32 -0
|
@@ -8,30 +8,15 @@ source: claude-recall
|
|
|
8
8
|
|
|
9
9
|
# Corrections
|
|
10
10
|
|
|
11
|
-
Auto-generated from
|
|
11
|
+
Auto-generated from 5 memories. Last updated: 2026-04-02.
|
|
12
12
|
|
|
13
13
|
## Rules
|
|
14
14
|
|
|
15
|
-
- CORRECTION: Memory with complex metadata
|
|
16
|
-
- CORRECTION: Memory with complex metadata
|
|
17
|
-
- CORRECTION: Memory with complex metadata
|
|
18
|
-
- CORRECTION: Memory with complex metadata
|
|
19
|
-
- CORRECTION: Memory with complex metadata
|
|
20
|
-
- CORRECTION: Memory with complex metadata
|
|
21
|
-
- CORRECTION: Memory with complex metadata
|
|
22
|
-
- CORRECTION: Memory with complex metadata
|
|
23
15
|
- CORRECTION: Memory with complex metadata
|
|
24
16
|
- CORRECTION: Memory with complex metadata
|
|
25
17
|
- CORRECTION: Memory with complex metadata
|
|
26
18
|
- CORRECTION: License copyright should include user's name instead of 'Claude Recall Contributors'
|
|
27
|
-
- CORRECTION: Replace expired access token with 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
|
|
28
|
-
- CORRECTION: use spaces not tabs for indentation
|
|
29
19
|
- CORRECTION: License copyright should list your name instead of 'Claude Recall Contributors'
|
|
30
|
-
- CORRECTION: cited (loaded 5+ times): 19
|
|
31
|
-
- CORRECTION: cited (loaded 5+ times): 19
|
|
32
|
-
- CORRECTION: cited (loaded 5+ times): 19
|
|
33
|
-
- CORRECTION: cited (loaded 5+ times): 19
|
|
34
|
-
- CORRECTION: cited (loaded 5+ times): 19
|
|
35
20
|
|
|
36
21
|
---
|
|
37
22
|
*Auto-generated by Claude Recall. Regenerate: `npx claude-recall skills generate`*
|
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"topicId": "corrections",
|
|
3
|
-
"sourceHash": "
|
|
4
|
-
"memoryCount":
|
|
5
|
-
"generatedAt": "2026-
|
|
3
|
+
"sourceHash": "a88187b382c2104a20922fd98e9de60d9ef6434a0a5e25f03a011998b491290f",
|
|
4
|
+
"memoryCount": 5,
|
|
5
|
+
"generatedAt": "2026-04-02T19:49:59.553Z",
|
|
6
6
|
"memoryKeys": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"memory_1774104588311_65kg08e05",
|
|
11
|
-
"memory_1773140547102_2wmy0cfga",
|
|
12
|
-
"memory_1773065886725_rscm7v2qx",
|
|
13
|
-
"memory_1773063478046_x0ryr9bk4",
|
|
14
|
-
"memory_1773063445947_2r842dw2l",
|
|
15
|
-
"memory_1772641994141_ddvzwdkd9",
|
|
16
|
-
"memory_1772641570519_wmnb2b08w",
|
|
17
|
-
"memory_1772641026962_tqm8ow04r",
|
|
7
|
+
"memory_1775159399542_awfryrxp3",
|
|
8
|
+
"memory_1775157082825_8uvrul28i",
|
|
9
|
+
"memory_1775156381094_dr1nihes8",
|
|
18
10
|
"hook_correction_1774180798682_9b5a2hadq",
|
|
19
|
-
"
|
|
20
|
-
"hook_correction_1771112125882_99ihypf8x",
|
|
21
|
-
"hook_correction_1774180805192_4ft4zhfsa",
|
|
22
|
-
"hook_correction_1772638229134_otn9za2il",
|
|
23
|
-
"hook_correction_1772636083381_th3eluwzv",
|
|
24
|
-
"hook_correction_1772635851763_y91ugnjgy",
|
|
25
|
-
"hook_correction_1772633504532_l6yo1jvun",
|
|
26
|
-
"hook_correction_1772633492812_0iqsrgnl2"
|
|
11
|
+
"hook_correction_1774180805192_4ft4zhfsa"
|
|
27
12
|
]
|
|
28
13
|
}
|
|
@@ -8,27 +8,19 @@ source: claude-recall
|
|
|
8
8
|
|
|
9
9
|
# Failure Lessons
|
|
10
10
|
|
|
11
|
-
Auto-generated from
|
|
11
|
+
Auto-generated from 16 memories. Last updated: 2026-04-02.
|
|
12
12
|
|
|
13
13
|
## Rules
|
|
14
14
|
|
|
15
15
|
- SQLite query syntax error: LIKE clause requires single quotes around string literal, not double quotes
|
|
16
16
|
- Avoid: Command failed: claude-recall outcomes 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
|
|
17
17
|
- Avoid: Command failed: npm whoami 2>&1 && npm config get registry 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
|
|
18
|
-
- npm install -g claude-recall@0.15.36 failed with notarget error
|
|
19
|
-
- claude-recall@0.15.36 does not exist on npm registry (ETARGET error)
|
|
20
|
-
- npm install failed: claude-recall@0.15.36 version not found in registry
|
|
21
|
-
- npm package claude-recall@0.15.36 does not exist - version not found in registry
|
|
22
|
-
- npm package claude-recall@0.15.36 not found - version does not exist in registry
|
|
23
18
|
- Claude-recall MCP Server failed to start with npx claude-recall@latest mcp start
|
|
24
19
|
- Claude-recall MCP Server failed to start with command: npx -y claude-recall@latest mcp start
|
|
25
20
|
- Avoid: Command failed: npm run build 2>&1 | tail -3 && npm test 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
|
|
26
21
|
- Avoid: Command failed: npx jest tests/unit/failure-detectors.test.ts 2>&1 → Instead: Check command syntax, file paths, and prerequisites before running
|
|
27
|
-
- Missing dependency: better-sqlite3 module not installed
|
|
28
|
-
- Missing dependency: better-sqlite3 module not installed
|
|
29
22
|
- SQLite query error: LIKE clause needs proper string literal syntax with single quotes in better-sqlite3
|
|
30
23
|
- Node.js syntax error: multiline strings in -e flag not properly escaped; newlines break the command parsing
|
|
31
|
-
- npm package claude-recall@0.15.14 not found in registry - 404 error during installation
|
|
32
24
|
- Avoid: Test command reported failures: npx jest tests/unit/failure-detectors.test.ts 2>&1 → Instead: Read test output carefully — exit code 0 does not mean all tests passed
|
|
33
25
|
- Node.js -e flag cannot parse multiline strings with unescaped newlines in single quotes
|
|
34
26
|
- claude-recall reconnection failed after reinstall
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"topicId": "failure-lessons",
|
|
3
|
-
"sourceHash": "
|
|
4
|
-
"memoryCount":
|
|
5
|
-
"generatedAt": "2026-
|
|
3
|
+
"sourceHash": "f3351c090380fb67413721e169ecee6882c991fff7f46e1bbd3b13b208e4c24b",
|
|
4
|
+
"memoryCount": 16,
|
|
5
|
+
"generatedAt": "2026-04-02T18:23:28.296Z",
|
|
6
6
|
"memoryKeys": [
|
|
7
7
|
"hook_failure_1772637584921_0tj4rrxnt",
|
|
8
8
|
"hook_failure_non-zero-exit_1774020949485_6ubuoswae",
|
|
9
9
|
"hook_failure_non-zero-exit_1773409269877_ful451241",
|
|
10
|
-
"hook_failure_1773410916808_5k1r6zo4u",
|
|
11
|
-
"hook_failure_1773410916789_xtrb8j9nw",
|
|
12
|
-
"hook_failure_1773410910825_rd25wy0tf",
|
|
13
|
-
"hook_failure_1773410885720_u05tuf2dk",
|
|
14
|
-
"hook_failure_1773410874391_kbnfssg62",
|
|
15
10
|
"hook_failure_1773409616313_gmsfcbuzh",
|
|
16
11
|
"hook_failure_1773409607268_83ie5yunz",
|
|
17
12
|
"hook_failure_non-zero-exit_1773068793859_0z0ah0743",
|
|
18
13
|
"hook_failure_non-zero-exit_1772640279977_g3gwlfoqi",
|
|
19
|
-
"hook_failure_1772637646276_ow6m7pr34",
|
|
20
|
-
"hook_failure_1772637630961_6gsnac7cw",
|
|
21
14
|
"hook_failure_1772637570984_yxs8zmurp",
|
|
22
15
|
"hook_failure_1772637485532_djep8eysa",
|
|
23
|
-
"hook_failure_1771937269919_jx3wvpyxq",
|
|
24
16
|
"hook_failure_silent-test-failure_1772640279996_m8f3ks8fw",
|
|
25
17
|
"hook_failure_1772637495154_i21dho3dv",
|
|
26
18
|
"hook_failure_1773410663873_oegccxk83",
|
|
@@ -8,31 +8,26 @@ source: claude-recall
|
|
|
8
8
|
|
|
9
9
|
# Preferences
|
|
10
10
|
|
|
11
|
-
Auto-generated from
|
|
11
|
+
Auto-generated from 17 memories. Last updated: 2026-04-02.
|
|
12
12
|
|
|
13
13
|
## Rules
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
- Test preference
|
|
17
|
-
- Test preference
|
|
18
|
-
- Test preference
|
|
19
|
-
- Test memory content
|
|
20
|
-
- Test preference 1774191618111-2
|
|
21
|
-
- Test preference 1774191618111-1
|
|
22
|
-
- Test preference 1774191618111-0
|
|
15
|
+
- Session test preference 1775159399698
|
|
16
|
+
- Test preference 1775159399559-2
|
|
17
|
+
- Test preference 1775159399559-1
|
|
18
|
+
- Test preference 1775159399559-0
|
|
23
19
|
- Test memory content
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Test preference
|
|
27
|
-
- Test preference
|
|
28
|
-
- Test preference 1774106331283-0
|
|
20
|
+
- Session test preference 1775157082982
|
|
21
|
+
- Test preference 1775157082853-2
|
|
22
|
+
- Test preference 1775157082853-1
|
|
23
|
+
- Test preference 1775157082853-0
|
|
29
24
|
- Test memory content
|
|
30
|
-
- Session test preference
|
|
31
|
-
- Test preference
|
|
32
|
-
- Test preference
|
|
33
|
-
- Test preference
|
|
25
|
+
- Session test preference 1775156381211
|
|
26
|
+
- Test preference 1775156381110-2
|
|
27
|
+
- Test preference 1775156381110-1
|
|
28
|
+
- Test preference 1775156381110-0
|
|
34
29
|
- Test memory content
|
|
35
|
-
-
|
|
30
|
+
- axios npm package was compromised in a supply chain attack (axios@1.14.1 pulled in malicious plain-crypto-js@4.2.1). Claude Recall is NOT affected — does not use axios. Verified 2026-04-01. If axios is ever added as a dependency, pin the version and audit lockfiles.
|
|
36
31
|
- Upgrade all projects whenever a new version is pushed
|
|
37
32
|
|
|
38
33
|
---
|
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"topicId": "preferences",
|
|
3
|
-
"sourceHash": "
|
|
4
|
-
"memoryCount":
|
|
5
|
-
"generatedAt": "2026-04-
|
|
3
|
+
"sourceHash": "13276d13523c8f8ec13ae9948cfa0e2cdd8ca5cd0fd6453b544307ae47d91df5",
|
|
4
|
+
"memoryCount": 17,
|
|
5
|
+
"generatedAt": "2026-04-02T19:49:59.727Z",
|
|
6
6
|
"memoryKeys": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"memory_1774104588351_whsk5rvw3",
|
|
24
|
-
"memory_1774104588338_80cx2o3jv",
|
|
25
|
-
"memory_1774104588325_g4o5ksubl",
|
|
26
|
-
"memory_1774104588255_fy0wv845g",
|
|
27
|
-
"memory_1774020789927_g99mrubvu",
|
|
7
|
+
"memory_1775159399702_yg6ynd05n",
|
|
8
|
+
"memory_1775159399631_fmy4s2vhr",
|
|
9
|
+
"memory_1775159399606_xymkvcjfv",
|
|
10
|
+
"memory_1775159399561_o6vpb3fto",
|
|
11
|
+
"memory_1775159399463_0pvhuixyr",
|
|
12
|
+
"memory_1775157082984_oiyt9u65w",
|
|
13
|
+
"memory_1775157082927_29d7mm59z",
|
|
14
|
+
"memory_1775157082892_o9i0jbw76",
|
|
15
|
+
"memory_1775157082855_zlbl2ib0j",
|
|
16
|
+
"memory_1775157082743_fu07oklto",
|
|
17
|
+
"memory_1775156381212_ptlo01224",
|
|
18
|
+
"memory_1775156381158_3p6goornd",
|
|
19
|
+
"memory_1775156381132_ikx95mk0n",
|
|
20
|
+
"memory_1775156381111_1x4fxfu9n",
|
|
21
|
+
"memory_1775156381012_3tw7we7cz",
|
|
22
|
+
"memory_1775154208266_arwo2fctx",
|
|
28
23
|
"hook_preference_1774106575282_45sk4ep52"
|
|
29
24
|
]
|
|
30
25
|
}
|
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Claude Recall
|
|
2
2
|
|
|
3
|
-
### Persistent, local memory for
|
|
3
|
+
### Persistent, local memory for coding agents — learn from every session.
|
|
4
4
|
|
|
5
|
-
Claude Recall is a **local memory engine
|
|
5
|
+
Claude Recall is a **local memory engine** that gives coding agents something they're missing by default:
|
|
6
6
|
**the ability to learn from you over time.**
|
|
7
7
|
|
|
8
|
+
Works with **Claude Code** (via MCP server + hooks) and **[Pi](https://github.com/mariozechner/pi)** (via native extension). Both share the same local database — a preference learned in one agent is available in the other.
|
|
9
|
+
|
|
8
10
|
Your preferences, project structure, workflows, corrections, and coding style are captured automatically and applied in future sessions — **securely stored on your machine**.
|
|
9
11
|
|
|
10
12
|
---
|
|
@@ -12,9 +14,9 @@ Your preferences, project structure, workflows, corrections, and coding style ar
|
|
|
12
14
|
## Features
|
|
13
15
|
|
|
14
16
|
- **Smart Memory Capture** — LLM-powered classification (via Claude Haiku) detects preferences and corrections from natural language, with silent regex fallback
|
|
15
|
-
- **Project-Scoped Knowledge** — each project gets its own memory namespace; switch projects and
|
|
16
|
-
- **Failure Learning** — captures what failed, why, and what to do instead — so
|
|
17
|
-
- **Outcome-Aware Learning** — tracks action outcomes (
|
|
17
|
+
- **Project-Scoped Knowledge** — each project gets its own memory namespace; switch projects and the agent switches context automatically
|
|
18
|
+
- **Failure Learning** — captures what failed, why, and what to do instead — so the agent doesn't repeat mistakes
|
|
19
|
+
- **Outcome-Aware Learning** — tracks action outcomes (all tool results, test cycles, user corrections), synthesizes candidate lessons, and promotes validated patterns into active rules automatically
|
|
18
20
|
- **Skill Crystallization** — auto-generates `.claude/skills/auto-*/` files from accumulated memories, using Anthropic's [Agent Skills](https://agentskills.io/) open standard
|
|
19
21
|
- **Local-Only** — SQLite on your machine, no telemetry, no cloud, works fully offline
|
|
20
22
|
|
|
@@ -29,60 +31,46 @@ Your preferences, project structure, workflows, corrections, and coding style ar
|
|
|
29
31
|
| Node.js | **20+** | required for better-sqlite3 |
|
|
30
32
|
| OS | macOS / Linux / Windows | WSL supported |
|
|
31
33
|
|
|
32
|
-
### Install
|
|
33
|
-
|
|
34
|
-
Run these from your project directory:
|
|
34
|
+
### Install for Claude Code
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
#
|
|
38
|
-
claude mcp remove claude-recall
|
|
39
|
-
|
|
40
|
-
# 2. Clear npm cache
|
|
41
|
-
npm cache clean --force
|
|
42
|
-
|
|
43
|
-
# 3. Uninstall global claude-recall
|
|
44
|
-
npm uninstall -g claude-recall
|
|
45
|
-
|
|
46
|
-
# 4. Install global claude-recall
|
|
37
|
+
# Install globally
|
|
47
38
|
npm install -g claude-recall
|
|
48
39
|
|
|
49
|
-
#
|
|
40
|
+
# Set up hooks and skills in your project
|
|
50
41
|
claude-recall setup --install
|
|
51
42
|
|
|
52
|
-
#
|
|
43
|
+
# Register MCP server
|
|
53
44
|
claude mcp add claude-recall -- claude-recall mcp start
|
|
54
45
|
```
|
|
55
46
|
|
|
56
|
-
Then restart your Claude Code session.
|
|
47
|
+
Then restart your Claude Code session. For additional projects, only the last two commands are needed.
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
**Verify:** Ask *"Load my rules"* — Claude should call `mcp__claude-recall__load_rules`.
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
### Install for Pi
|
|
61
52
|
|
|
62
53
|
```bash
|
|
63
|
-
claude-recall
|
|
64
|
-
claude mcp add claude-recall -- claude-recall mcp start
|
|
54
|
+
pi install npm:claude-recall
|
|
65
55
|
```
|
|
66
56
|
|
|
67
|
-
|
|
57
|
+
That's it. The extension registers tools and loads a skill automatically. No further configuration needed.
|
|
68
58
|
|
|
69
|
-
|
|
59
|
+
**Verify:** Start Pi and ask *"Load my rules"* — Pi should call `recall_load_rules`.
|
|
70
60
|
|
|
71
|
-
|
|
61
|
+
### Shared Database
|
|
72
62
|
|
|
73
|
-
|
|
63
|
+
Both agents use the same database (`~/.claude-recall/claude-recall.db`). Memories are scoped per project by working directory. A correction learned in Claude Code is available in Pi and vice versa.
|
|
74
64
|
|
|
75
65
|
### Upgrading
|
|
76
66
|
|
|
77
|
-
When a new version is published, update the global binary — no per-project reinstall needed:
|
|
78
|
-
|
|
79
67
|
```bash
|
|
80
|
-
|
|
81
|
-
npm uninstall -g claude-recall
|
|
68
|
+
# Claude Code
|
|
82
69
|
npm install -g claude-recall
|
|
83
|
-
```
|
|
84
70
|
|
|
85
|
-
|
|
71
|
+
# Pi
|
|
72
|
+
pi update claude-recall
|
|
73
|
+
```
|
|
86
74
|
|
|
87
75
|
---
|
|
88
76
|
|
|
@@ -90,21 +78,20 @@ Then restart Claude Code sessions in each project to pick up the new version.
|
|
|
90
78
|
|
|
91
79
|
Once installed, Claude Recall works automatically in the background:
|
|
92
80
|
|
|
93
|
-
1. **
|
|
94
|
-
2. **As you work** —
|
|
95
|
-
3. **
|
|
96
|
-
4. **
|
|
97
|
-
5. **Reask detection** —
|
|
98
|
-
6. **Before context compression** —
|
|
99
|
-
7. **Rules sync
|
|
81
|
+
1. **Session start** — active rules are loaded before the first action. In Claude Code, this happens via the `search_enforcer` hook; in Pi, rules are injected into the system prompt automatically
|
|
82
|
+
2. **As you work** — every prompt is classified for corrections and preferences. Natural statements like *"we use tabs here"* or *"no, put tests in `__tests__/`"* are detected and stored
|
|
83
|
+
3. **Tool outcomes** — results from all tools (Bash, Edit, Write, and more) are captured. Failures are stored as memories; Bash failures are paired with successful fixes
|
|
84
|
+
4. **End of session** — session episodes are created, candidate lessons extracted from failures, and a promotion cycle graduates validated patterns into active rules
|
|
85
|
+
5. **Reask detection** — frustration signals ("still broken", "that didn't work") are recorded as outcome events
|
|
86
|
+
6. **Before context compression** — aggressive memory sweep captures important context before the window shrinks
|
|
87
|
+
7. **Rules sync** (Claude Code only) — top 30 rules are exported as typed `.md` files to Claude Code's native memory directory
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
Classification uses Claude Haiku (via `ANTHROPIC_API_KEY`) with silent regex fallback. No configuration needed.
|
|
102
90
|
|
|
103
|
-
**Next session:** `load_rules` returns everything captured previously —
|
|
91
|
+
**Next session:** `load_rules` returns everything captured previously — the agent applies your preferences without being told twice.
|
|
104
92
|
|
|
105
93
|
```bash
|
|
106
94
|
# Verify it's working
|
|
107
|
-
cat ~/.claude-recall/hook-logs/correction-detector.log
|
|
108
95
|
claude-recall stats
|
|
109
96
|
claude-recall search "preference"
|
|
110
97
|
```
|
|
@@ -113,28 +100,34 @@ claude-recall search "preference"
|
|
|
113
100
|
|
|
114
101
|
## How It Works
|
|
115
102
|
|
|
116
|
-
Claude Recall
|
|
103
|
+
Claude Recall provides four memory tools backed by a local SQLite database with WAL mode, content-hash deduplication, and automatic compaction. The tools are exposed differently depending on the agent:
|
|
104
|
+
|
|
105
|
+
- **Claude Code** — MCP server with four tools and seven prompts, plus file-system hooks for automatic capture
|
|
106
|
+
- **Pi** — native extension with registered tools and event handlers, plus a skill file for behavioral guidance
|
|
107
|
+
|
|
108
|
+
| Tool | Claude Code | Pi |
|
|
109
|
+
| ---- | ----------- | --- |
|
|
110
|
+
| Load rules | `mcp__claude-recall__load_rules` | `recall_load_rules` |
|
|
111
|
+
| Store memory | `mcp__claude-recall__store_memory` | `recall_store_memory` |
|
|
112
|
+
| Search memory | `mcp__claude-recall__search_memory` | `recall_search_memory` |
|
|
113
|
+
| Delete memory | `mcp__claude-recall__delete_memory` | `recall_delete_memory` |
|
|
117
114
|
|
|
118
|
-
###
|
|
115
|
+
### Skills
|
|
119
116
|
|
|
120
|
-
Claude Recall uses
|
|
117
|
+
Claude Recall uses skill files to teach agents when and how to use memory tools:
|
|
121
118
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
| `load_rules` | Load all active rules (preferences, corrections, failures, devops) at the start of a task |
|
|
125
|
-
| `store_memory` | Save new knowledge — preferences, corrections, devops rules, failures |
|
|
126
|
-
| `search_memory` | Search memories by keyword, ranked by relevance |
|
|
127
|
-
| `delete_memory` | Delete a specific memory by ID |
|
|
119
|
+
- **Claude Code** — uses Anthropic's [Agent Skills](https://agentskills.io/) open standard. A core skill (`.claude/skills/memory-management/SKILL.md`) guides memory behavior with progressive disclosure. Auto-generated skills (`.claude/skills/auto-*/`) crystallize from accumulated memories. See Anthropic's [blog post](https://claude.com/blog/equipping-agents-for-the-real-world-with-agent-skills) for more.
|
|
120
|
+
- **Pi** — ships a `skills/memory-management.md` skill loaded via Pi's package manifest
|
|
128
121
|
|
|
129
|
-
### Outcome-Aware Learning
|
|
122
|
+
### Outcome-Aware Learning
|
|
130
123
|
|
|
131
|
-
Claude Recall tracks what happens *after*
|
|
124
|
+
Claude Recall tracks what happens *after* the agent acts — not just what was said. The outcome processing pipeline:
|
|
132
125
|
|
|
133
126
|
```
|
|
134
127
|
action → outcome event → episode → candidate lesson → promotion → active rule
|
|
135
128
|
```
|
|
136
129
|
|
|
137
|
-
- **Outcome events** capture
|
|
130
|
+
- **Outcome events** capture results from all tool types (Bash, Edit, Write, MCP), test outcomes, user corrections, and reask signals
|
|
138
131
|
- **Episodes** summarize entire sessions with outcome type, severity, and confidence
|
|
139
132
|
- **Candidate lessons** are extracted from failure patterns — deduplicated by Jaccard similarity
|
|
140
133
|
- **Promotion engine** graduates lessons into active rules after 2+ observations (or immediately for high-severity failures), and demotes never-helpful memories
|
|
@@ -216,7 +209,7 @@ claude-recall hook run memory-sync # Stop + PreCompact hook (syncs rul
|
|
|
216
209
|
|
|
217
210
|
## Project Scoping
|
|
218
211
|
|
|
219
|
-
Each project gets isolated memory based on its working directory. **Project ID** is derived from the `cwd`
|
|
212
|
+
Each project gets isolated memory based on its working directory. **Project ID** is derived from the `cwd` passed by the agent. Universal memories (no project scope) are available everywhere. Switching projects switches memory automatically.
|
|
220
213
|
|
|
221
214
|
Database location: `~/.claude-recall/claude-recall.db` (shared file, scoped by `project_id` column).
|
|
222
215
|
|
|
@@ -693,15 +693,25 @@ async function main() {
|
|
|
693
693
|
// This avoids registry lookups on every hook invocation.
|
|
694
694
|
const cliScript = path.join(packageDir, 'dist', 'cli', 'claude-recall-cli.js');
|
|
695
695
|
const hookCmd = `node ${cliScript} hook run`;
|
|
696
|
-
settings.hooksVersion = '
|
|
696
|
+
settings.hooksVersion = '10.0.0'; // v10 = add PostToolUseFailure for explicit error capture
|
|
697
697
|
settings.hooks = {
|
|
698
698
|
PostToolUse: [
|
|
699
699
|
{
|
|
700
|
-
matcher: "Bash",
|
|
701
700
|
hooks: [
|
|
702
701
|
{
|
|
703
702
|
type: "command",
|
|
704
|
-
command: `${hookCmd}
|
|
703
|
+
command: `${hookCmd} tool-outcome-watcher`,
|
|
704
|
+
timeout: 3
|
|
705
|
+
}
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
],
|
|
709
|
+
PostToolUseFailure: [
|
|
710
|
+
{
|
|
711
|
+
hooks: [
|
|
712
|
+
{
|
|
713
|
+
type: "command",
|
|
714
|
+
command: `${hookCmd} tool-failure`,
|
|
705
715
|
timeout: 3
|
|
706
716
|
}
|
|
707
717
|
]
|
|
@@ -75,14 +75,25 @@ class HookCommands {
|
|
|
75
75
|
await handleMemorySync(input);
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
|
+
case 'tool-outcome-watcher': {
|
|
79
|
+
const { handleToolOutcomeWatcher } = await Promise.resolve().then(() => __importStar(require('../../hooks/tool-outcome-watcher')));
|
|
80
|
+
await handleToolOutcomeWatcher(input);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case 'tool-failure': {
|
|
84
|
+
const { handleToolFailure } = await Promise.resolve().then(() => __importStar(require('../../hooks/tool-outcome-watcher')));
|
|
85
|
+
await handleToolFailure(input);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
78
88
|
case 'bash-failure-watcher': {
|
|
79
|
-
|
|
89
|
+
// Backward compat alias — routes to tool-outcome-watcher
|
|
90
|
+
const { handleBashFailureWatcher } = await Promise.resolve().then(() => __importStar(require('../../hooks/tool-outcome-watcher')));
|
|
80
91
|
await handleBashFailureWatcher(input);
|
|
81
92
|
break;
|
|
82
93
|
}
|
|
83
94
|
default:
|
|
84
95
|
console.error(`Unknown hook: ${name}`);
|
|
85
|
-
console.error('Available: correction-detector, memory-stop, precompact-preserve, memory-sync,
|
|
96
|
+
console.error('Available: correction-detector, memory-stop, precompact-preserve, memory-sync, tool-outcome-watcher');
|
|
86
97
|
}
|
|
87
98
|
}
|
|
88
99
|
catch {
|
|
@@ -111,13 +111,16 @@ async function handleMemoryStop(input) {
|
|
|
111
111
|
scanForCitations(transcriptPath);
|
|
112
112
|
// Scan transcript for failure signals (non-zero exits, test cycles, backtracking, etc.)
|
|
113
113
|
const failures = detectAndStoreFailures(transcriptPath, episodeId);
|
|
114
|
+
// Incorporate structured tool_failure events captured by PostToolUseFailure hook
|
|
115
|
+
const toolFailures = getToolFailureEvents(outcomeStorage);
|
|
116
|
+
const allFailures = [...failures, ...toolFailures];
|
|
114
117
|
outcomeStorage.updateEpisode(episodeId, {
|
|
115
|
-
outcome_type:
|
|
116
|
-
severity:
|
|
117
|
-
outcome_summary: `${stored} memories, ${failures.length}
|
|
118
|
+
outcome_type: allFailures.length > 0 ? 'failure' : 'success',
|
|
119
|
+
severity: allFailures.length > 0 ? 'medium' : 'low',
|
|
120
|
+
outcome_summary: `${stored} memories, ${allFailures.length} failures (${toolFailures.length} from tool events)`,
|
|
118
121
|
});
|
|
119
122
|
// Generate candidate lessons from high-confidence failures
|
|
120
|
-
generateCandidateLessons(
|
|
123
|
+
generateCandidateLessons(allFailures, episodeId, projectId);
|
|
121
124
|
// Run promotion cycle
|
|
122
125
|
try {
|
|
123
126
|
const { PromotionEngine } = await Promise.resolve().then(() => __importStar(require('../services/promotion-engine')));
|
|
@@ -312,6 +315,30 @@ function detectAndStoreFailures(transcriptPath, episodeId) {
|
|
|
312
315
|
return [];
|
|
313
316
|
}
|
|
314
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Convert structured tool_failure outcome events into DetectedFailure format
|
|
320
|
+
* so they feed into the candidate lessons pipeline.
|
|
321
|
+
*/
|
|
322
|
+
function getToolFailureEvents(outcomeStorage) {
|
|
323
|
+
try {
|
|
324
|
+
const events = outcomeStorage.getEventsByType('tool_failure', 1); // last 1 hour
|
|
325
|
+
return events.slice(0, 5).map(e => ({
|
|
326
|
+
signal: 'tool_failure',
|
|
327
|
+
confidence: 0.8,
|
|
328
|
+
content: {
|
|
329
|
+
what_failed: e.action_summary || 'Tool failure',
|
|
330
|
+
why_failed: e.next_state_summary,
|
|
331
|
+
what_should_do: 'Check inputs and prerequisites before retrying',
|
|
332
|
+
context: `Captured by PostToolUseFailure hook`,
|
|
333
|
+
preventative_checks: ['Verify tool inputs are correct'],
|
|
334
|
+
},
|
|
335
|
+
}));
|
|
336
|
+
}
|
|
337
|
+
catch (err) {
|
|
338
|
+
(0, shared_1.hookLog)('memory-stop', `Tool failure events error: ${(0, shared_1.safeErrorMessage)(err)}`);
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
315
342
|
/**
|
|
316
343
|
* Generate candidate lessons from high-confidence failures.
|
|
317
344
|
* Deduplicates against existing lessons and increments evidence count for similar ones.
|