teammind 0.2.0 → 0.2.2

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
@@ -9,40 +9,48 @@
9
9
  ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═════╝
10
10
  ```
11
11
 
12
- **Git-aware persistent memory for Claude Code teams**
12
+ **Git-aware persistent memory for Claude Code teams — and a personal AI that learns how you work**
13
13
 
14
14
  [![npm version](https://img.shields.io/npm/v/teammind?color=blue&style=flat-square)](https://npmjs.com/package/teammind)
15
15
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-green?style=flat-square)](https://nodejs.org)
16
16
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
17
- [![Claude Code](https://img.shields.io/badge/Claude%20Code-compatible-purple?style=flat-square)](https://claude.ai/code)
17
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-hooks-purple?style=flat-square)](https://claude.ai/code)
18
18
  [![No API key](https://img.shields.io/badge/API%20key-not%20required-brightgreen?style=flat-square)](#)
19
19
 
20
- *Every insight your team discovers with Claude Coderemembered forever.*
20
+ *Every insight your team discovers remembered forever. Every preference you have written to CLAUDE.md automatically.*
21
21
 
22
22
  </div>
23
23
 
24
24
  ---
25
25
 
26
+ ## Two things TeamMind does
27
+
28
+ **1. Team memory** — captures what your team learns with Claude Code and shares it across every developer's sessions automatically.
29
+
30
+ **2. Personal persona** — watches how you interact with Claude Code, figures out your preferences, and writes them directly to `~/.claude/CLAUDE.md`. Claude reads that file in every project, so it adapts to how you work without you ever having to explain yourself again.
31
+
32
+ ---
33
+
26
34
  ## The problem
27
35
 
28
36
  Claude Code is stateless. Every session starts fresh.
29
37
 
30
- Alice spends 3 hours debugging a race condition, discovers the root cause, fixes it. Bob hits the exact same bug the next morning — his Claude has no idea what Alice learned. The senior dev who knows why the auth middleware skips OPTIONS requests goes on vacation. The codebase has 40 undocumented gotchas that only exist in old conversations.
38
+ Alice spends 3 hours debugging a race condition, finds the root cause, fixes it. Bob hits the exact same bug the next morning — his Claude has no idea what Alice learned. The senior dev who knows why the auth middleware skips OPTIONS requests goes on vacation. The codebase has 40 undocumented gotchas that only exist in old Slack threads.
31
39
 
32
- **TeamMind fixes this.** It silently captures what your team learns in Claude Code sessions and makes that knowledge available to every developer's Claude — automatically, forever.
40
+ **TeamMind fixes this.** It silently captures what your team learns and makes that knowledge available to every developer's Claude — automatically, from the first prompt.
33
41
 
34
42
  ---
35
43
 
36
- ## Install
37
-
38
- **One command. 30 seconds. No API key.**
44
+ ## Get started in 30 seconds
39
45
 
40
46
  ```bash
41
- npx teammind init
47
+ npm install -g teammind
48
+ teammind init
42
49
  ```
43
50
 
51
+ That's it. No API key. No config. No server to run.
52
+
44
53
  ```
45
- ✓ Claude Code detected
46
54
  ✓ Hooks installed in ~/.claude/settings.json
47
55
  ✓ MCP server registered
48
56
  ✓ Embedding model ready (38MB, runs locally)
@@ -51,240 +59,226 @@ npx teammind init
51
59
  TeamMind is active. Just use Claude Code normally.
52
60
  ```
53
61
 
54
- That's it. No API key. No server. No config.
62
+ > **Already have it?** Update with `npm install -g teammind@latest`
55
63
 
56
64
  ---
57
65
 
58
66
  ## How it works
59
67
 
68
+ Open Claude Code → TeamMind silently injects relevant memories into Claude's context before you type a word. Close Claude Code → TeamMind scans the transcript in the background and saves anything worth remembering.
69
+
60
70
  ```
