teammind 0.2.0 → 0.2.1

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
@@ -14,7 +14,7 @@
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
20
  *Every insight your team discovers with Claude Code — remembered forever.*
@@ -27,22 +27,22 @@
27
27
 
28
28
  Claude Code is stateless. Every session starts fresh.
29
29
 
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.
30
+ 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
31
 
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.
32
+ **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
33
 
34
34
  ---
35
35
 
36
- ## Install
37
-
38
- **One command. 30 seconds. No API key.**
36
+ ## Get started in 30 seconds
39
37
 
40
38
  ```bash
41
- npx teammind init
39
+ npm install -g teammind
40
+ teammind init
42
41
  ```
43
42
 
43
+ That's it. No API key. No config. No server to run.
44
+
44
45
  ```
45
- ✓ Claude Code detected
46
46
  ✓ Hooks installed in ~/.claude/settings.json
47
47
  ✓ MCP server registered
48
48
  ✓ Embedding model ready (38MB, runs locally)
@@ -51,240 +51,186 @@ npx teammind init
51
51
  TeamMind is active. Just use Claude Code normally.
52
52
  ```
53
53
 
54
- That's it. No API key. No server. No config.
54
+ > **Already have it?** Update with `npm install -g teammind@latest`
55
55
 
56
56
  ---
57
57
 
58
58
  ## How it works
59
59
 
60
+ 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.
61
+
60
62
  ```
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
63
+ ┌─ SESSION START ──────────────────────────────────────────────┐
64
+ │ │
65
+ │ Claude receives your team's memories automatically: │
66
+
67
+ │ <team_memory project="myapp" branch="main"> │
68
+ │ 1. [gotcha] Stripe webhook needs raw Buffer before │
69
+ │ constructEvent() src/webhooks/stripe.ts │
70
+ │ 2. [bug] Prisma timeout at 5s on large checkouts │
71
+ │ 3. [decision] Idempotency keys on all payment intents │
72
+ </team_memory> │
73
+
74
+ └───────────────────────────────────────────────────────────────┘
75
+ Claude already knows this before you say anything.
76
+
77
+ ┌─ SESSION END (background, ~1 second) ────────────────────────┐
78
+ │ │
79
+ │ TeamMind scans assistant turns for high-value signals: │
80
+ │ "the reason we..." / "note that..." / "fixed by..." │
81
+ │ │
82
+ Extracts → embeds locally → deduplicates → stores │
83
+ │ with git metadata and file hashes for staleness detection │
84
+ │ │
85
+ └───────────────────────────────────────────────────────────────┘
102
86
  ```
103
87
 
104
88
  ---
105
89
 
106
- ## Features
107
-
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. |
117
-
118
- ---
119
-
120
- ## CLI Reference
90
+ ## Daily commands
121
91
 
122
92
  ```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
141
- ```
93
+ # See what TeamMind knows about your current project
94
+ teammind status
142
95
 
143
- ---
96
+ # Browse all memories
97
+ teammind memories
144
98
 
145
- ## What gets remembered
99
+ # Search memories
100
+ teammind memories "stripe webhook"
146
101
 
147
- TeamMind scans each session's assistant turns for high-signal patterns — no API call needed:
102
+ # Filter by type
103
+ teammind memories --tag bug
104
+ teammind memories --tag decision
105
+ teammind memories --tag gotcha
148
106
 
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 | |
107
+ # Read a memory in full
108
+ teammind memory <id>
158
109
 
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.
110
+ # Delete a memory
111
+ teammind forget <id>
112
+ teammind forget --stale # clear outdated memories
113
+ teammind forget --all # wipe everything for this project
114
+ ```
160
115
 
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)
116
+ **`teammind status` shows a live breakdown:**
117
+ ```
118
+ TeamMind myapp
119
+ ────────────────────────────────────────
120
+ 31 fresh memories • 2 stale • last captured today
121
+
122
+ By type:
123
+ bug ██████████ 12
124
+ decision ███████ 8
125
+ gotcha █████ 6
126
+ security ████ 5
127
+ config ██ 3
128
+
129
+ Recent:
130
+ • [gotcha] Stripe webhook must receive raw Buffer before constructEvent() — today
131
+ • [bug] Prisma transaction timeout at 5s on large cart checkouts — today
132
+ • [decision] Switched to idempotency keys after double-charge incident — 2d ago
133
+ ```
166
134
 
167
135
  ---
168
136
 
169
- ## Team Sync
137
+ ## Sharing with your team
170
138
 
171
- ### Option 1: Git (recommended)
139
+ Export your memories to a file and commit it:
172
140
 
173
141
  ```bash
