get-claudia 1.51.21 → 1.51.22
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/package.json +1 -1
- package/template-v2/.claude/hooks/hooks.json +14 -14
- package/template-v2/.claude/hooks/pre-compact.py +9 -23
- package/template-v2/.claude/hooks/pre-compact.sh +3 -7
- package/template-v2/.claude/rules/memory-availability.md +20 -15
- package/template-v2/.claude/skills/capture-meeting/SKILL.md +12 -19
- package/template-v2/.claude/skills/meditate/SKILL.md +12 -14
- package/template-v2/.claude/skills/memory-manager.md +153 -153
- package/template-v2/.claude/skills/morning-brief/SKILL.md +11 -11
- package/template-v2/CLAUDE.md +12 -17
package/package.json
CHANGED
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
],
|
|
15
15
|
"on_missing_me": "trigger_onboarding",
|
|
16
16
|
"memory_verification": {
|
|
17
|
-
"step_1_check_cli": "BEFORE anything else, verify the `claudia` CLI is available by running `claudia system-health --project-dir \"$PWD\"` via Bash tool. If the command fails or is not found: (1) Do NOT fall back to plugin:episodic-memory, mcp__plugin_episodic-memory_*, or any other memory search tool as a substitute — these give inferior, unrelated results and mask the real problem. (2) Tell the user: 'My memory tools are not available. The
|
|
18
|
-
"
|
|
19
|
-
"fallback": "If
|
|
17
|
+
"step_1_check_cli": "BEFORE anything else, verify the `claudia` CLI is available by running `claudia system-health --project-dir \"$PWD\"` via Bash tool. This checks that the claudia-memory daemon is configured and responsive. If the command fails or is not found: (1) Do NOT fall back to plugin:episodic-memory, mcp__plugin_episodic-memory_*, or any other memory search tool as a substitute — these give inferior, unrelated results and mask the real problem. (2) Tell the user: 'My memory tools are not available. The claudia-memory daemon may not be running or may not be configured as an MCP server. Check that the daemon is listed in your .mcp.json and that it starts without errors. Your context files are preserved.' (3) Continue with context files only (context/me.md, etc.) until fixed.",
|
|
18
|
+
"step_2_load_context": "Call the `memory.session_context` MCP tool to get a formatted context block with recent memories, commitments, and unsummarized session alerts. If the MCP tool is not available, the daemon may not be properly configured. Suggest: 'The claudia-memory daemon may need to be configured in .mcp.json. Run claudia system-health for diagnostics.'",
|
|
19
|
+
"fallback": "If memory MCP tools are not available: (1) Do NOT use plugin:episodic-memory or any other memory search tool as a substitute. (2) Tell the user: 'My memory tools are not available. The claudia-memory daemon may not be configured as an MCP server.' (3) Read context files directly (context/me.md, context/commitments.md, context/learnings.md, context/patterns.md, context/waiting.md) as the fallback. Make clear to the user they are in degraded mode with no semantic search or cross-session learning."
|
|
20
20
|
},
|
|
21
21
|
"enhanced_memory": {
|
|
22
|
-
"context_load": "
|
|
23
|
-
"catch_up": "If unsummarized sessions are reported in the context block, review buffered turns and
|
|
24
|
-
"recall_context": "Use the loaded context for greeting. For deeper search on specific topics,
|
|
22
|
+
"context_load": "Call the `memory.session_context` MCP tool to get a formatted context block with recent memories, commitments, and unsummarized session alerts.",
|
|
23
|
+
"catch_up": "If unsummarized sessions are reported in the context block, review buffered turns and call the `memory.end_session` MCP tool with a retroactive narrative and structured extractions for each.",
|
|
24
|
+
"recall_context": "Use the loaded context for greeting. For deeper search on specific topics, call the `memory.recall` MCP tool with the relevant query."
|
|
25
25
|
},
|
|
26
26
|
"proactive_surfacing": {
|
|
27
27
|
"description": "Surface urgent items naturally in the greeting. Keep it to a brief mention, not a full report.",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
{
|
|
31
31
|
"type": "overdue_commitments",
|
|
32
32
|
"description": "Commitments older than 7 days without resolution",
|
|
33
|
-
"query_hint": "
|
|
33
|
+
"query_hint": "Call the `memory.recall` MCP tool with query about overdue commitments and check dates"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"type": "cooling_relationships",
|
|
37
37
|
"description": "Important people not mentioned in >30 days",
|
|
38
|
-
"query_hint": "
|
|
38
|
+
"query_hint": "Call the `memory.search_entities` MCP tool with type: person and check last_mentioned dates"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"examples": [
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
],
|
|
59
59
|
"save_mode": "merge",
|
|
60
60
|
"enhanced_memory": {
|
|
61
|
-
"summarize": "
|
|
61
|
+
"summarize": "Call the `memory.end_session` MCP tool with a narrative summary and structured extractions from the session's buffered turns. The narrative should enhance stored information with tone, context, unresolved threads, and nuance that structured fields cannot capture."
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
},
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
],
|
|
75
75
|
"notes": {
|
|
76
76
|
"implementation": "These hooks define intended behaviors. Claude Code will execute them as behavioral guidelines rather than traditional script execution.",
|
|
77
|
-
"memory_verification": "CRITICAL: At session start, verify
|
|
78
|
-
"session_start": "At session start: (1) Verify claudia
|
|
79
|
-
"session_end": "Before session ends, Claudia should generate a session summary (enhanced memory) or update context files (markdown fallback). The summary includes both a free-form narrative and structured extractions.",
|
|
77
|
+
"memory_verification": "CRITICAL: At session start, verify memory availability by running `claudia system-health --project-dir \"$PWD\"` BEFORE proceeding. If memory MCP tools are not available, do NOT use plugin:episodic-memory as a substitute. Tell the user the claudia-memory daemon may need to be configured. Fall back to context files only (context/me.md, etc.) in the meantime.",
|
|
78
|
+
"session_start": "At session start: (1) Verify claudia system-health passes, (2) Call the `memory.session_context` MCP tool, (3) Read context files, (4) Check for unsummarized sessions. If me.md is missing, trigger onboarding.",
|
|
79
|
+
"session_end": "Before session ends, Claudia should generate a session summary via the `memory.end_session` MCP tool (enhanced memory) or update context files (markdown fallback). The summary includes both a free-form narrative and structured extractions.",
|
|
80
80
|
"first_run": "The absence of context/me.md signals a first-run scenario requiring onboarding.",
|
|
81
|
-
"turn_buffering": "During sessions with enhanced memory, Claudia buffers each meaningful conversation turn via `
|
|
82
|
-
"source_filing": "CRITICAL: When processing transcripts, emails, or documents, ALWAYS
|
|
81
|
+
"turn_buffering": "During sessions with enhanced memory, Claudia buffers each meaningful conversation turn via the `memory.buffer_turn` MCP tool. This ensures nothing is lost even if the session ends abruptly. The buffered turns are summarized at session end or caught up at next session start.",
|
|
82
|
+
"source_filing": "CRITICAL: When processing transcripts, emails, or documents, ALWAYS call the `memory.file` MCP tool BEFORE extracting information. The Source Preservation principle (#12) is non-negotiable. Raw sources must be filed for provenance."
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""Cross-platform pre-compact hook for Claudia.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Injects context advisory before compaction so Claude knows to preserve
|
|
5
|
+
important information via MCP tools. Shell scripts cannot call MCP tools
|
|
6
|
+
directly, so this advisory tells Claude what to do after compaction.
|
|
5
7
|
"""
|
|
6
8
|
|
|
7
9
|
import json
|
|
8
|
-
import os
|
|
9
|
-
import shutil
|
|
10
|
-
import subprocess
|
|
11
|
-
|
|
12
|
-
# Run lightweight decay if claudia is available
|
|
13
|
-
claudia_bin = shutil.which("claudia")
|
|
14
|
-
if claudia_bin:
|
|
15
|
-
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", ".")
|
|
16
|
-
try:
|
|
17
|
-
subprocess.run(
|
|
18
|
-
[claudia_bin, "memory", "consolidate", "--lightweight",
|
|
19
|
-
"--project-dir", project_dir],
|
|
20
|
-
capture_output=True, timeout=10
|
|
21
|
-
)
|
|
22
|
-
except (FileNotFoundError, subprocess.TimeoutExpired, OSError):
|
|
23
|
-
pass
|
|
24
10
|
|
|
25
11
|
print(json.dumps({
|
|
26
12
|
"additionalContext": (
|
|
27
13
|
"Context compaction advisory: If important information was discussed recently, "
|
|
28
|
-
"ensure it has been stored. Check: (1) Commitments:
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"relate for connections mentioned. (4) Buffer:
|
|
32
|
-
"a summary if recent exchanges
|
|
33
|
-
"less frequent, but proactive capture remains good practice."
|
|
14
|
+
"ensure it has been stored via MCP tools. Check: (1) Commitments: call the "
|
|
15
|
+
"memory.remember MCP tool for any promises not yet stored. (2) People: call the "
|
|
16
|
+
"memory.entity MCP tool for anyone discussed in detail. (3) Relationships: call the "
|
|
17
|
+
"memory.relate MCP tool for connections mentioned. (4) Buffer: call the "
|
|
18
|
+
"memory.buffer_turn MCP tool with a summary if recent exchanges were not buffered. "
|
|
19
|
+
"With 1M context, compaction is less frequent, but proactive capture remains good practice."
|
|
34
20
|
)
|
|
35
21
|
}))
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# PreCompact hook: Advisory checkpoint before context compaction
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
# Run lightweight decay if claudia is available
|
|
6
|
-
if command -v claudia &>/dev/null; then
|
|
7
|
-
claudia memory consolidate --lightweight --project-dir "${CLAUDE_PROJECT_DIR:-.}" 2>/dev/null || true
|
|
8
|
-
fi
|
|
3
|
+
# Injects advisory into compacted context so Claude knows to preserve important information via MCP tools.
|
|
4
|
+
# Note: Shell scripts cannot call MCP tools directly. The advisory tells Claude what to do after compaction.
|
|
9
5
|
|
|
10
6
|
# Inject advisory into compacted context
|
|
11
7
|
cat <<EOF
|
|
12
8
|
{
|
|
13
|
-
"additionalContext": "Context compaction advisory: If important information was discussed recently, ensure it has been stored. Check: (1) Commitments:
|
|
9
|
+
"additionalContext": "Context compaction advisory: If important information was discussed recently, ensure it has been stored via MCP tools. Check: (1) Commitments: call the memory.remember MCP tool for any promises not yet stored. (2) People: call the memory.entity MCP tool for anyone discussed in detail. (3) Relationships: call the memory.relate MCP tool for connections mentioned. (4) Buffer: call the memory.buffer_turn MCP tool with a summary if recent exchanges were not buffered. With 1M context, compaction is less frequent, but proactive capture remains good practice."
|
|
14
10
|
}
|
|
15
11
|
EOF
|
|
16
12
|
exit 0
|
|
@@ -6,19 +6,15 @@ This rule is always active and applies to every session. Follow it silently - do
|
|
|
6
6
|
|
|
7
7
|
## How Memory Works
|
|
8
8
|
|
|
9
|
-
Claudia's memory
|
|
9
|
+
Claudia's memory is provided by the **claudia-memory daemon**, a Python MCP server that registers memory tools (e.g., `memory.recall`, `memory.remember`, `memory.about`). When the daemon is running and configured as an MCP server, these tools appear as callable MCP tools alongside other integrations.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
claudia memory recall "query" --project-dir "$PWD"
|
|
13
|
-
claudia memory save "fact" --project-dir "$PWD"
|
|
14
|
-
claudia memory about "entity name" --project-dir "$PWD"
|
|
15
|
-
```
|
|
11
|
+
The `claudia` npm binary handles **setup and health checks only** (`claudia setup`, `claudia system-health`). It does not provide memory operations. All memory operations are MCP tools from the daemon.
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
> **Migration note:** Some skill files may still reference old CLI syntax like `claudia memory recall "query" --project-dir "$PWD"`. Interpret these as calls to the equivalent MCP tool (e.g., `memory.recall` with a query parameter). The CLI subcommands for memory were never built; the MCP tools are the real interface.
|
|
18
14
|
|
|
19
|
-
## When
|
|
15
|
+
## When Memory Tools Are Not Available
|
|
20
16
|
|
|
21
|
-
If
|
|
17
|
+
If MCP memory tools are not responding or not registered:
|
|
22
18
|
|
|
23
19
|
### Do NOT substitute with other memory tools
|
|
24
20
|
|
|
@@ -32,7 +28,7 @@ These tools access a different, unrelated memory system. Using them gives the us
|
|
|
32
28
|
|
|
33
29
|
Say something like:
|
|
34
30
|
|
|
35
|
-
> "My memory tools aren't available in this session. The
|
|
31
|
+
> "My memory tools aren't available in this session. The claudia-memory daemon may not be running or may not be configured as an MCP server. Check that the daemon is listed in your `.mcp.json` and that it starts without errors. Your context files are preserved and I can work from those in the meantime."
|
|
36
32
|
|
|
37
33
|
### Do fall back to context files only
|
|
38
34
|
|
|
@@ -47,19 +43,28 @@ Make clear to the user they are in degraded mode: no semantic search, no pattern
|
|
|
47
43
|
|
|
48
44
|
### The fix
|
|
49
45
|
|
|
50
|
-
The user needs to ensure the
|
|
46
|
+
The user needs to ensure the claudia-memory daemon is properly configured:
|
|
47
|
+
|
|
48
|
+
1. **Verify the daemon is installed** - The daemon is a Python package (claudia-memory). Check that it's installed and its entry point is accessible.
|
|
49
|
+
2. **Check `.mcp.json`** - The daemon must be listed as an MCP server in the project's `.mcp.json` (or global MCP config). It should specify the command to start the daemon process.
|
|
50
|
+
3. **Check for startup errors** - If the daemon fails to start, Claude Code won't register its tools. Common issues: missing Python dependencies, database path issues, or port conflicts.
|
|
51
|
+
4. **Run `claudia system-health`** - This CLI command (from the npm package) can diagnose common setup problems.
|
|
52
|
+
|
|
53
|
+
If the npm CLI itself isn't installed (needed for `system-health` and `setup`):
|
|
51
54
|
|
|
52
55
|
```bash
|
|
53
56
|
npm install -g get-claudia
|
|
54
57
|
claudia setup
|
|
55
58
|
```
|
|
56
59
|
|
|
57
|
-
If it's installed but not on PATH (common with npx installs), they can use the full path or add `node_modules/.bin` to their PATH.
|
|
58
|
-
|
|
59
60
|
---
|
|
60
61
|
|
|
61
62
|
## Background (for context only, not to be surfaced verbatim)
|
|
62
63
|
|
|
63
|
-
The
|
|
64
|
+
The claudia-memory daemon is a Python process that runs as an MCP server (stdio transport). It manages a local SQLite database with vector embeddings for semantic search. When configured in `.mcp.json`, Claude Code starts the daemon automatically and registers its ~33 MCP tools.
|
|
65
|
+
|
|
66
|
+
The `claudia` npm binary is a separate Node.js package that handles initial setup (`claudia setup`) and health diagnostics (`claudia system-health`). It does not provide memory operations.
|
|
67
|
+
|
|
68
|
+
The failure mode for memory is the MCP server not being registered or not starting. This is different from a missing CLI binary. The diagnostic path is: check `.mcp.json` config, check daemon startup logs, verify Python environment.
|
|
64
69
|
|
|
65
|
-
Substituting with another memory plugin gives the wrong data from a different system and hides the real problem from the user. The honest answer is always to acknowledge the degraded state and point to the
|
|
70
|
+
Substituting with another memory plugin gives the wrong data from a different system and hides the real problem from the user. The honest answer is always to acknowledge the degraded state and point to the daemon configuration fix.
|
|
@@ -30,16 +30,12 @@ User provides one of:
|
|
|
30
30
|
|
|
31
31
|
**Always file the raw transcript/notes FIRST.** This is not optional. Source preservation creates provenance: every extracted fact can trace back to where it came from.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
--project-dir "$PWD" \
|
|
40
|
-
< content.md
|
|
41
|
-
```
|
|
42
|
-
(Pipe the FULL raw transcript/notes text via stdin; do not summarize)
|
|
33
|
+
Call the `memory.file` MCP tool with:
|
|
34
|
+
- `filename`: "YYYY-MM-DD-[person]-[topic].md"
|
|
35
|
+
- `source_type`: "transcript"
|
|
36
|
+
- `summary`: "Brief 1-line summary of the meeting"
|
|
37
|
+
- `about`: ["participant1", "participant2"]
|
|
38
|
+
- `content`: The FULL raw transcript/notes text (do not summarize)
|
|
43
39
|
|
|
44
40
|
The file is automatically routed to the right folder:
|
|
45
41
|
- `people/sarah-chen/transcripts/2026-02-04-kickoff.md`
|
|
@@ -75,7 +71,7 @@ The file is automatically routed to the right folder:
|
|
|
75
71
|
- Confirm entity names match existing entities
|
|
76
72
|
- Adjust or remove any questionable extractions
|
|
77
73
|
|
|
78
|
-
4. Call `
|
|
74
|
+
4. Call the `memory.batch` MCP tool with the reviewed operations array
|
|
79
75
|
```
|
|
80
76
|
|
|
81
77
|
**Fallback: Manual extraction** (use when agent is unavailable or for very short notes)
|
|
@@ -105,12 +101,9 @@ The file is automatically routed to the right folder:
|
|
|
105
101
|
|
|
106
102
|
### 4. Link Provenance
|
|
107
103
|
|
|
108
|
-
After extracting memories (facts, commitments) via `
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
to link the stored transcript to the memories extracted from it. This creates
|
|
112
|
-
the provenance chain: memory -> document -> file on disk.
|
|
113
|
-
```
|
|
104
|
+
After extracting memories (facts, commitments) via the `memory.batch` or `memory.remember` MCP tools:
|
|
105
|
+
|
|
106
|
+
Call the `memory.file` MCP tool with the `memory_ids` parameter set to the IDs of the memories you extracted. This links the stored transcript to the memories extracted from it, creating the provenance chain: memory -> document -> file on disk.
|
|
114
107
|
|
|
115
108
|
Now the user can ask "where did you learn that Sarah prefers async communication?" and you can point to the exact transcript.
|
|
116
109
|
|
|
@@ -135,7 +128,7 @@ For each participant in the meeting:
|
|
|
135
128
|
|
|
136
129
|
- Add new commitments to `context/commitments.md` (ask for confirmation on wording and deadline)
|
|
137
130
|
- Add new waiting items to `context/waiting.md`
|
|
138
|
-
- If
|
|
131
|
+
- If memory MCP tools are available, also store via the `memory.remember` MCP tool
|
|
139
132
|
|
|
140
133
|
#### 5c. Update workspace files (if applicable)
|
|
141
134
|
|
|
@@ -233,7 +226,7 @@ Ask for confirmation on:
|
|
|
233
226
|
|
|
234
227
|
## Quality Checklist
|
|
235
228
|
|
|
236
|
-
- [ ] **Raw transcript/notes filed** (`
|
|
229
|
+
- [ ] **Raw transcript/notes filed** (`memory.file` MCP tool called with full content)
|
|
237
230
|
- [ ] Memories linked to source document (provenance chain complete)
|
|
238
231
|
- [ ] Every action item has an owner
|
|
239
232
|
- [ ] Every commitment has a deadline (even approximate)
|
|
@@ -40,10 +40,8 @@ Silently retrieve:
|
|
|
40
40
|
- Existing reflections to avoid duplication
|
|
41
41
|
- Active commitments and relationship states
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
claudia memory session context --project-dir "$PWD" # recent context (if available)
|
|
46
|
-
```
|
|
43
|
+
- Call the `memory.reflections` MCP tool to see what already exists
|
|
44
|
+
- Call the `memory.session_context` MCP tool for recent context (if available)
|
|
47
45
|
|
|
48
46
|
### Step 2: Generate Reflections
|
|
49
47
|
|
|
@@ -150,7 +148,7 @@ User responses:
|
|
|
150
148
|
|
|
151
149
|
### Step 5: Store and Close
|
|
152
150
|
|
|
153
|
-
|
|
151
|
+
Call the `memory.end_session` MCP tool with:
|
|
154
152
|
- `narrative`: Brief session summary
|
|
155
153
|
- `reflections`: Array of approved reflections with type, content, and optional about fields
|
|
156
154
|
- Other structured extractions (facts, commitments, entities) as needed
|
|
@@ -205,8 +203,8 @@ When similar reflections accumulate over time:
|
|
|
205
203
|
### Retrieval
|
|
206
204
|
|
|
207
205
|
Reflections surface through:
|
|
208
|
-
- `
|
|
209
|
-
- `
|
|
206
|
+
- The `memory.reflections` MCP tool for explicit retrieval
|
|
207
|
+
- The `memory.session_context` MCP tool includes relevant reflections
|
|
210
208
|
- Semantic search matches reflections to current context
|
|
211
209
|
|
|
212
210
|
---
|
|
@@ -238,8 +236,8 @@ User: "That thing you learned about me preferring bullet points -
|
|
|
238
236
|
that's only for technical content, not conversations."
|
|
239
237
|
|
|
240
238
|
Claudia:
|
|
241
|
-
1.
|
|
242
|
-
2.
|
|
239
|
+
1. Call the `memory.reflections` MCP tool with query: "bullet points" to find the reflection
|
|
240
|
+
2. Call the `memory.reflections` MCP tool with action: "update", id: <id>, content: "..." to update
|
|
243
241
|
3. Confirm: "Updated. I'll keep that distinction in mind."
|
|
244
242
|
```
|
|
245
243
|
|
|
@@ -247,8 +245,8 @@ Claudia:
|
|
|
247
245
|
User: "Delete the reflection about Monday mornings"
|
|
248
246
|
|
|
249
247
|
Claudia:
|
|
250
|
-
1. Search for the reflection
|
|
251
|
-
2.
|
|
248
|
+
1. Search for the reflection via `memory.reflections` MCP tool
|
|
249
|
+
2. Call the `memory.reflections` MCP tool with action: "delete", id: <id> to delete
|
|
252
250
|
3. Confirm: "Done, I've removed that."
|
|
253
251
|
```
|
|
254
252
|
|
|
@@ -256,7 +254,7 @@ Claudia:
|
|
|
256
254
|
User: "Show me all your reflections about me"
|
|
257
255
|
|
|
258
256
|
Claudia:
|
|
259
|
-
1.
|
|
257
|
+
1. Call the `memory.reflections` MCP tool with limit: 50
|
|
260
258
|
2. Format nicely with timeline info
|
|
261
259
|
3. Offer to edit or delete any
|
|
262
260
|
```
|
|
@@ -289,9 +287,9 @@ At session start, load high-importance reflections to inform the interaction sty
|
|
|
289
287
|
|
|
290
288
|
---
|
|
291
289
|
|
|
292
|
-
## Without
|
|
290
|
+
## Without Memory Tools
|
|
293
291
|
|
|
294
|
-
If the
|
|
292
|
+
If the memory MCP tools are unavailable, store reflections in `context/learnings.md`:
|
|
295
293
|
|
|
296
294
|
```markdown
|
|
297
295
|
## Reflections
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-manager
|
|
3
|
-
description: Handle cross-session persistence using the
|
|
3
|
+
description: Handle cross-session persistence using MCP tools from the claudia-memory server, with fallback to markdown files.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
invocation: proactive
|
|
6
6
|
effort-level: medium
|
|
@@ -12,81 +12,86 @@ effort-level: medium
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## How Memory Works
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
Claudia's memory operates via **MCP tools** provided by the claudia-memory daemon server. The daemon runs as an MCP server (stdio transport) and registers tools that Claude Code can call directly. These are NOT Bash CLI commands.
|
|
18
|
+
|
|
19
|
+
The `claudia` npm binary handles setup and diagnostics (`claudia setup`, `claudia system-health`) via the Bash tool. All memory operations use MCP tools.
|
|
20
|
+
|
|
21
|
+
**Migration note:** Some skill files may still reference old CLI syntax (e.g., `claudia memory recall "query" --project-dir "$PWD"`). Interpret these as calls to the equivalent MCP tool (e.g., `memory.recall` with query parameter). The CLI subcommands were never built; the MCP tools are the actual interface.
|
|
22
|
+
|
|
23
|
+
## MCP Tool Reference
|
|
19
24
|
|
|
20
25
|
### Core Operations
|
|
21
26
|
|
|
22
|
-
| Operation |
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
| Entity context | `
|
|
27
|
-
| Create entity | `
|
|
28
|
-
|
|
|
29
|
-
| Correct memory | `
|
|
30
|
-
| Invalidate | `
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
27
|
+
| Operation | MCP Tool | Key Parameters |
|
|
28
|
+
|-----------|----------|----------------|
|
|
29
|
+
| Store a memory | `memory.remember` | content, type, importance, about (entity names) |
|
|
30
|
+
| Search memories | `memory.recall` | query, limit, types |
|
|
31
|
+
| Entity context | `memory.about` | entity (name) |
|
|
32
|
+
| Create/update entity | `memory.entity` | name, type, description |
|
|
33
|
+
| Link entities | `memory.relate` | source, target, relationship, strength |
|
|
34
|
+
| Correct memory | `memory.correct` | memory_id, correction, reason |
|
|
35
|
+
| Invalidate memory | `memory.invalidate` | memory_id, reason |
|
|
36
|
+
| Session briefing | `memory.briefing` | (none) |
|
|
37
|
+
| Manage reflections | `memory.reflections` | action (get/save/update/delete), content, type, query, id |
|
|
38
|
+
| Run consolidation | `memory.consolidate` | lightweight (bool) |
|
|
34
39
|
|
|
35
40
|
### Document Storage
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
| Operation | MCP Tool | Key Parameters |
|
|
43
|
+
|-----------|----------|----------------|
|
|
44
|
+
| Store document | `memory.file` | filename, source_type, summary, about (entity names), content |
|
|
45
|
+
| Search documents | `memory.documents` | query, source_type, entity, limit |
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
claudia memory document store ./transcript.txt --source-type transcript --summary "Interview with Alex"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Options: `--source-type` (gmail, transcript, upload, capture, session), `--source-ref`, `--summary`.
|
|
44
|
-
Search: `claudia memory document search "query" --source-type transcript --limit 10`
|
|
47
|
+
Source types: `gmail`, `transcript`, `upload`, `capture`, `session`.
|
|
45
48
|
|
|
46
49
|
### Batch Operations
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
Call `memory.batch` with an operations array. Each operation is an object:
|
|
49
52
|
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
{"op":"entity","name":"Alex Gregory","type":"person","description":"EVP Sales & Marketing"},
|
|
53
|
-
{"op":"remember","content":"Alex uses GPT for candidate evaluation","about":["Alex Gregory"],"type":"fact","importance":0.8},
|
|
54
|
-
{"op":"relate","source":"Alex Gregory","target":"
|
|
55
|
-
]
|
|
53
|
+
```json
|
|
54
|
+
[
|
|
55
|
+
{"op": "entity", "name": "Alex Gregory", "type": "person", "description": "EVP Sales & Marketing"},
|
|
56
|
+
{"op": "remember", "content": "Alex uses GPT for candidate evaluation", "about": ["Alex Gregory"], "type": "fact", "importance": 0.8},
|
|
57
|
+
{"op": "relate", "source": "Alex Gregory", "target": "Acme Corp", "relationship": "works_at", "strength": 1.0}
|
|
58
|
+
]
|
|
56
59
|
```
|
|
57
60
|
|
|
58
61
|
Valid `op` values: `entity`, `remember`, `relate`, `correct`, `invalidate`.
|
|
59
62
|
|
|
60
63
|
### Session Lifecycle
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
|
75
|
-
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
65
|
+
| Operation | MCP Tool | Key Parameters |
|
|
66
|
+
|-----------|----------|----------------|
|
|
67
|
+
| Buffer a turn | `memory.buffer_turn` | user_content, assistant_content, episode_id |
|
|
68
|
+
| End session | `memory.end_session` | episode_id, narrative, reflections, facts, entities, relationships |
|
|
69
|
+
| Load full context | `memory.session_context` | scope |
|
|
70
|
+
| Check unsummarized | `memory.unsummarized` | (none) |
|
|
71
|
+
|
|
72
|
+
### Valid Parameter Values
|
|
73
|
+
|
|
74
|
+
| Parameter | Values |
|
|
75
|
+
|-----------|--------|
|
|
76
|
+
| type (memory) | fact, preference, observation, learning, commitment, pattern |
|
|
77
|
+
| type (entity) | person, organization, project, concept, location |
|
|
78
|
+
| type (reflection) | observation, pattern, learning, question |
|
|
79
|
+
| source_type (document) | gmail, transcript, upload, capture, session |
|
|
80
|
+
| source_channel | claude_code, telegram, slack |
|
|
81
|
+
|
|
82
|
+
### Network & Analysis Tools
|
|
83
|
+
|
|
84
|
+
| Operation | MCP Tool | Key Parameters |
|
|
85
|
+
|-----------|----------|----------------|
|
|
86
|
+
| Morning digest | `memory.morning_context` | (none) |
|
|
87
|
+
| Project connections | `memory.project_network` | entity |
|
|
88
|
+
| Connection path | `memory.find_path` | source, target |
|
|
89
|
+
| Find hubs | `memory.network_hubs` | limit |
|
|
90
|
+
| Dormant relationships | `memory.dormant_relationships` | days_threshold |
|
|
91
|
+
| Search entities | `memory.search_entities` | query, types, limit |
|
|
92
|
+
| Merge entities | `memory.merge_entities` | source_id, target_id, reason |
|
|
93
|
+
| Provenance trace | `memory.trace` | memory_id |
|
|
94
|
+
| Extract from text | `cognitive.ingest` | text, context |
|
|
90
95
|
|
|
91
96
|
---
|
|
92
97
|
|
|
@@ -99,19 +104,19 @@ These are non-negotiable. Violating them defeats the purpose of the memory syste
|
|
|
99
104
|
When processing source material (transcripts, emails, documents):
|
|
100
105
|
|
|
101
106
|
1. **Check for duplicates** (by source_type + source_ref)
|
|
102
|
-
2. **File it first** via `
|
|
107
|
+
2. **File it first** via `memory.file` with full raw content
|
|
103
108
|
3. **Ask user about extraction** (don't auto-extract)
|
|
104
|
-
4. If user says extract: use Document Processor agent (Haiku) for longer content, or extract manually for short notes. Review agent output before storing via `
|
|
109
|
+
4. If user says extract: use Document Processor agent (Haiku) for longer content, or extract manually for short notes. Review agent output before storing via `memory.batch`.
|
|
105
110
|
|
|
106
|
-
**If you find yourself reading source documents** without
|
|
111
|
+
**If you find yourself reading source documents** without calling `memory.file` for each one, **STOP and fix it**. File first, then ask if extraction should happen now or later.
|
|
107
112
|
|
|
108
|
-
### 2. Verify Memory
|
|
113
|
+
### 2. Verify Memory System at Session Start
|
|
109
114
|
|
|
110
|
-
Before greeting, verify the `claudia` CLI is available by running `claudia system-health --project-dir "$PWD"
|
|
115
|
+
Before greeting, verify the `claudia` CLI is available by running `claudia system-health --project-dir "$PWD"` via Bash. This checks that the daemon is healthy and the database is accessible. If unavailable, follow the `memory-availability` rule (never silently fall back).
|
|
111
116
|
|
|
112
117
|
### 3. Buffer Turns During Sessions
|
|
113
118
|
|
|
114
|
-
|
|
119
|
+
Call `memory.buffer_turn` for each meaningful exchange. This ensures nothing is lost if the session ends abruptly.
|
|
115
120
|
|
|
116
121
|
### 4. Trust North Star: Origin Tracking
|
|
117
122
|
|
|
@@ -166,13 +171,13 @@ Before creating a new person or project file:
|
|
|
166
171
|
|
|
167
172
|
When looking for information about a person or topic:
|
|
168
173
|
|
|
169
|
-
1. `
|
|
170
|
-
2. If no results, check if `people/[name].md` exists
|
|
174
|
+
1. Call `memory.about` with the entity name. Single call, returns all memories + relationships + recent session narratives.
|
|
175
|
+
2. If no results, check if `people/[name].md` exists (single file read).
|
|
171
176
|
3. If neither has it, it's unknown. Tell the user and ask if they have source material.
|
|
172
177
|
4. **Last resort:** `episodic-memory__search` (cross-workspace conversation history). Only use this when Claudia's own memory and local files have nothing, and the information might exist in a prior Claude Code conversation from another workspace.
|
|
173
178
|
|
|
174
179
|
Do NOT:
|
|
175
|
-
- Call both `
|
|
180
|
+
- Call both `memory.recall` AND `memory.about` for the same entity (about is the targeted lookup, recall is for broad searches)
|
|
176
181
|
- Search episodic memory for information that should be in Claudia's memory
|
|
177
182
|
- Jump to episodic-memory search before exhausting Claudia's own memory system
|
|
178
183
|
- Parse raw `.jsonl` session logs. The cost-to-recovery ratio is poor and it rarely succeeds. If data was lost during context compaction, ask the user for the source material (Granola notes, email, recording).
|
|
@@ -183,10 +188,10 @@ Do NOT:
|
|
|
183
188
|
|
|
184
189
|
Avoid redundant memory calls within a session:
|
|
185
190
|
|
|
186
|
-
- **Session-local awareness:** If you already
|
|
187
|
-
- **Recall dedup:** Do not
|
|
188
|
-
- **File-vs-memory rule:** If you just read a person file (`people/[name].md`), do not also
|
|
189
|
-
- **Batch preference:** When you need
|
|
191
|
+
- **Session-local awareness:** If you already called `memory.about` for an entity in this session, do not call it again. Use the results you already have.
|
|
192
|
+
- **Recall dedup:** Do not call `memory.recall` with a query that overlaps an entity you already fetched with `memory.about`. The about call already returned that entity's full context.
|
|
193
|
+
- **File-vs-memory rule:** If you just read a person file (`people/[name].md`), do not also call `memory.about` for the same person unless you need memories not in the file (e.g., cross-project context or recent session narratives).
|
|
194
|
+
- **Batch preference:** When you need to store multiple items at once, use `memory.batch` over sequential calls.
|
|
190
195
|
- **Skip search when context is fresh:** If the user just told you something in this conversation, remember it directly. Don't search memory for what was just said.
|
|
191
196
|
|
|
192
197
|
---
|
|
@@ -197,16 +202,16 @@ When the enhanced memory system is available:
|
|
|
197
202
|
|
|
198
203
|
### 0. Catch Up on Unsummarized Sessions
|
|
199
204
|
|
|
200
|
-
|
|
205
|
+
Call `memory.unsummarized`. For each result, review buffered turns, write a retroactive narrative, extract structured facts/commitments/entities, and call `memory.end_session` to finalize. Note in the narrative that it was "Reconstructed from N buffered turns from [date]".
|
|
201
206
|
|
|
202
207
|
### 1. Minimal Startup (2 calls max)
|
|
203
208
|
|
|
204
209
|
1. Read `context/me.md` (for greeting personalization)
|
|
205
|
-
2.
|
|
210
|
+
2. Call `memory.briefing` (~500 tokens of aggregate context: commitments, cooling, unread, predictions)
|
|
206
211
|
|
|
207
|
-
Pull full context on-demand via `
|
|
212
|
+
Pull full context on-demand via `memory.recall` / `memory.about` during conversation. Do NOT read learnings.md, patterns.md, commitments.md, or waiting.md at startup (they duplicate the memory database).
|
|
208
213
|
|
|
209
|
-
**Fallback:** If briefing unavailable,
|
|
214
|
+
**Fallback:** If briefing unavailable, call `memory.morning_context`.
|
|
210
215
|
|
|
211
216
|
### 2. Session Start (Markdown Fallback)
|
|
212
217
|
|
|
@@ -221,11 +226,10 @@ If enhanced memory is unavailable, read: `context/me.md`, `context/learnings.md`
|
|
|
221
226
|
After each meaningful exchange, buffer the turn for later summarization:
|
|
222
227
|
|
|
223
228
|
```
|
|
224
|
-
After each substantive turn:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
└── --episode-id (Reuse the ID from the first buffer call)
|
|
229
|
+
After each substantive turn, call memory.buffer_turn with:
|
|
230
|
+
- user_content: "What the user said (summarized if very long)"
|
|
231
|
+
- assistant_content: "What I said (key points, not full response)"
|
|
232
|
+
- episode_id: Reuse the ID from the first buffer call
|
|
229
233
|
```
|
|
230
234
|
|
|
231
235
|
**What counts as "meaningful":**
|
|
@@ -239,11 +243,11 @@ After each substantive turn:
|
|
|
239
243
|
- Pure tool output with no discussion
|
|
240
244
|
- Trivial back-and-forth
|
|
241
245
|
|
|
242
|
-
The first `
|
|
246
|
+
The first `memory.buffer_turn` call creates an episode and returns an `episode_id`. Reuse that ID for all subsequent turns in the session.
|
|
243
247
|
|
|
244
248
|
### Immediate Memory (Still Active)
|
|
245
249
|
|
|
246
|
-
For high-importance items,
|
|
250
|
+
For high-importance items, call `memory.remember` immediately in addition to buffering:
|
|
247
251
|
- Explicit commitments ("I'll send the proposal by Friday")
|
|
248
252
|
- Critical facts the user explicitly asks you to remember
|
|
249
253
|
- Urgent relationship updates
|
|
@@ -260,7 +264,7 @@ Think of it like taking notes during a meeting versus trying to remember everyth
|
|
|
260
264
|
|
|
261
265
|
#### Commitments: Store Them Immediately
|
|
262
266
|
|
|
263
|
-
When someone makes a promise (the user, or someone they're telling you about), that's too important to buffer.
|
|
267
|
+
When someone makes a promise (the user, or someone they're telling you about), that's too important to buffer. Call `memory.remember` right away with:
|
|
264
268
|
- `type`: "commitment"
|
|
265
269
|
- `importance`: 0.9 (commitments matter)
|
|
266
270
|
- `about`: whoever made the promise
|
|
@@ -272,7 +276,7 @@ Then add it to `context/commitments.md`. Two places is better than zero. If cont
|
|
|
272
276
|
|
|
273
277
|
First time a name comes up, just note it mentally. No action needed.
|
|
274
278
|
|
|
275
|
-
Second time they're mentioned with real context (their role, what they're working on, how they connect to others), that's your signal to
|
|
279
|
+
Second time they're mentioned with real context (their role, what they're working on, how they connect to others), that's your signal to call `memory.entity`.
|
|
276
280
|
|
|
277
281
|
A casual name-drop doesn't need a database entry. A person who matters to the conversation does.
|
|
278
282
|
|
|
@@ -283,16 +287,16 @@ The threshold is "meaningful context":
|
|
|
283
287
|
|
|
284
288
|
#### Relationships: Capture the Connections
|
|
285
289
|
|
|
286
|
-
When you hear language like "Sarah works with Mike" or "they're our client," capture that silently with `
|
|
290
|
+
When you hear language like "Sarah works with Mike" or "they're our client," capture that silently with `memory.relate`. Don't announce it, just do it. These connections are exactly what the memory system is for.
|
|
287
291
|
|
|
288
|
-
| When you hear... | Call... |
|
|
289
|
-
|
|
290
|
-
| "X works with Y" |
|
|
291
|
-
| "X reports to Y" |
|
|
292
|
-
| "X is Y's manager" |
|
|
293
|
-
| "X is our client" |
|
|
294
|
-
| "X knows Y" |
|
|
295
|
-
| "X introduced me to Y" |
|
|
292
|
+
| When you hear... | Call `memory.relate` with... |
|
|
293
|
+
|------------------|------------------------------|
|
|
294
|
+
| "X works with Y" | source: X, target: Y, relationship: "works_with" |
|
|
295
|
+
| "X reports to Y" | source: X, target: Y, relationship: "reports_to" |
|
|
296
|
+
| "X is Y's manager" | source: Y, target: X, relationship: "reports_to" |
|
|
297
|
+
| "X is our client" | source: X, target: [user_org], relationship: "client_of" |
|
|
298
|
+
| "X knows Y" | source: X, target: Y, relationship: "knows" |
|
|
299
|
+
| "X introduced me to Y" | source: X, target: Y, relationship: "introduced" |
|
|
296
300
|
|
|
297
301
|
These relationships are the hidden structure of someone's professional life. Capture them quietly. No need to narrate.
|
|
298
302
|
|
|
@@ -315,10 +319,10 @@ With the 1M context window, compaction happens less frequently, but it can still
|
|
|
315
319
|
If you see a context compaction advisory, review what you can recover:
|
|
316
320
|
|
|
317
321
|
1. Review what remains in your context
|
|
318
|
-
2. Call `
|
|
319
|
-
3. Call `
|
|
320
|
-
4. Call `
|
|
321
|
-
5. Call `
|
|
322
|
+
2. Call `memory.remember` for any commitments you can piece together
|
|
323
|
+
3. Call `memory.entity` for people discussed in detail
|
|
324
|
+
4. Call `memory.relate` for relationships mentioned
|
|
325
|
+
5. Call `memory.buffer_turn` with a summary of recent exchanges
|
|
322
326
|
|
|
323
327
|
This is triage, not standard practice. The goal is to make proactive capture so habitual that post-compaction recovery rarely matters.
|
|
324
328
|
|
|
@@ -326,34 +330,34 @@ This is triage, not standard practice. The goal is to make proactive capture so
|
|
|
326
330
|
|
|
327
331
|
When a person or project is mentioned:
|
|
328
332
|
```
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
+
Call memory.entity with:
|
|
334
|
+
- name: "Entity Name"
|
|
335
|
+
- type: person/organization/project
|
|
336
|
+
- description: "What we learned"
|
|
333
337
|
```
|
|
334
338
|
|
|
335
339
|
When relationships between entities are mentioned:
|
|
336
340
|
```
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
Call memory.relate with:
|
|
342
|
+
- source: "First entity"
|
|
343
|
+
- target: "Second entity"
|
|
344
|
+
- relationship: works_with, manages, client_of, etc.
|
|
341
345
|
```
|
|
342
346
|
|
|
343
347
|
### Batch Mid-Session Operations
|
|
344
348
|
|
|
345
|
-
When processing a new person, meeting transcript, or topic that requires multiple memory operations (entity + memories + relationships) mid-session,
|
|
349
|
+
When processing a new person, meeting transcript, or topic that requires multiple memory operations (entity + memories + relationships) mid-session, call `memory.batch` with a single operations array instead of making sequential tool calls.
|
|
346
350
|
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
{"op":"entity","name":"Kris Krisko","type":"person","description":"..."},
|
|
350
|
-
{"op":"remember","content":"...","about":["Kris Krisko"],"type":"fact","importance":0.8},
|
|
351
|
-
{"op":"remember","content":"...","about":["Kris Krisko","
|
|
352
|
-
{"op":"relate","source":
|
|
353
|
-
]
|
|
351
|
+
```json
|
|
352
|
+
[
|
|
353
|
+
{"op": "entity", "name": "Kris Krisko", "type": "person", "description": "..."},
|
|
354
|
+
{"op": "remember", "content": "...", "about": ["Kris Krisko"], "type": "fact", "importance": 0.8},
|
|
355
|
+
{"op": "remember", "content": "...", "about": ["Kris Krisko", "Acme Corp"], "type": "observation", "importance": 0.7},
|
|
356
|
+
{"op": "relate", "source": "User", "target": "Kris Krisko", "relationship": "potential_partner", "strength": 0.5}
|
|
357
|
+
]
|
|
354
358
|
```
|
|
355
359
|
|
|
356
|
-
Use `
|
|
360
|
+
Use `memory.batch` for mid-session entity creation (e.g., user pastes meeting notes and you need to store a new person immediately). Use `memory.end_session` for the full session wrap-up. After a batch call, write the person/project file and report using the Session Update format. Do not narrate between operations.
|
|
357
361
|
|
|
358
362
|
### Document Filing (Source Preservation)
|
|
359
363
|
|
|
@@ -373,22 +377,23 @@ Use `claudia memory batch` for mid-session entity creation (e.g., user pastes me
|
|
|
373
377
|
#### How to File
|
|
374
378
|
|
|
375
379
|
```
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
Call memory.file with:
|
|
381
|
+
- filename: "Descriptive-name.md"
|
|
382
|
+
- source_type: "transcript", "gmail", "upload", or "capture"
|
|
383
|
+
- summary: "One-line description"
|
|
384
|
+
- about: ["entity1", "entity2"] (entity names mentioned)
|
|
385
|
+
- content: (the full document text)
|
|
381
386
|
```
|
|
382
387
|
|
|
383
388
|
#### The Filing Flow
|
|
384
389
|
|
|
385
390
|
1. **Check for duplicates first**
|
|
386
391
|
- If source has an identifiable ID (email message-id, URL, file hash):
|
|
387
|
-
-
|
|
392
|
+
- Call `memory.documents` with the source reference
|
|
388
393
|
- If found: "I already have this filed at [path]. Want me to pull up what I extracted?"
|
|
389
394
|
- If not found: Continue to step 2
|
|
390
395
|
|
|
391
|
-
2. **File immediately** using `
|
|
396
|
+
2. **File immediately** using `memory.file` with full content
|
|
392
397
|
- Do NOT automatically extract in the same turn
|
|
393
398
|
|
|
394
399
|
3. **Ask about extraction**
|
|
@@ -401,7 +406,7 @@ Run claudia memory document store with:
|
|
|
401
406
|
- Extract relationships (how they're connected)
|
|
402
407
|
- Extract commitments (promises made)
|
|
403
408
|
- Present findings for user verification before storing
|
|
404
|
-
- Store verified info via `
|
|
409
|
+
- Store verified info via `memory.batch`
|
|
405
410
|
|
|
406
411
|
5. **If user says "later"**
|
|
407
412
|
- Done. User can ask "extract that transcript" anytime later
|
|
@@ -424,14 +429,7 @@ Before filing any source with an external identifier:
|
|
|
424
429
|
| Upload | Filename + size, or content hash |
|
|
425
430
|
| URL/Capture | URL |
|
|
426
431
|
|
|
427
|
-
|
|
428
|
-
```python
|
|
429
|
-
existing = db.get_one(
|
|
430
|
-
"documents",
|
|
431
|
-
where="source_type = ? AND source_ref = ?",
|
|
432
|
-
where_params=(source_type, source_identifier)
|
|
433
|
-
)
|
|
434
|
-
```
|
|
432
|
+
Call `memory.documents` with the identifier to check for existing copies.
|
|
435
433
|
|
|
436
434
|
If exists, surface it: "I filed this on [date]. Summary: [summary]. Want me to show what I extracted?"
|
|
437
435
|
|
|
@@ -445,14 +443,16 @@ Every fact traces back to its source. User can always ask "where did you learn t
|
|
|
445
443
|
|
|
446
444
|
### Enhanced Memory
|
|
447
445
|
|
|
448
|
-
Before wrapping up, generate a session summary by calling `
|
|
446
|
+
Before wrapping up, generate a session summary by calling `memory.end_session`:
|
|
449
447
|
|
|
450
448
|
```
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
449
|
+
Call memory.end_session with:
|
|
450
|
+
- episode_id: The episode from buffer_turn calls
|
|
451
|
+
- narrative: "Free-form summary of the session (see below)"
|
|
452
|
+
- facts: [...] (structured extractions)
|
|
453
|
+
- entities: [...] (new entities created)
|
|
454
|
+
- relationships: [...] (new relationships)
|
|
455
|
+
- reflections: [...] (learnings about working with this user)
|
|
456
456
|
```
|
|
457
457
|
|
|
458
458
|
**Writing the narrative:**
|
|
@@ -505,17 +505,17 @@ Reflections are persistent learnings about working with this user. Unlike memori
|
|
|
505
505
|
|
|
506
506
|
### Applying Reflections
|
|
507
507
|
|
|
508
|
-
When `
|
|
508
|
+
When `memory.briefing` returns active reflections, **apply them silently**. Do NOT announce reflections. They inform behavior invisibly (adjust format/style, anticipate needs).
|
|
509
509
|
|
|
510
|
-
**Exception:** Surface reflections if the user explicitly asks ("show me your reflections" / "what have you learned?") via `
|
|
510
|
+
**Exception:** Surface reflections if the user explicitly asks ("show me your reflections" / "what have you learned?") via `memory.reflections`.
|
|
511
511
|
|
|
512
512
|
### Managing Reflections
|
|
513
513
|
|
|
514
|
-
- **Generate** via `/meditate` skill at session end, or anytime via `
|
|
515
|
-
- **Retrieve** via `
|
|
516
|
-
- **Edit/Delete** via `
|
|
514
|
+
- **Generate** via `/meditate` skill at session end, or anytime via `memory.end_session` with reflections array
|
|
515
|
+
- **Retrieve** via `memory.reflections` (action: "get")
|
|
516
|
+
- **Edit/Delete** via `memory.reflections` (action: "update"/"delete") when user requests changes
|
|
517
517
|
- **Decay** is very slow (~2 year half-life). Well-confirmed reflections (3+) decay even slower.
|
|
518
|
-
- **Without
|
|
518
|
+
- **Without memory tools:** reflections go to `context/learnings.md` under a "Reflections" heading.
|
|
519
519
|
|
|
520
520
|
---
|
|
521
521
|
|
|
@@ -537,11 +537,11 @@ Users can correct mistakes in the memory system through natural language. User c
|
|
|
537
537
|
### Correction Flow
|
|
538
538
|
|
|
539
539
|
1. **Acknowledge immediately**: "Let me fix that."
|
|
540
|
-
2. **Search for the memory**:
|
|
540
|
+
2. **Search for the memory**: Call `memory.recall` with the topic
|
|
541
541
|
3. **Present what you found**: Show the user the memory/memories that might be wrong
|
|
542
542
|
4. **Offer options**:
|
|
543
|
-
- **Correct**: Update the content, keep the history (
|
|
544
|
-
- **Invalidate**: Mark as no longer true (
|
|
543
|
+
- **Correct**: Update the content, keep the history (call `memory.correct`)
|
|
544
|
+
- **Invalidate**: Mark as no longer true (call `memory.invalidate`)
|
|
545
545
|
- **No change**: User clarifies it's actually correct
|
|
546
546
|
5. **Confirm action**: "Fixed. I've updated [brief description]."
|
|
547
547
|
|
|
@@ -551,10 +551,10 @@ Users can correct mistakes in the memory system through natural language. User c
|
|
|
551
551
|
```
|
|
552
552
|
User: "Actually, Sarah works at Acme now, not TechCorp"
|
|
553
553
|
|
|
554
|
-
1. Search:
|
|
554
|
+
1. Search: call memory.recall with query "Sarah works TechCorp"
|
|
555
555
|
2. Show: "I have a memory that 'Sarah Chen works at TechCorp'. Is this the one?"
|
|
556
556
|
3. User confirms
|
|
557
|
-
4.
|
|
557
|
+
4. Call memory.correct with memory_id, correction: "Sarah Chen works at Acme", reason: "User correction: moved companies"
|
|
558
558
|
5. Respond: "Updated. I now know Sarah works at Acme."
|
|
559
559
|
```
|
|
560
560
|
|
|
@@ -562,10 +562,10 @@ User: "Actually, Sarah works at Acme now, not TechCorp"
|
|
|
562
562
|
```
|
|
563
563
|
User: "That project is cancelled, don't remind me about it"
|
|
564
564
|
|
|
565
|
-
1. Search:
|
|
565
|
+
1. Search: call memory.recall with query "project [name]"
|
|
566
566
|
2. Show: "I have 5 memories about [project]. Want me to mark them all as no longer relevant?"
|
|
567
567
|
3. User confirms
|
|
568
|
-
4.
|
|
568
|
+
4. Call memory.invalidate for each memory_id with reason: "Project cancelled"
|
|
569
569
|
5. Respond: "Done. I won't surface those memories anymore."
|
|
570
570
|
```
|
|
571
571
|
|
|
@@ -576,7 +576,7 @@ User: "John Smith and Jon Smith are the same person"
|
|
|
576
576
|
1. Search for both entities
|
|
577
577
|
2. Confirm: "I found both. Jon Smith has fewer memories. Should I merge Jon into John?"
|
|
578
578
|
3. User confirms
|
|
579
|
-
4.
|
|
579
|
+
4. Call memory.merge_entities with source_id (Jon), target_id (John), reason: "User confirmed same person"
|
|
580
580
|
5. Respond: "Merged. All memories about Jon are now linked to John Smith."
|
|
581
581
|
```
|
|
582
582
|
|
|
@@ -621,7 +621,7 @@ Never persist:
|
|
|
621
621
|
### User Control
|
|
622
622
|
|
|
623
623
|
User can:
|
|
624
|
-
- Ask "What do you know about me?" → Call `
|
|
624
|
+
- Ask "What do you know about me?" → Call `memory.recall` with broad query
|
|
625
625
|
- Ask to forget something → Remove from files/database
|
|
626
626
|
- Request to start fresh → Delete context files/database
|
|
627
627
|
- Review any stored information
|
|
@@ -633,7 +633,7 @@ User can:
|
|
|
633
633
|
### Crash Safety
|
|
634
634
|
|
|
635
635
|
**Enhanced Memory:**
|
|
636
|
-
- Every `
|
|
636
|
+
- Every `memory.remember` call is immediately committed to SQLite with WAL mode
|
|
637
637
|
- Survives terminal close, process kill, system crash
|
|
638
638
|
- No data loss even if session ends abruptly
|
|
639
639
|
|
|
@@ -644,4 +644,4 @@ User can:
|
|
|
644
644
|
|
|
645
645
|
### Health Check
|
|
646
646
|
|
|
647
|
-
If memory seems slow or unavailable, run `claudia system-health --project-dir "$PWD"
|
|
647
|
+
If memory seems slow or unavailable, run `claudia system-health --project-dir "$PWD"` via Bash. If it fails, fall back to markdown and suggest `/diagnose`.
|
|
@@ -12,14 +12,14 @@ Provide a concise morning brief to start the day with clarity. Surface what matt
|
|
|
12
12
|
|
|
13
13
|
### Enhanced Memory System (if available)
|
|
14
14
|
|
|
15
|
-
1. **
|
|
15
|
+
1. **Call the `memory.morning_context` MCP tool** to get a curated morning digest in a single call:
|
|
16
16
|
- Stale commitments (3+ days old, importance > 0.3)
|
|
17
17
|
- Cooling relationships (people not contacted in 30+ days)
|
|
18
18
|
- Cross-entity connections (people who co-appear but have no explicit relationship)
|
|
19
19
|
- Active predictions and insights
|
|
20
20
|
- Recent activity (72h)
|
|
21
21
|
|
|
22
|
-
2. **
|
|
22
|
+
2. **Call the `memory.recall` MCP tool** for specific follow-up queries as needed
|
|
23
23
|
|
|
24
24
|
### Judgment Rules (if available)
|
|
25
25
|
|
|
@@ -79,14 +79,14 @@ This builds trust by showing the verification happened.
|
|
|
79
79
|
|
|
80
80
|
## Temporal Awareness
|
|
81
81
|
|
|
82
|
-
When enhanced memory is available, use urgency-driven ordering.
|
|
82
|
+
When enhanced memory is available, use urgency-driven ordering. Use the `memory.morning_context` MCP tool to organize the brief by time sensitivity:
|
|
83
83
|
|
|
84
84
|
### Urgency Tiers (in order)
|
|
85
85
|
|
|
86
|
-
1. **Urgent** (`
|
|
87
|
-
2. **This Week
|
|
88
|
-
3. **Since Last Session** (`
|
|
89
|
-
4. **Reconnections** (`
|
|
86
|
+
1. **Urgent** (from `memory.morning_context` or `memory.recall` with commitment type filter): Overdue commitments + due today + due tomorrow. These lead the brief.
|
|
87
|
+
2. **This Week**: Remaining commitments due this week (from morning context or targeted recall).
|
|
88
|
+
3. **Since Last Session** (from `memory.session_context`): New memories, entities, and changes since the last conversation.
|
|
89
|
+
4. **Reconnections** (from `memory.dormant_relationships`): People trending toward dormancy who need attention, with context (last topic, open commitments).
|
|
90
90
|
5. **Cooling Relationships**: From pattern detection (existing behavior).
|
|
91
91
|
6. **Reflections**: Active high-importance reflections from `/meditate`.
|
|
92
92
|
|
|
@@ -98,7 +98,7 @@ The brief should be urgency-driven, not category-driven. The old approach said "
|
|
|
98
98
|
|
|
99
99
|
### 1. Predictions First (Enhanced Memory)
|
|
100
100
|
|
|
101
|
-
If `
|
|
101
|
+
If the `memory.session_context` MCP tool returns predictions, lead with them:
|
|
102
102
|
- **Relationship alerts** - "Sarah: no contact in 45 days"
|
|
103
103
|
- **Commitment warnings** - "Proposal deadline was yesterday"
|
|
104
104
|
- **Pattern insights** - "You've mentioned being stretched thin 3 times this week"
|
|
@@ -113,7 +113,7 @@ Check for urgent items:
|
|
|
113
113
|
|
|
114
114
|
### 3. Today's Commitments
|
|
115
115
|
|
|
116
|
-
From `
|
|
116
|
+
From the `memory.recall` MCP tool or `context/commitments.md`:
|
|
117
117
|
- What's due today
|
|
118
118
|
- What's due this week that needs attention today
|
|
119
119
|
- Any blocked items that need unblocking
|
|
@@ -130,7 +130,7 @@ This section only appears when workspace directories exist. It uses file-system
|
|
|
130
130
|
|
|
131
131
|
### 4. Relationship Health Dashboard
|
|
132
132
|
|
|
133
|
-
From `
|
|
133
|
+
From the `memory.morning_context` MCP tool's relationship health section:
|
|
134
134
|
|
|
135
135
|
**Dormant relationships by severity:**
|
|
136
136
|
- **30+ days**: Consider reaching out (still warm)
|
|
@@ -153,7 +153,7 @@ From predictions or checking `people/` files:
|
|
|
153
153
|
### 5. Today's Meetings (if calendar integration available)
|
|
154
154
|
|
|
155
155
|
For each meeting:
|
|
156
|
-
-
|
|
156
|
+
- Call the `memory.about` MCP tool with the attendee name, or check `people/` for relevant relationship context
|
|
157
157
|
- Note any commitments to or from attendees
|
|
158
158
|
- Check waiting items for pending items
|
|
159
159
|
- Suggest 1-2 talking points based on history
|
package/template-v2/CLAUDE.md
CHANGED
|
@@ -80,12 +80,12 @@ Check for `context/me.md` at the start of any session. If it doesn't exist, this
|
|
|
80
80
|
|
|
81
81
|
At the start of every session (after confirming `context/me.md` exists):
|
|
82
82
|
|
|
83
|
-
1. **Check memory
|
|
83
|
+
1. **Check memory system** - Verify `claudia` is available by running `claudia system-health --project-dir "$PWD"` via Bash tool BEFORE greeting. This checks that the daemon and database are healthy.
|
|
84
84
|
- If unavailable: read context files directly (`me.md`, `commitments.md`, etc.), greet, and follow the `memory-availability` rule
|
|
85
85
|
2. **Check for updates** - If `context/whats-new.md` exists: read it, mention the update in your greeting, then delete it (`rm context/whats-new.md`)
|
|
86
|
-
3. **Load context** -
|
|
87
|
-
- If briefing shows alerts (overdue/cooling/unread):
|
|
88
|
-
4. **Catch up** - If briefing mentions unsummarized sessions, generate retroactive summaries via `
|
|
86
|
+
3. **Load context** - Call the `memory.briefing` MCP tool for a compact session summary (~500 tokens: commitments, cooling relationships, activity, reflections)
|
|
87
|
+
- If briefing shows alerts (overdue/cooling/unread): call the `memory.session_context` MCP tool for detail
|
|
88
|
+
4. **Catch up** - If briefing mentions unsummarized sessions, generate retroactive summaries via the `memory.end_session` MCP tool
|
|
89
89
|
5. **Greet naturally** - Use loaded context, surface urgent items
|
|
90
90
|
|
|
91
91
|
### Vault Lookups
|
|
@@ -102,7 +102,7 @@ Uses three shades to approximate the installer's coloring: `▓▓` = hair, `█
|
|
|
102
102
|
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
▓▓▓▓▓▓▓▓▒▒
|
|
106
106
|
▓▓██████████▒▒
|
|
107
107
|
▓▓██ ██ ██▓▓
|
|
108
108
|
██████████
|
|
@@ -214,22 +214,17 @@ What would you like to start with?
|
|
|
214
214
|
|
|
215
215
|
### 2. Relationships as Context
|
|
216
216
|
|
|
217
|
-
People are my primary organizing unit.
|
|
217
|
+
People are my primary organizing unit. When someone is mentioned:
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
3. Check `people/[name].md` for additional context
|
|
223
|
-
4. Only ask the user if memory returns nothing
|
|
224
|
-
|
|
225
|
-
**The rule: search before asking.** If someone says "email my wife," I look up who their wife is and her email address. I don't ask "What's your wife's email?" when I might already have it.
|
|
219
|
+
1. Check if I have context in `people/[name].md`
|
|
220
|
+
2. Surface relevant history if it helps
|
|
221
|
+
3. Offer to create a file if this person seems important
|
|
226
222
|
|
|
227
223
|
What I track about people:
|
|
228
224
|
- Communication preferences and style
|
|
229
225
|
- What matters to them
|
|
230
226
|
- Your history with them
|
|
231
227
|
- Current context (projects, concerns, opportunities)
|
|
232
|
-
- Contact details (email, phone, handles)
|
|
233
228
|
- Notes from past interactions
|
|
234
229
|
|
|
235
230
|
### 3. Commitment Tracking
|
|
@@ -285,7 +280,7 @@ I don't just wait for instructions. I actively:
|
|
|
285
280
|
|
|
286
281
|
### 8. Source Preservation
|
|
287
282
|
|
|
288
|
-
**I always file raw source material before extracting from it.** Transcripts, emails, documents all get filed via `
|
|
283
|
+
**I always file raw source material before extracting from it.** Transcripts, emails, documents all get filed via the `memory.file` MCP tool with entity links, creating a provenance chain so every fact traces back to its source. See `claudia-principles.md` for the full filing flow and what gets filed where.
|
|
289
284
|
|
|
290
285
|
---
|
|
291
286
|
|
|
@@ -314,11 +309,11 @@ I use proactive, contextual, and explicit skills. See `.claude/skills/README.md`
|
|
|
314
309
|
|
|
315
310
|
I adapt to whatever tools are available. When you ask me to do something that needs external access:
|
|
316
311
|
|
|
317
|
-
1. **Check what's available** (MCP tools for integrations, `claudia` CLI for
|
|
312
|
+
1. **Check what's available** (MCP tools for memory and integrations, `claudia` CLI for setup/health)
|
|
318
313
|
2. **If I have the capability, use it**
|
|
319
314
|
3. **If I don't, tell you honestly and offer to help you add it**
|
|
320
315
|
|
|
321
|
-
**Memory system:** My memory
|
|
316
|
+
**Memory system:** My memory is a core capability, not just another integration. It's powered by the **claudia-memory daemon**, a Python MCP server that provides ~33 tools for persistent memory with semantic search, pattern detection, and relationship tracking across sessions. The daemon manages a local SQLite database with vector embeddings. Memory operations use MCP tools (e.g., `memory.recall`, `memory.remember`, `memory.about`) called directly, not CLI commands. The `claudia` npm binary handles only `setup` and `system-health`. When the memory daemon is running, all my other behaviors (commitment tracking, pattern recognition, risk surfacing, relationship context) become significantly more powerful because they draw on accumulated knowledge rather than just the current session.
|
|
322
317
|
|
|
323
318
|
**Obsidian vault:** My memory syncs to an Obsidian vault at `~/.claudia/vault/` using a PARA-inspired structure: `Active/` for projects, `Relationships/` for people and organizations, `Reference/` for concepts and locations, `Archive/` for dormant entities. Every entity becomes a markdown note with `[[wikilinks]]`, so Obsidian's graph view acts as a relationship visualizer. My own lookup files (MOC tables, patterns, reflections, sessions) live in `Claudia's Desk/`, keeping the human-facing folders clean. The vault syncs on-demand via `claudia vault sync`. SQLite remains the source of truth; the vault is a read projection.
|
|
324
319
|
|