61
- YOUR SESSION BACKGROUND
62
- ────────────────── ──────────────────────────────────
63
- You open Claude Code
64
-
65
-
66
- SessionStart hook fires
67
- TeamMind injects team
68
- context into Claude's
69
- initial prompt
70
- ┌─────────────────────┐
71
- [gotcha] Auth skips
72
- │ OPTIONS for CORS │
73
- [bug] Prisma times │
74
- │ out at 5s on large │
75
- checkouts │
76
- └─────────────────────┘
77
-
78
- Claude already knows
79
- before you type a word
80
-
81
-
82
- Mid-session: Claude calls
83
- memory_search / memory_add
84
- as it encounters files
85
- │ SESSION ENDS
86
- ▼ │
87
- You close Claude Code ──────────────────────►│
88
-
89
- Stop hook fires
90
- Transcript saved to DB
91
-
92
- ▼ (fully detached, no API call)
93
- Local signal analysis
94
- scans assistant turns for
95
- high-value patterns
96
-
97
-
98
- Memories embedded locally
99
- Stored with git metadata
100
- File hashes saved for
101
- staleness detection
71
+ ┌─ SESSION START ──────────────────────────────────────────────┐
72
+ │ │
73
+ │ Claude receives your team's memories automatically: │
74
+
75
+ │ <team_memory project="myapp" branch="main"> │
76
+ │ 1. [gotcha] Stripe webhook needs raw Buffer before │
77
+ │ constructEvent() src/webhooks/stripe.ts │
78
+ │ 2. [bug] Prisma timeout at 5s on large checkouts │
79
+ │ 3. [decision] Idempotency keys on all payment intents │
80
+ </team_memory> │
81
+
82
+ └───────────────────────────────────────────────────────────────┘
83
+ Claude already knows this before you say anything.
84
+
85
+ ┌─ SESSION END (background, ~1 second) ────────────────────────┐
86
+ │ │
87
+ │ TeamMind scans assistant turns for high-value signals: │
88
+ │ "the reason we..." / "note that..." / "fixed by..." │
89
+ │ │
90
+ Extracts → embeds locally → deduplicates → stores │
91
+ │ with git metadata and file hashes for staleness detection │
92
+ │ │
93
+ └───────────────────────────────────────────────────────────────┘
102
94
  ```
103
95
 
104
96
  ---
105
97
 
106
- ## Features
98
+ ## Personal persona — writes to your CLAUDE.md
107
99
 
108
- | | |
109
- |---|---|
110
- | **No API key required** | Extraction runs entirely on-device using local signal heuristics. Zero cost, zero setup. |
111
- | **Silent operation** | Injects memory context before your first prompt. Captures learnings after your last. You never see it working. |
112
- | **Git-aware** | Memories are tagged with branch and commit. Files referenced by a memory are hashed — when those files change, the memory is marked stale automatically. |
113
- | **Zero native deps** | Uses Node.js built-in `node:sqlite`. No compilation, no Visual Studio, no Python. Works on Mac, Linux, and Windows out of the box. |
114
- | **Local-first** | Embeddings and extraction run fully in-process. Your code never leaves your machine. |
115
- | **Team sync** | Export memories to a JSON file, commit it to your repo, teammates import on `git pull`. |
116
- | **MCP tools** | Claude can search, add, and check memory freshness mid-session via 4 MCP tools. |
100
+ TeamMind watches your sessions for signals about how you prefer to work with Claude — things like "be more concise", "just do it", "show me the code first", "stop summarizing". It aggregates these across sessions and writes them directly to `~/.claude/CLAUDE.md`.
117
101
 
118
- ---
102
+ Since `~/.claude/CLAUDE.md` is the global instructions file that Claude Code reads at the start of **every** session in **every** project, your preferences travel with you automatically — no setup per project, no repeating yourself.
119
103
 
120
- ## CLI Reference
104
+ ```
105
+ ~/.claude/CLAUDE.md
106
+
107
+ <!-- teammind-persona:start -->
108
+
109
+ ## User Interaction Preferences
110
+
111
+ - Keep responses concise — avoid lengthy explanations
112
+ - Take action directly — do not ask for confirmation on straightforward tasks
113
+ - Show code directly rather than describing it first
114
+
115
+ <!-- teammind-persona:end -->
116
+ ```
117
+
118
+ TeamMind only touches the section between its markers — everything else in your CLAUDE.md stays exactly as it is.
121
119
 
122
120
  ```bash