174
- # On your machine
142
+ # Export
175
143
  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
144
+ git add .claude/team-memories.json && git commit -m "chore: team memories" && git push
179
145
 
180
- # On your teammate's machine
181
- git pull
146
+ # Import (your teammates run this after pulling)
182
147
  teammind team --import .claude/team-memories.json
183
148
  ```
184
149
 
185
- Auto-import on every `git pull` with a post-merge hook:
150
+ Auto-import every time someone pulls:
186
151
  ```bash
187
152
  echo 'teammind team --import .claude/team-memories.json' >> .git/hooks/post-merge
188
153
  chmod +x .git/hooks/post-merge
189
154
  ```
190
155
 
191
- ### Option 2: Self-hosted sync *(coming soon)*
156
+ ---
192
157
 
193
- Run a sync server on your own infra. All team members point to it.
158
+ ## What gets captured
194
159
 
195
- ### Option 3: TeamMind Cloud *(coming soon)*
160
+ TeamMind scans assistant turns for signal language — no API call, no cost:
196
161
 
197
- Hosted sync, free for teams under 5.
162
+ | Captured | Skipped |
163
+ |---|---|
164
+ | Root causes of bugs | Generic programming advice |
165
+ | Architectural decisions and *why* | Obvious things from reading the code |
166
+ | Non-obvious gotchas | Temporary debugging that was reverted |
167
+ | API quirks and workarounds | Standard library usage |
168
+ | Security considerations | Basic code explanations |
169
+ | Performance findings | |
170
+ | Config constraints | |
198
171
 
199
- ---
172
+ 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.
200
173
 
201
- ## Configuration
174
+ Memory types: `bug` · `decision` · `gotcha` · `security` · `performance` · `config` · `api` · `pattern`
202
175
 
203
- ```bash
204
- # View all config
205
- teammind config list
176
+ ---
206
177
 
207
- # Adjust injection (default: 10 memories per session start)
208
- teammind config set max_inject 15
178
+ ## MCP tools (mid-session)
209
179
 
210
- # Disable auto-extraction (manual memory_add only)
211
- teammind config set extraction_enabled false
180
+ Claude can call these tools during a session without you asking:
212
181
 
213
- # Adjust dedup sensitivity (default: 0.88)
214
- teammind config set similarity_threshold 0.85
215
- ```
216
-
217
- Config is stored at `~/.teammind/config.json`.
182
+ | Tool | What it does |
183
+ |---|---|
184
+ | `memory_search` | Semantic search across team memories |
185
+ | `memory_add` | Save a new insight manually |
186
+ | `memory_list` | List recent memories for this project |
187
+ | `memory_stale` | Check which memories may be outdated |
218
188
 
219
189
  ---
220
190
 
221
- ## Memory lifecycle
191
+ ## Staleness detection
192
+
193
+ 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
194
 
223
195
  ```
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
196
+ [gotcha] ⚠ STALE Auth middleware skips OPTIONS for CORS
246
197
  ```
247
198
 
248
- ---
199
+ It still injects but warns Claude not to rely on it. `teammind forget --stale` clears them all.
249
200
 
250
- ## What Claude sees
201
+ ---
251
202
 
252
- At the start of every session on a project with memories:
203
+ ## Configuration
253
204
 
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)
205
+ ```bash
206
+ teammind config list # show current config
207
+ teammind config set max_inject 15 # inject more memories per session (default: 10)
208
+ teammind config set extraction_enabled false # disable auto-extraction
209
+ teammind config set similarity_threshold 0.85 # dedup sensitivity (default: 0.88)
263
210
  ```
264
211
 
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
212
  ---
268
213
 
269
- ## Privacy
214
+ ## Sessions
215
+
216
+ ```bash
217
+ teammind sessions # see all captured sessions
218
+ teammind extract --pending # manually process any unextracted sessions
219
+ ```
270
220
 
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
221
+ 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
222
 
277
223
  ---
278
224
 
279
225
  ## How it hooks into Claude Code
280
226
 
281
- TeamMind adds two hooks and one MCP server to `~/.claude/settings.json`:
227
+ TeamMind patches `~/.claude/settings.json` during `init`:
282
228
 
283
229
  ```json
