somtum 1.2.0 → 1.3.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/README.md CHANGED
@@ -20,9 +20,10 @@ Zero-config: one `somtum init` in an existing Claude Code project and every sess
20
20
  - [Requirements](#requirements)
21
21
  - [Install](#install)
22
22
  - [Quickstart](#quickstart)
23
+ - [Verifying the setup](#verifying-the-setup)
24
+ - [Dashboard](#dashboard)
23
25
  - [CLI Reference](#cli-reference)
24
26
  - [MCP Server](#mcp-server)
25
- - [Dashboard](#dashboard)
26
27
  - [Storage Layout](#storage-layout)
27
28
  - [Configuration](#configuration)
28
29
  - [Privacy](#privacy)
@@ -102,17 +103,17 @@ LLM agents like Claude Code typically start every session with a "blank slate."
102
103
  ## Requirements
103
104
 
104
105
  - **Node 20+**
105
- - **pnpm** (`npm i -g pnpm`)
106
- - **`ANTHROPIC_API_KEY`** — used by the capture hook to summarise session transcripts via Claude Haiku, and optionally by the `index` and `hybrid` retrieval strategies
106
+ - **Claude Code** — Somtum hooks into Claude Code's `SessionEnd`, `UserPromptSubmit`, and `PreToolUse` events
107
+ - **`ANTHROPIC_API_KEY`** _(optional)_ — if set, Somtum uses the Anthropic API directly for extraction (lets you choose the model explicitly). If not set, Somtum falls back to the `claude` CLI that ships with Claude Code, so **no separate API key is required for Claude Code subscribers**.
108
+
109
+ > `pnpm` is only required if building from source. Global npm/yarn installs have no pnpm dependency.
107
110
 
108
111
  ---
109
112
 
110
113
  ## Install
111
114
 
112
- ### From npm / yarn / pnpm
113
-
114
115
  ```bash
115
- # npm
116
+ # npm (recommended for global install)
116
117
  npm install -g somtum
117
118
 
118
119
  # yarn
@@ -126,8 +127,6 @@ Or as a project dependency:
126
127
 
127
128
  ```bash
128
129
  npm install somtum
129
- yarn add somtum
130
- pnpm add somtum
131
130
  ```
132
131
 
133
132
  ### From source
@@ -137,67 +136,184 @@ git clone https://github.com/riz007/somtum
137
136
  cd somtum
138
137
  pnpm install
139
138
  pnpm build
140
- # Optional: link globally
141
139
  pnpm link --global
142
140
  ```
143
141
 
144
142
  ### Native module note
145
143
 
146
- Somtum uses [`better-sqlite3`](https://github.com/WiseLibs/better-sqlite3), which contains a native C++ addon. On most platforms (macOS, Linux x64/arm64, Windows x64) a prebuilt binary is downloaded automatically. On Alpine Linux / musl or unusual architectures the addon compiles from source, which requires `python`, `make`, and `gcc` to be available. If the install fails with a node-gyp error, install those build tools and retry.
144
+ Somtum uses [`better-sqlite3`](https://github.com/WiseLibs/better-sqlite3), which contains a native C++ addon. On most platforms (macOS, Linux x64/arm64, Windows x64) a prebuilt binary is downloaded automatically. On Alpine Linux / musl or unusual architectures the addon compiles from source — `python`, `make`, and `gcc` must be available. If the install fails with a node-gyp error, install those build tools and retry.
147
145
 
148
146
  ---
149
147
 
150
148
  ## Quickstart
151
149
 
150
+ ### Step 1 — Choose your extraction backend
151
+
152
+ Somtum needs to call a Claude model at session end to extract observations. There are two options — pick one:
153
+
154
+ **Option A: Claude Code subscription (no extra setup)**
155
+
156
+ If you already have Claude Code installed, you're done. Somtum calls `claude --print` automatically when no API key is present. Skip to Step 2.
157
+
158
+ **Option B: Direct Anthropic API key (optional — faster, explicit model choice)**
159
+
160
+ If you want Somtum to call the API directly (useful if you use Somtum outside of a Claude Code environment, or want to pin a specific model), add to `~/.zshrc` (or `~/.bashrc`):
161
+
162
+ ```bash
163
+ export ANTHROPIC_API_KEY="sk-ant-..."
164
+ ```
165
+
166
+ Then reload:
167
+
168
+ ```bash
169
+ source ~/.zshrc
170
+ ```
171
+
172
+ > When a `SessionEnd` hook fires, it inherits the environment of the shell that _started_ Claude Code — not the current terminal. So the key must be in your shell profile, not just `export`-ed in an open terminal tab.
173
+
174
+ ### Step 2 — Install inside a Claude Code project
175
+
176
+ Run this from the **root of the project you work in with Claude Code**:
177
+
152
178
  ```bash
153
- # 1. Inside an existing Claude Code project:
154
179
  somtum init
180
+ ```
181
+
182
+ This writes a `SessionEnd` hook into `.claude/settings.json` in the current directory. Claude Code reads that file automatically when you open a session from the same directory.
183
+
184
+ To enable all features at once:
185
+
186
+ ```bash
187
+ somtum init --all
188
+ # Installs:
189
+ # - SessionEnd capture hook (memory extraction)
190
+ # - UserPromptSubmit cache hook (prompt cache lookup)
191
+ # - PreToolUse file-gating hook (file read summaries)
192
+ # - MCP server in .mcp.json (Claude can call recall/remember tools)
193
+ ```
194
+
195
+ ### Step 3 — Use Claude Code normally
196
+
197
+ Open a Claude Code session **from the same directory** where you ran `somtum init`. Work as you normally would. When the session ends, the hook extracts observations automatically in the background (capped at 90 seconds so it never blocks you).
155
198
 
156
- # Installs a SessionEnd hook in .claude/settings.json.
157
- # Use Claude Code as normal — observations are captured at session end.
199
+ ### Step 4 — Check your memory
158
200
 
159
- # 2. Search your memory
201
+ ```bash
202
+ # How many observations were captured?
203
+ somtum stats
204
+
205
+ # Search memory
160
206
  somtum search "auth jwt rotation"
161
207
  somtum search "why we use pnpm" --strategy hybrid
162
208
 
163
- # 3. Read a full observation
164
- somtum show 01JBZ...
209
+ # Open the visual dashboard
210
+ somtum serve
211
+ ```
212
+
213
+ If `somtum stats` shows `memories 0` after a session, see [Troubleshooting](#troubleshooting).
214
+
215
+ ### Step 5 — Diagnose any issues
216
+
217
+ ```bash
218
+ somtum doctor
219
+ ```
220
+
221
+ This checks your API key, DB health, hook installation, migrations, cache, and breakeven ratio. It will tell you exactly what is misconfigured and how to fix it.
222
+
223
+ ---
224
+
225
+ ## Verifying the setup
226
+
227
+ After your **first** Claude Code session ends:
228
+
229
+ **1. Check the hook log**
230
+
231
+ Every hook run appends a timestamped line to `~/.somtum/hook.log`:
232
+
233
+ ```bash
234
+ cat ~/.somtum/hook.log
235
+ ```
236
+
237
+ A successful run looks like:
238
+
239
+ ```
240
+ 2026-04-30T10:15:42.123Z [post_session] starting
241
+ 2026-04-30T10:15:44.891Z [post_session] ok — inserted=4 cache=2 summaries=1
242
+ ```
243
+
244
+ A run using the claude CLI fallback (no API key) looks like:
245
+
246
+ ```
247
+ 2026-04-30T10:15:42.123Z [post_session] starting
248
+ 2026-04-30T10:15:42.124Z [post_session] ANTHROPIC_API_KEY not set — will use claude CLI fallback
249
+ 2026-04-30T10:15:44.891Z [post_session] ok — inserted=4 cache=2 summaries=1
250
+ ```
165
251
 
166
- # 4. Check your token savings
252
+ A failed run (neither key nor CLI available) looks like:
253
+
254
+ ```
255
+ 2026-04-30T10:15:42.123Z [post_session] starting
256
+ 2026-04-30T10:15:42.124Z [post_session] ANTHROPIC_API_KEY not set — will use claude CLI fallback
257
+ 2026-04-30T10:15:42.131Z [post_session] ERROR: Neither ANTHROPIC_API_KEY nor the claude CLI is available.
258
+ ```
259
+
260
+ **2. Check stats**
261
+
262
+ ```bash
167
263
  somtum stats
264
+ ```
168
265
 
169
- # 5. Open the visual dashboard
170
- somtum serve
266
+ You should see `memories` > 0 after a substantive session. Short test sessions may yield 0 observations if there is nothing worth extracting (Claude Code did not make decisions, fix bugs, or learn anything the extractor considers durable).
171
267
 
172
- # 6. Diagnose any issues
268
+ **3. Run doctor**
269
+
270
+ ```bash
173
271
  somtum doctor
174
272
  ```
175
273
 
176
- ### Enable all features at once
274
+ All checks should show `✓`. The `api_key` and `hooks_installed` checks are the two most commonly failing.
275
+
276
+ ---
277
+
278
+ ## Dashboard
279
+
280
+ Somtum includes a visual memory browser you can open at any time:
177
281
 
178
282
  ```bash
179
- somtum init --all
180
- # Installs:
181
- # - SessionEnd capture hook
182
- # - UserPromptSubmit prompt-cache hook
183
- # - PreToolUse file-gating hook
184
- # - MCP server registration in .mcp.json
283
+ somtum serve
284
+ # Opens http://localhost:3000 in your browser
185
285
  ```
186
286
 
287
+ The dashboard provides:
288
+
289
+ - **Memory browser** — searchable, filterable list of all captured observations. Supports BM25, hybrid, and embeddings strategies live. Click any memory to see its full body, files touched, and tags.
290
+ - **Knowledge graph** — vis-network graph where nodes are memories and edges connect memories that share files or tags. Clicking a node opens the detail panel.
291
+ - **Analytics** — kind breakdown, cache hit rate, retrieval strategy usage, and top-referenced files.
292
+ - **Forget button** — soft-delete any memory directly from the browser.
293
+
294
+ Options:
295
+
296
+ | Flag | Description |
297
+ | ------------ | -------------------------------------- |
298
+ | `--port <n>` | Listen on a custom port (default 3000) |
299
+ | `--no-open` | Don't auto-open the browser |
300
+
301
+ Press `Ctrl-C` to stop the server.
302
+
187
303
  ---
188
304
 
189
- ## CLI reference
305
+ ## CLI Reference
190
306
 
191
307
  ### Setup
192
308
 
193
- | Command | Description |
194
- | --------------------------- | --------------------------------------------------- |
195
- | `somtum init` | Install the SessionEnd capture hook |
196
- | `somtum init --cache` | Also install the UserPromptSubmit cache hook |
197
- | `somtum init --file-gating` | Also install the PreToolUse file-gating hook |
198
- | `somtum init --all` | Install all hooks + MCP server |
199
- | `somtum init --force` | Reinstall even if hooks already present |
200
- | `somtum doctor` | Check DB health, migrations, hooks, breakeven ratio |
309
+ | Command | Description |
310
+ | --------------------------- | ------------------------------------------------------------ |
311
+ | `somtum init` | Install the SessionEnd capture hook |
312
+ | `somtum init --cache` | Also install the UserPromptSubmit cache hook |
313
+ | `somtum init --file-gating` | Also install the PreToolUse file-gating hook |
314
+ | `somtum init --all` | Install all hooks + MCP server |
315
+ | `somtum init --force` | Reinstall even if hooks already present |
316
+ | `somtum doctor` | Check DB health, migrations, hooks, API key, breakeven ratio |
201
317
 
202
318
  ### Memory
203
319
 
@@ -212,6 +328,16 @@ somtum init --all
212
328
  | `somtum rebuild` | Regenerate `index.md` from all observations |
213
329
  | `somtum reindex` | Recompute embeddings (after a model change) |
214
330
 
331
+ ### Stats & Visibility
332
+
333
+ | Command | Description |
334
+ | ------------------------- | ------------------------------------------------- |
335
+ | `somtum stats` | Tokens saved, cache hit rate, retrieval breakdown |
336
+ | `somtum stats --json` | Machine-readable JSON output |
337
+ | `somtum serve` | Open the visual dashboard in the browser |
338
+ | `somtum serve --port <n>` | Use a custom port (default 3000) |
339
+ | `somtum serve --no-open` | Start server without opening the browser |
340
+
215
341
  ### Data management
216
342
 
217
343
  | Command | Description |
@@ -226,13 +352,9 @@ somtum init --all
226
352
 
227
353
  ### Stats & visibility
228
354
 
229
- | Command | Description |
230
- | -------------------------- | ----------------------------------------------------------- |
231
- | `somtum stats` | Tokens saved, cache hit rate, retrieval breakdown |
232
- | `somtum stats --json` | Machine-readable JSON output |
233
- | `somtum serve` | Open local web dashboard — memory browser, graph, analytics |
234
- | `somtum serve --port 4000` | Specify a custom port (default: 3000) |
235
- | `somtum serve --no-open` | Start the server without opening the browser |
355
+ | Command | Description |
356
+ | ---------------- | ------------------------------------------- |
357
+ | `somtum reindex` | Embed observations that are missing vectors |
236
358
 
237
359
  ### Configuration
238
360
 
@@ -251,7 +373,8 @@ somtum init --all
251
373
  | `somtum sync push` | Export and scp observations to remote |
252
374
  | `somtum sync pull` | scp from remote and merge into local DB |
253
375
 
254
- Remote configured in config: `somtum config set sync.remote "user@host:/path/.somtum/projects/<id>"`
376
+ Remote configured in config: `somtum config set sync.remote "user@host:/path/.somtum/projects/<id>"`
377
+ Somtum uses hostname-aware syncing to prevent data loss when using multiple devices.
255
378
 
256
379
  ---
257
380
 
@@ -294,6 +417,7 @@ somtum serve --no-open # don't auto-open the browser
294
417
  ```
295
418
  ~/.somtum/
296
419
  ├── config.json ← global config (overridden by project config)
420
+ ├── hook.log ← timestamped log of every hook execution
297
421
  └── projects/
298
422
  └── <project_id>/
299
423
  ├── db.sqlite ← source of truth (SQLite WAL)
@@ -303,6 +427,8 @@ somtum serve --no-open # don't auto-open the browser
303
427
  └── <ulid>.md ← per-observation markdown files
304
428
  ```
305
429
 
430
+ The project ID is derived from the git remote URL (if present) or the directory path — the same project always maps to the same ID regardless of which machine you're on, as long as the remote URL matches.
431
+
306
432
  SQLite is the source of truth. `index.md` and `memories/*.md` are derived mirrors regenerated on each capture. Edit observations with `somtum edit <id>`, not by hand.
307
433
 
308
434
  ---
@@ -391,12 +517,12 @@ The breakeven ratio (`tokens_saved / tokens_spent`) measures whether extraction
391
517
 
392
518
  ## Performance
393
519
 
394
- | Scenario | p95 budget | Notes |
395
- | --------------------------------------- | ---------- | ------------------------------------- |
396
- | `UserPromptSubmit` hook at 1k memories | 150 ms | SQLite hash lookup — typically < 2 ms |
397
- | `UserPromptSubmit` hook at 10k memories | 300 ms | BM25 k=8 — typically < 30 ms |
398
- | Exact cache hash lookup | — | < 0.1 ms |
399
- | `SessionEnd` hook (capture + embed) | — | Hard capped at 90 s; exits cleanly |
520
+ | Scenario | p95 budget | Actual (benchmark) |
521
+ | --------------------------------------- | ------------- | ------------------------ |
522
+ | `UserPromptSubmit` hook at 1k memories | 150 ms | < 2 ms (BM25 k=8) |
523
+ | `UserPromptSubmit` hook at 10k memories | 300 ms | < 30 ms (BM25 k=8) |
524
+ | Exact cache hash lookup | — | < 0.1 ms |
525
+ | `SessionEnd` hook (extract + embed) | 90 s hard cap | Exits cleanly on timeout |
400
526
 
401
527
  Run benchmarks yourself:
402
528
 
@@ -423,34 +549,42 @@ pnpm build # tsc + copy migrations + copy dashboard → dist/
423
549
 
424
550
  ```
425
551
  src/
426
- cli/ # commander-based CLI commands
427
- serve.ts # local web dashboard (h3 + sirv)
552
+ cli/
553
+ index.ts # commander CLI entry point
554
+ init.ts # somtum init — installs hooks + MCP config
555
+ serve.ts # somtum serve — local dashboard server
556
+ stats.ts # somtum stats
557
+ doctor.ts # somtum doctor — health checks
558
+ hook.ts # internal: dispatches hook events by name
559
+ search.ts / show.ts / forget.ts / edit.ts
560
+ export.ts / import.ts / purge.ts / sync.ts / rebuild.ts / reindex.ts
561
+ config_cmd.ts
428
562
  core/
429
- db.ts # SQLite setup, migration runner
430
- store.ts # MemoryStore — CRUD for observations
431
- cache.ts # PromptCache — exact + fuzzy lookup
432
- retriever/ # bm25, embeddings, hybrid, index, factory
433
- extractor.ts # session transcript → observations (Claude)
434
- index_gen.ts # renders index.md (incremental past 1k obs)
435
- memory_files.ts # writes memories/<YYYY-MM>/<ulid>.md
436
- retrieval_stats.ts # per-strategy call counters
437
- embeddings.ts # Embedder interface + encode/decode utils
438
- embeddings_xenova.ts # @xenova/transformers ONNX backend
439
- privacy.ts # redact() — runs on every capture
440
- tokens.ts # gpt-tokenizer wrapper
563
+ db.ts # SQLite setup, migration runner
564
+ store.ts # MemoryStore — CRUD for observations
565
+ cache.ts # PromptCache — exact + fuzzy lookup
566
+ retriever/ # bm25, embeddings, hybrid, index, factory
567
+ extractor.ts # session transcript → observations (Claude Haiku)
568
+ index_gen.ts # renders index.md (incremental past 1k obs)
569
+ memory_files.ts # writes memories/<YYYY-MM>/<ulid>.md
570
+ retrieval_stats.ts
571
+ embeddings.ts # Embedder interface + encode/decode utils
572
+ privacy.ts # redact() — runs on every capture
573
+ tokens.ts # gpt-tokenizer wrapper
441
574
  hooks/
442
- post_session.ts # SessionEnd: extract → store → embed → index
443
- pre_prompt.ts # UserPromptSubmit: cache lookup
444
- pre_read.ts # PreToolUse: file gating
445
- mcp/ # MCP server + tool implementations
446
- dashboard/ # Single-file web UI (index.html)
447
- config.ts # global + project config merge
448
- index.ts # public API for embedding Somtum
449
- src/db/migrations/ # NNN_name.sql migration files
575
+ post_session.ts # SessionEnd: extract → store → index → log
576
+ pre_prompt.ts # UserPromptSubmit: cache lookup
577
+ pre_read.ts # PreToolUse: file gating
578
+ mcp/ # MCP server + tool implementations
579
+ dashboard/
580
+ index.html # single-page dashboard (served by somtum serve)
581
+ config.ts # global + project config merge
582
+ index.ts # public API for embedding Somtum
583
+ src/db/migrations/ # NNN_name.sql migration files
450
584
  test/
451
- golden/ # per-strategy retrieval golden sets
452
- bench/ # hot-path latency benchmarks
453
- fixtures/ # synthetic session transcripts
585
+ golden/ # per-strategy retrieval golden sets
586
+ bench/ # hot-path latency benchmarks
587
+ fixtures/ # synthetic session transcripts
454
588
  ```
455
589
 
456
590
  ### Adding a new observation kind
@@ -471,50 +605,142 @@ test/
471
605
 
472
606
  ## Troubleshooting
473
607
 
474
- ### Agent appears to keep running after a session ends
608
+ ### `somtum stats` shows `memories 0` after a session
609
+
610
+ This almost always means the hook ran but extraction failed. Check the log first:
611
+
612
+ ```bash
613
+ cat ~/.somtum/hook.log
614
+ ```
615
+
616
+ Common causes:
617
+
618
+ **`claude` CLI not found and no `ANTHROPIC_API_KEY` set**
619
+
620
+ Somtum needs one of the two backends available when the `SessionEnd` hook fires. If neither is present, extraction silently fails.
621
+
622
+ - If you use Claude Code: make sure the `claude` binary is on your `PATH`. Run `which claude` — if it prints nothing, reinstall Claude Code or add it to `PATH`.
623
+ - If you prefer the direct API: add `export ANTHROPIC_API_KEY="sk-ant-..."` to `~/.zshrc` (or `~/.bashrc`) and `source ~/.zshrc`. The key must be in your shell profile because the hook subprocess inherits from the shell that _started_ Claude Code, not the current terminal tab.
475
624
 
476
- The `SessionEnd` hook runs after every session to extract and store observations. On first install with embeddings enabled, it also downloads a ~30 MB ONNX model. The hook has a hard 90-second cap — it will always exit within that window. If you see a `somtum hook post_session` process in your process list, it is working normally in the background and will exit on its own.
625
+ Run `somtum doctor` — the `api_key` check will tell you exactly which path is available.
477
626
 
478
- To reduce hook duration, disable file summaries or embeddings:
627
+ **Hook not installed in the right directory**
628
+
629
+ `somtum init` writes the hook to `.claude/settings.json` in the directory where you ran it. If you run Claude Code from a _different_ directory, it reads a different (or absent) settings file.
630
+
631
+ Fix: run `somtum init` from the same directory you use to launch Claude Code.
479
632
 
480
633
  ```bash
481
- somtum config set file_gating.enabled false
482
- somtum config set retrieval.embeddings.enabled false
634
+ cd ~/my-project
635
+ somtum init
636
+ claude # must be launched from ~/my-project
483
637
  ```
484
638
 
639
+ **Short or trivial session**
640
+
641
+ If the session didn't contain any decisions, bug fixes, or learnings (e.g. you just asked Claude to say hello), the extractor correctly returns 0 observations.
642
+
643
+ Try a real working session, then re-check.
644
+
645
+ **Run `somtum doctor`** for a full diagnostic:
646
+
647
+ ```bash
648
+ somtum doctor
649
+ ```
650
+
651
+ It checks extraction auth (API key or claude CLI), hook installation, DB health, embeddings, breakeven ratio, and more, with specific fix instructions for each failing check.
652
+
653
+ ---
654
+
655
+ ### `somtum serve` opens the browser but shows "Connection refused"
656
+
657
+ This was a bug fixed in v1.1.0. Upgrade:
658
+
659
+ ```bash
660
+ npm install -g somtum@latest
661
+ ```
662
+
663
+ If you installed from source, rebuild:
664
+
665
+ ```bash
666
+ pnpm build
667
+ ```
668
+
669
+ ---
670
+
671
+ ### `somtum serve` — port already in use
672
+
673
+ If port 3000 is busy, use `--port`:
674
+
675
+ ```bash
676
+ somtum serve --port 3001
677
+ ```
678
+
679
+ ---
680
+
681
+ ### Agent appears to keep running after session ends
682
+
683
+ The `SessionEnd` hook has a hard 90-second timeout — it cannot block Claude Code indefinitely. If sessions appear stuck immediately after installing Somtum, verify you are on v1.1.0+:
684
+
685
+ ```bash
686
+ somtum --version
687
+ ```
688
+
689
+ And check the log for any long-running operations:
690
+
691
+ ```bash
692
+ tail -20 ~/.somtum/hook.log
693
+ ```
694
+
695
+ ---
696
+
697
+
485
698
  ### Installation fails (node-gyp / better-sqlite3)
486
699
 
487
- If you see errors related to building `better-sqlite3`, ensure you have build tools installed:
700
+ If you see errors related to building `better-sqlite3`, ensure build tools are installed:
488
701
 
489
702
  - **macOS:** `xcode-select --install`
490
703
  - **Ubuntu/Debian:** `sudo apt-get install build-essential python3`
491
704
  - **Windows:** `npm install --global --production windows-build-tools`
492
705
 
493
- ### "Anthropic API Key not found"
494
-
495
- The capture hook requires `ANTHROPIC_API_KEY` to be set in your environment. Add it to your shell profile (`.zshrc`, `.bashrc`) or a `.env` file loaded by your shell.
496
-
497
- ### Claude isn't using the memories
498
-
499
- Run `somtum doctor` to verify that hooks are correctly installed in `.claude/settings.json` and that the MCP server is registered in `.mcp.json`.
706
+ ---
500
707
 
501
708
  ### Embeddings are slow or the model won't download
502
709
 
503
- The `bge-small-en-v1.5` model (~30 MB) downloads to `~/.somtum/models/` on first use. If the download stalls, disable embeddings and fall back to BM25:
710
+ The first `somtum reindex` downloads a ~30 MB ONNX model (`bge-small-en-v1.5`) from Hugging Face. This requires internet access and may be slow on first run. Subsequent runs use the cached model.
711
+
712
+ If you are on an air-gapped machine or prefer not to use embeddings, disable them:
504
713
 
505
714
  ```bash
506
715
  somtum config set retrieval.embeddings.enabled false
716
+ somtum config set retrieval.strategy bm25
507
717
  ```
508
718
 
509
- BM25 retrieval is near-zero cost and works fully offline.
719
+ BM25 retrieval works fully offline and is fast at any reasonable corpus size.
720
+
721
+ ---
722
+
723
+ ### Claude isn't using the memories
724
+
725
+ If you are using the MCP server (`somtum init --all`), Claude will automatically call `recall` when it's uncertain about project details. If it's not happening:
726
+
727
+ 1. Confirm `.mcp.json` exists in your project root: `cat .mcp.json`
728
+ 2. Restart Claude Code so it picks up the new MCP config
729
+ 3. Try prompting Claude explicitly: _"Check your Somtum memory for anything related to our auth setup"_
730
+
731
+ If you are not using the MCP server, memories are injected via the `index.md` file — add it to your CLAUDE.md or Claude Code context with:
732
+
733
+ ```
734
+ See ~/.somtum/projects/<project_id>/index.md for prior session learnings.
735
+ ```
510
736
 
511
737
  ---
512
738
 
513
739
  ## Contributing
514
740
 
515
- Contributions are welcome! If you'd like to help improve Somtum, please see our [CONTRIBUTING.md](CONTRIBUTING.md) for a guide on how to get started.
741
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for the guide.
516
742
 
517
- **Important Note for Contributors:** This project uses `changesets` for versioning. Every PR must include a changeset file generated by running `pnpm changeset`.
743
+ **Important:** This project uses `changesets` for versioning. Every PR must include a changeset file generated by running `pnpm changeset`.
518
744
 
519
745
  ---
520
746
 
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,YAAY,CAyJnE;AAED,wBAAsB,aAAa,CACjC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,YAAY,CA+KnE;AAED,wBAAsB,aAAa,CACjC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
@@ -1,5 +1,6 @@
1
1
  import { join } from 'node:path';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
+ import { execSync } from 'node:child_process';
3
4
  import { openDb, hasFts5, appliedVersions } from '../core/db.js';
4
5
  import { MemoryStore } from '../core/store.js';
5
6
  import { PromptCache } from '../core/cache.js';
@@ -113,7 +114,29 @@ export function runDoctor(opts = {}) {
113
114
  ? `enabled (model: ${config.retrieval.embeddings.model}) — run \`somtum reindex\` to embed missing`
114
115
  : 'disabled (set retrieval.embeddings.enabled=true to enable)',
115
116
  });
116
- // 11. Hook files in .claude/settings.json
117
+ // 11. Extraction auth: ANTHROPIC_API_KEY or claude CLI fallback
118
+ const apiKey = process.env['ANTHROPIC_API_KEY'];
119
+ const hasApiKey = Boolean(apiKey && apiKey.trim().length > 0);
120
+ let claudeCliAvailable = false;
121
+ if (!hasApiKey) {
122
+ try {
123
+ execSync('claude --version', { stdio: 'pipe' });
124
+ claudeCliAvailable = true;
125
+ }
126
+ catch {
127
+ // not in PATH
128
+ }
129
+ }
130
+ checks.push({
131
+ name: 'api_key',
132
+ ok: hasApiKey || claudeCliAvailable,
133
+ detail: hasApiKey
134
+ ? 'ANTHROPIC_API_KEY is set'
135
+ : claudeCliAvailable
136
+ ? 'No ANTHROPIC_API_KEY — using claude CLI fallback (Claude Code subscription)'
137
+ : 'Neither ANTHROPIC_API_KEY nor claude CLI available — extraction will fail',
138
+ });
139
+ // 12. Hook files in .claude/settings.json
117
140
  const settingsPath = join(cwd, '.claude', 'settings.json');
118
141
  if (existsSync(settingsPath)) {
119
142
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAatF,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACtC,MAAM,MAAM,GAAkB,EAAE,CAAC;IAE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AAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/cli/hook.ts"],"names":[],"mappings":"AA6BA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyD/D"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/cli/hook.ts"],"names":[],"mappings":"AAqCA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8D/D"}