claude-mem 12.4.4 → 12.4.6
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/dist/npx-cli/index.js +156 -153
- package/dist/opencode-plugin/index.js +2 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +8 -8
- package/plugin/package.json +2 -1
- package/plugin/scripts/context-generator.cjs +79 -66
- package/plugin/scripts/mcp-server.cjs +36 -74
- package/plugin/scripts/smart-install.js +2 -57
- package/plugin/scripts/worker-service.cjs +211 -191
- package/plugin/skills/timeline-report/SKILL.md +15 -7
|
@@ -20,7 +20,15 @@ Use when users ask for:
|
|
|
20
20
|
|
|
21
21
|
## Prerequisites
|
|
22
22
|
|
|
23
|
-
The claude-mem worker must be running
|
|
23
|
+
The claude-mem worker must be running. The project must have claude-mem observations recorded.
|
|
24
|
+
|
|
25
|
+
**Resolve the worker port** (do this once at the start and reuse `$WORKER_PORT` in every curl call below):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
WORKER_PORT="${CLAUDE_MEM_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(37700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.claude-mem','settings.json'),'utf-8'));process.stdout.write(String(s.CLAUDE_MEM_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This honors `CLAUDE_MEM_WORKER_PORT` env, then `~/.claude-mem/settings.json`, then falls back to the per-UID default `37700 + (uid % 100)` — matching how the worker itself picks its port. Required for multi-account setups (#2101) and any user who has overridden the default port (#2103).
|
|
24
32
|
|
|
25
33
|
## Workflow
|
|
26
34
|
|
|
@@ -50,7 +58,7 @@ If a worktree is detected, use `$parent_project` (the basename of the parent rep
|
|
|
50
58
|
Use Bash to fetch the complete timeline from the claude-mem worker API:
|
|
51
59
|
|
|
52
60
|
```bash
|
|
53
|
-
curl -s "http://localhost
|
|
61
|
+
curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true"
|
|
54
62
|
```
|
|
55
63
|
|
|
56
64
|
This returns the entire compressed timeline -- every observation, session boundary, and summary across the project's full history. The response is pre-formatted markdown optimized for LLM consumption.
|
|
@@ -60,7 +68,7 @@ This returns the entire compressed timeline -- every observation, session bounda
|
|
|
60
68
|
- Medium project (1,000-10,000 observations): ~50-300K tokens
|
|
61
69
|
- Large project (10,000-35,000 observations): ~300-750K tokens
|
|
62
70
|
|
|
63
|
-
If the response is empty or returns an error, the worker may not be running or the project name may be wrong. Try `curl -s "http://localhost
|
|
71
|
+
If the response is empty or returns an error, the worker may not be running or the project name may be wrong. Try `curl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify the worker is healthy.
|
|
64
72
|
|
|
65
73
|
### Step 3: Estimate Token Count
|
|
66
74
|
|
|
@@ -187,15 +195,15 @@ Tell the user:
|
|
|
187
195
|
|
|
188
196
|
## Error Handling
|
|
189
197
|
|
|
190
|
-
- **Empty timeline:** "No observations found for project 'X'. Check the project name with: `curl -s
|
|
191
|
-
- **Worker not running:** "The claude-mem worker is not responding on port
|
|
192
|
-
- **Timeline too large:** For projects with 50,000+ observations, the timeline may exceed context limits. Suggest using date range filtering: `curl -s "http://localhost
|
|
198
|
+
- **Empty timeline:** "No observations found for project 'X'. Check the project name with: `curl -s \"http://localhost:${WORKER_PORT}/api/search?query=*&limit=1\"`"
|
|
199
|
+
- **Worker not running:** "The claude-mem worker is not responding on port ${WORKER_PORT}. Start it with your usual method or check `ps aux | grep worker-service`."
|
|
200
|
+
- **Timeline too large:** For projects with 50,000+ observations, the timeline may exceed context limits. Suggest using date range filtering: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=X&full=true"` -- the current endpoint returns all observations; for extremely large projects, the user may want to analyze in time-windowed segments.
|
|
193
201
|
|
|
194
202
|
## Example
|
|
195
203
|
|
|
196
204
|
User: "Write a journey report for the tokyo project"
|
|
197
205
|
|
|
198
|
-
1. Fetch: `curl -s "http://localhost
|
|
206
|
+
1. Fetch: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=tokyo&full=true"`
|
|
199
207
|
2. Estimate: "Timeline fetched: ~34,722 observations, estimated ~718K tokens. Proceed?"
|
|
200
208
|
3. User confirms
|
|
201
209
|
4. Deploy analysis agent with full timeline
|