284
230
  {
285
231
  "hooks": {
286
- "SessionStart": [{ "hooks": [{ "type": "command", "command": "node ... inject" }] }],
287
- "Stop": [{ "hooks": [{ "type": "command", "command": "node ... capture" }] }]
232
+ "SessionStart": [{ "hooks": [{ "type": "command", "command": "node ~/.teammind/hooks/session-start.js" }] }],
233
+ "Stop": [{ "hooks": [{ "type": "command", "command": "node ~/.teammind/hooks/session-stop.js" }] }]
288
234
  },
289
235
  "mcpServers": {
290
236
  "teammind": { "type": "stdio", "command": "node", "args": ["...", "server"] }
@@ -292,55 +238,18 @@ TeamMind adds two hooks and one MCP server to `~/.claude/settings.json`:
292
238
  }
293
239
  ```
294
240
 
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`.
241
+ - **SessionStart** prints memories to stdout, Claude Code injects them as context
242
+ - **Stop** — saves the transcript, spawns a detached background worker (you feel zero latency)
243
+ - **MCP server** gives Claude the 4 tools above during sessions
300
244
 
301
245
  ---
302
246
 
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
247
+ ## Privacy
342
248
 
343
- This means memories about refactored code don't silently mislead future sessions.
249
+ - **No code leaves your machine** extraction is entirely local, zero network requests
250
+ - **Embeddings run locally** via `@huggingface/transformers`
251
+ - **No telemetry** of any kind
252
+ - **Secrets are redacted** before team export (API keys, tokens, passwords)
344
253
 
345
254
  ---
346
255
 
@@ -348,22 +257,20 @@ This means memories about refactored code don't silently mislead future sessions
348
257
 
349
258
  - Node.js ≥ 18.0.0
350
259
  - Claude Code (any version with hooks support)
351
- - Git (for git-aware features)
260
+ - Git (optional — for branch/commit metadata)
352
261
 
353
- No API key. No cloud account. No native compilation.
262
+ No API key. No cloud account. No native compilation. Works on Mac, Linux, and Windows.
354
263
 
355
264
  ---
356
265
 
357
266
  ## License
358
267
 
359
- MIT — use it, fork it, build on it.
268
+ MIT
360
269
 
361
270
  ---
362
271
 
363
272
  <div align="center">
364
273
 
365
- Built for teams who use Claude Code seriously.
366
-
367
274
  [npm](https://npmjs.com/package/teammind) · [Issues](https://github.com/natedemoss/Teammind/issues)
368
275
 
369
276
  </div>
@@ -5,4 +5,4 @@ export declare const HOOKS_DIR: string;
5
5
  export declare const MAX_INJECT_MEMORIES = 10;
6
6
  export declare const EMBED_MODEL = "Xenova/all-MiniLM-L6-v2";
7
7
  export declare const EMBED_DIM = 384;
8
- export declare const VERSION = "0.2.0";
8
+ export declare const VERSION = "0.2.1";
package/dist/constants.js CHANGED
@@ -13,5 +13,5 @@ exports.HOOKS_DIR = path_1.default.join(exports.TEAMMIND_DIR, 'hooks');
13
13
  exports.MAX_INJECT_MEMORIES = 10;
14
14
  exports.EMBED_MODEL = 'Xenova/all-MiniLM-L6-v2';
15
15
  exports.EMBED_DIM = 384;
16
- exports.VERSION = '0.2.0';
16
+ exports.VERSION = '0.2.1';
17
17
  //# sourceMappingURL=constants.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teammind",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Git-aware persistent memory for Claude Code teams",
5
5
  "bin": {
6
6
  "teammind": "./dist/cli.js"