123
- # Setup
124
- npx teammind init # one-time setup patches Claude Code settings
125
-
126
- # Daily use
127
- teammind status # memory stats for the current project
128
- teammind memories # browse all memories
129
- teammind memories "auth" # search memories by keyword
130
- teammind sessions # see captured sessions (processed / pending)
131
- teammind forget <id> # delete a specific memory
132
- teammind forget --stale # bulk-delete all stale memories
133
-
134
- # Extraction
135
- teammind extract --pending # manually trigger extraction for pending sessions
136
-
137
- # Team sync
138
- teammind team # interactive team setup wizard
139
- teammind team --export ./path # export memories to JSON
140
- teammind team --import ./path # import memories from JSON
121
+ teammind persona # see your current preferences
122
+ teammind persona --update # re-analyze sessions and rewrite to CLAUDE.md
123
+ teammind persona --reset # remove the section from CLAUDE.md
141
124
  ```
142
125
 
126
+ **What it detects:** response length, explanation style, code-first vs description-first, confirmation prompts, formatting preferences, summary behavior.
127
+
128
+ **What it never touches:** how Claude writes code, architectural choices, language/framework preferences — those belong in your project's CLAUDE.md, not here.
129
+
143
130
  ---
144
131
 
145
- ## What gets remembered
132
+ ## Daily commands
146
133
 
147
- TeamMind scans each session's assistant turns for high-signal patterns — no API call needed:
134
+ ```bash
135
+ # See what TeamMind knows about your current project
136
+ teammind status
148
137
 
149
- | Captured | Not captured |
150
- |---|---|
151
- | Bugs found and their root cause | Generic programming advice |
152
- | Architectural decisions and *why* | Things obvious from reading the code |
153
- | Non-obvious gotchas | Temporary debugging steps |
154
- | API quirks and workarounds | Standard library usage |
155
- | Performance findings | Basic code explanations |
156
- | Security considerations | |
157
- | Important config constraints | |
138
+ # Browse all memories
139
+ teammind memories
140
+
141
+ # Search memories
142
+ teammind memories "stripe webhook"
143
+
144
+ # Filter by type
145
+ teammind memories --tag bug
146
+ teammind memories --tag decision
147
+ teammind memories --tag gotcha
158
148
 
159
- The extractor looks for causal reasoning ("instead of X because Y"), gotcha markers ("note that", "watch out", "caveat"), bug/fix patterns, and decision language — the same things a senior dev would highlight in a code review comment.
149
+ # Read a memory in full
150
+ teammind memory <id>
160
151
 
161
- Each memory is stored with:
162
- - The files it relates to (for staleness detection)
163
- - The git commit and branch it was discovered on
164
- - Who discovered it
165
- - A semantic embedding (for smart retrieval)
152
+ # Delete a memory
153
+ teammind forget <id>
154
+ teammind forget --stale # clear outdated memories
155
+ teammind forget --all # wipe everything for this project
156
+ ```
157
+
158
+ ```bash
159
+ # Build / update your personal preferences in CLAUDE.md
160
+ teammind persona
161
+ teammind persona --update
162
+ ```
163
+
164
+ **`teammind status` shows a live breakdown:**
165
+ ```
166
+ TeamMind — myapp
167
+ ────────────────────────────────────────
168
+ 31 fresh memories • 2 stale • last captured today
169
+
170
+ By type:
171
+ bug ██████████ 12
172
+ decision ███████ 8
173
+ gotcha █████ 6
174
+ security ████ 5
175
+ config ██ 3
176
+
177
+ Recent:
178
+ • [gotcha] Stripe webhook must receive raw Buffer before constructEvent() — today
179
+ • [bug] Prisma transaction timeout at 5s on large cart checkouts — today
180
+ • [decision] Switched to idempotency keys after double-charge incident — 2d ago
181
+ ```
166
182
 
167
183
  ---
168
184
 
169
- ## Team Sync
185
+ ## Sharing with your team
170
186
 
171
- ### Option 1: Git (recommended)
187
+ Export your memories to a file and commit it:
172
188
 
173
189
  ```bash
174
- # On your machine
190
+ # Export
175
191
  teammind team --export .claude/team-memories.json
176
- git add .claude/team-memories.json
177
- git commit -m "chore: add team memories"
178
- git push
192
+ git add .claude/team-memories.json && git commit -m "chore: team memories" && git push
179
193
 
180
- # On your teammate's machine
181
- git pull
194
+ # Import (your teammates run this after pulling)
182
195
  teammind team --import .claude/team-memories.json
183
196
  ```
184
197
 
185
- Auto-import on every `git pull` with a post-merge hook:
198
+ Auto-import every time someone pulls:
186
199
  ```bash
187
200
  echo 'teammind team --import .claude/team-memories.json' >> .git/hooks/post-merge
188
201
  chmod +x .git/hooks/post-merge
189
202
  ```
190
203
 
191
- ### Option 2: Self-hosted sync *(coming soon)*
192
-
193
- Run a sync server on your own infra. All team members point to it.
204
+ ---
194
205
 
195
- ### Option 3: TeamMind Cloud *(coming soon)*
206
+ ## What gets captured
196
207
 
197
- Hosted sync, free for teams under 5.
208
+ TeamMind scans assistant turns for signal language — no API call, no cost:
198
209
 
199
- ---
210
+ | Captured | Skipped |
211
+ |---|---|
212
+ | Root causes of bugs | Generic programming advice |
213
+ | Architectural decisions and *why* | Obvious things from reading the code |
214
+ | Non-obvious gotchas | Temporary debugging that was reverted |
215
+ | API quirks and workarounds | Standard library usage |
216
+ | Security considerations | Basic code explanations |
217
+ | Performance findings | |
218
+ | Config constraints | |
200
219
 
201
- ## Configuration
220
+ It looks for causal reasoning (`"instead of X because Y"`), gotcha markers (`"note that"`, `"watch out"`), bug/fix patterns, and decision language — the same things you'd write in a code review comment.
202
221
 
203
- ```bash
204
- # View all config
205
- teammind config list
222
+ Memory types: `bug` · `decision` · `gotcha` · `security` · `performance` · `config` · `api` · `pattern`
206
223
 
207
- # Adjust injection (default: 10 memories per session start)
208
- teammind config set max_inject 15
224
+ ---
209
225
 
210
- # Disable auto-extraction (manual memory_add only)
211
- teammind config set extraction_enabled false
226
+ ## MCP tools (mid-session)
212
227
 
213
- # Adjust dedup sensitivity (default: 0.88)
214
- teammind config set similarity_threshold 0.85
215
- ```
228
+ Claude can call these tools during a session without you asking:
216
229
 
217
- Config is stored at `~/.teammind/config.json`.
230
+ | Tool | What it does |
231
+ |---|---|
232
+ | `memory_search` | Semantic search across team memories |
233
+ | `memory_add` | Save a new insight manually |
234
+ | `memory_list` | List recent memories for this project |
235
+ | `memory_stale` | Check which memories may be outdated |
218
236
 
219
237
  ---
220
238
 
221
- ## Memory lifecycle
239
+ ## Staleness detection
240
+
241
+ When a memory references a file, TeamMind stores a hash of that file. On every session start it re-hashes and compares. If a file changed, the memory gets flagged:
222
242
 
223
243
  ```
224
- Session ends
225
-
226
-
227
- Transcript saved to ~/.teammind/db.sqlite
228
-
229
- ▼ (background process, ~1 second, no network)
230
- Local heuristic extraction
231
- Scans assistant turns for high-signal paragraphs
232
- Extracts 0–10 high-value memories
233
-
234
-
235
- Each memory is:
236
- • Embedded locally (all-MiniLM-L6-v2, 384 dims)
237
- • Tagged with file paths + function names
238
- • Hashed against current file contents
239
- • Stored with git metadata
240
-
241
-
242
- Next session start:
243
- Top 10 memories injected into Claude's context
244
- File hashes checked → stale memories flagged
245
- Claude calls memory_search as needed
244
+ [gotcha] ⚠ STALE Auth middleware skips OPTIONS for CORS
246
245
  ```
247
246
 
248
- ---
247
+ It still injects but warns Claude not to rely on it. `teammind forget --stale` clears them all.
249
248
 
250
- ## What Claude sees
249
+ ---
251
250
 
252
- At the start of every session on a project with memories:
251
+ ## Configuration
253
252
 
254
- ```xml
255
- <team_memory project="myapp" branch="feature/payments">
256
- 1. [gotcha] Stripe webhook must receive raw Buffer body before constructEvent() — src/webhooks/stripe.ts
257
- 2. [decision] Using idempotency keys on all payment intents — decided after double-charge incident Jan 2026
258
- 3. [bug] Prisma transaction timeout at 5s hits on large cart checkouts — src/db/checkout.ts
259
- 4. [pattern] All currency stored as integers (cents), never floats
260
- 5. [config] TEST_MODE=true bypasses Stripe in dev, but still hits real webhooks endpoint
261
- </team_memory>
262
- (5 of 31 memories — use memory_search tool for more)
253
+ ```bash
254
+ teammind config list # show current config
255
+ teammind config set max_inject 15 # inject more memories per session (default: 10)
256
+ teammind config set extraction_enabled false # disable auto-extraction
257
+ teammind config set similarity_threshold 0.85 # dedup sensitivity (default: 0.88)
263
258
  ```
264
259
 
265
- Claude reads this before you type a word. It uses `memory_search` mid-session to pull deeper context when it needs it.
266
-
267
260
  ---
268
261
 
269
- ## Privacy
262
+ ## Sessions
270
263
 
271
- - **Your code never leaves your machine** — extraction is fully local, no API calls
272
- - **Embeddings run locally** using `@huggingface/transformers` — no API calls for search
273
- - **No telemetry** TeamMind makes zero network requests on its own
274
- - **Team export** scans for secrets before writing (API keys, tokens, passwords are redacted)
275
- - **Self-hostable** — run everything on your own infra if needed
264
+ ```bash
265
+ teammind sessions # see all captured sessions
266
+ teammind extract --pending # manually process any unextracted sessions
267
+ ```
268
+
269
+ If TeamMind is running but you're not seeing memories yet, run `teammind extract --pending` — it processes any sessions that haven't been extracted yet.
276
270
 
277
271
  ---
278
272
 
279
273
  ## How it hooks into Claude Code
280
274
 
281
- TeamMind adds two hooks and one MCP server to `~/.claude/settings.json`:
275
+ TeamMind patches `~/.claude/settings.json` during `init`:
282
276
 
283
277
  ```json
284
278
  {
285
279
  "hooks": {
286
- "SessionStart": [{ "hooks": [{ "type": "command", "command": "node ... inject" }] }],
287
- "Stop": [{ "hooks": [{ "type": "command", "command": "node ... capture" }] }]
280
+ "SessionStart": [{ "hooks": [{ "type": "command", "command": "node ~/.teammind/hooks/session-start.js" }] }],
281
+ "Stop": [{ "hooks": [{ "type": "command", "command": "node ~/.teammind/hooks/session-stop.js" }] }]
288
282
  },
289
283
  "mcpServers": {
290
284
  "teammind": { "type": "stdio", "command": "node", "args": ["...", "server"] }
@@ -292,55 +286,18 @@ TeamMind adds two hooks and one MCP server to `~/.claude/settings.json`:
292
286
  }
293
287
  ```
294
288
 
295
- **SessionStart** runs before your first prompt and prints team memories to stdout Claude Code injects this as context.
296
-
297
- **Stop** fires when Claude finishes. It saves the transcript and spawns a detached background process for extraction. You feel zero latency.
298
-
299
- **MCP server** gives Claude 4 tools: `memory_search`, `memory_add`, `memory_list`, `memory_stale`.
289
+ - **SessionStart** prints memories to stdout, Claude Code injects them as context
290
+ - **Stop** — saves the transcript, spawns a detached background worker (you feel zero latency)
291
+ - **MCP server** gives Claude the 4 tools above during sessions
300
292
 
301
293
  ---
302
294
 
303
- ## MCP Tools
304
-
305
- Claude has these tools available mid-session:
306
-
307
- #### `memory_search`
308
- ```
309
- Search team memory for relevant context about code, bugs, decisions, or patterns.
310
- Parameters: query (string), file_path? (string), limit? (number)
311
- ```
312
-
313
- #### `memory_add`
314
- ```
315
- Save an important insight, decision, bug fix, or pattern to team memory.
316
- Parameters: content (string), summary (string), tags? (string[]), file_paths? (string[]), functions? (string[])
317
- ```
318
-
319
- #### `memory_list`
320
- ```
321
- List recent memories for the current project.
322
- Parameters: limit? (number)
323
- ```
324
-
325
- #### `memory_stale`
326
- ```
327
- Check which memories may be outdated because their referenced files changed.
328
- Parameters: (none)
329
- ```
330
-
331
- ---
332
-
333
- ## Staleness detection
334
-
335
- When TeamMind saves a memory that references a file, it stores a SHA-256 hash of that file at that moment.
336
-
337
- Every session start, it re-hashes all referenced files and compares. If a file changed:
338
- - The memory is marked `stale`
339
- - It still injects with a `[may be outdated]` tag
340
- - It's deprioritized in ranking
341
- - `teammind forget --stale` clears them in bulk
295
+ ## Privacy
342
296
 
343
- This means memories about refactored code don't silently mislead future sessions.
297
+ - **No code leaves your machine** extraction is entirely local, zero network requests
298
+ - **Embeddings run locally** via `@huggingface/transformers`
299
+ - **No telemetry** of any kind
300
+ - **Secrets are redacted** before team export (API keys, tokens, passwords)
344
301
 
345
302
  ---
346
303
 
@@ -348,22 +305,20 @@ This means memories about refactored code don't silently mislead future sessions
348
305
 
349
306
  - Node.js ≥ 18.0.0
350
307
  - Claude Code (any version with hooks support)
351
- - Git (for git-aware features)
308
+ - Git (optional — for branch/commit metadata)
352
309
 
353
- No API key. No cloud account. No native compilation.
310
+ No API key. No cloud account. No native compilation. Works on Mac, Linux, and Windows.
354
311
 
355
312
  ---
356
313
 
357
314
  ## License
358
315
 
359
- MIT — use it, fork it, build on it.
316
+ MIT
360
317
 
361
318
  ---
362
319
 
363
320
  <div align="center">
364
321
 
365
- Built for teams who use Claude Code seriously.
366
-
367
322
  [npm](https://npmjs.com/package/teammind) · [Issues](https://github.com/natedemoss/Teammind/issues)
368
323
 
369
324
  </div>