Skip to content

Commit 9511071

Browse files
Claudeclaude
authored andcommitted
feat: add telemetry CLI, confirm-scars prefix matching, session-close timing
- Add `npx gitmem-mcp telemetry` command (enable/disable/status/show/clear) - Add telemetry lib with opt-in tracking, local log, privacy-first design - Add PRIVACY.md with full transparency on data collection - Support 8-char prefix matching in confirm_scars (matches recall display) - Track agent_reflection_ms and human_wait_time_ms in session-close metrics - Add telemetry opt-in prompt to init flow - Update README A/B testing description for accuracy - Update CLI UX guidelines recall header copy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 09820b6 commit 9511071

9 files changed

Lines changed: 1072 additions & 6 deletions

File tree

PRIVACY.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# GitMem Privacy Policy
2+
3+
**Last Updated:** February 20, 2026
4+
**Version:** 1.0
5+
6+
## Our Commitment
7+
8+
Your institutional memory is yours. GitMem telemetry is **opt-in, anonymous, and transparent**. We collect only what helps improve the product, and you can inspect everything before it's sent.
9+
10+
## What We Collect (When Enabled)
11+
12+
When you enable telemetry, we collect:
13+
14+
```json
15+
{
16+
"event": "tool_called",
17+
"tool": "recall",
18+
"success": true,
19+
"duration_ms": 234,
20+
"result_count": 3,
21+
"version": "1.2.0",
22+
"platform": "darwin",
23+
"mcp_host": "claude-desktop",
24+
"tier": "free",
25+
"timestamp": "2026-02-20T12:34:56Z",
26+
"session_id": "7a4f2c91" // Random per-session, not persistent
27+
}
28+
```
29+
30+
**Purpose:**
31+
- Understand which tools are most useful
32+
- Identify error patterns to prioritize fixes
33+
- Measure performance across platforms
34+
- Guide feature development
35+
36+
## What We Never Collect
37+
38+
**Your content:**
39+
- Queries or search terms
40+
- Scar text or descriptions
41+
- Learning/decision content
42+
- Session reflections
43+
- Code or file paths
44+
45+
**Personal identifiers:**
46+
- Email addresses
47+
- IP addresses
48+
- Persistent user IDs
49+
- Project names
50+
- GitHub usernames
51+
52+
**Environment data:**
53+
- API keys or credentials
54+
- Environment variables
55+
- Directory paths
56+
- Database connection strings
57+
58+
## How It Works
59+
60+
### 1. Default State: Disabled
61+
62+
Telemetry is **off by default**. No data is sent unless you explicitly opt in.
63+
64+
### 2. Transparent Collection
65+
66+
All events are logged locally at `.gitmem/telemetry.log` BEFORE being sent:
67+
68+
```bash
69+
$ cat .gitmem/telemetry.log
70+
{"event":"tool_called","tool":"recall","success":true,"duration_ms":234,...}
71+
{"event":"tool_called","tool":"session_close","success":true,"duration_ms":567,...}
72+
```
73+
74+
You can review every event before it's transmitted.
75+
76+
### 3. Batch Transmission
77+
78+
Events are sent in batches every 24 hours or when you run `gitmem telemetry flush`. This gives you time to review before transmission.
79+
80+
### 4. Anonymous Session IDs
81+
82+
Each session gets a random ID (like `7a4f2c91`) that's **not stored** or linked across sessions. We can't correlate activity to individual users.
83+
84+
## Controlling Telemetry
85+
86+
### Enable Telemetry
87+
88+
```bash
89+
$ gitmem telemetry enable
90+
✓ Telemetry enabled
91+
Data logged to: .gitmem/telemetry.log
92+
Review anytime: gitmem telemetry show
93+
Disable anytime: gitmem telemetry disable
94+
```
95+
96+
### Check Status
97+
98+
```bash
99+
$ gitmem telemetry status
100+
Telemetry: Enabled
101+
Session ID: 7a4f2c91 (random, not persistent)
102+
Events logged: 47 (last 24 hours)
103+
Last sent: 2 hours ago
104+
Next batch: in 22 hours
105+
```
106+
107+
### View Pending Events
108+
109+
```bash
110+
$ gitmem telemetry show
111+
Showing last 100 events that will be sent:
112+
113+
[2026-02-20 12:34:56] tool_called: recall (success, 234ms, 3 results)
114+
[2026-02-20 12:35:12] tool_called: confirm_scars (success, 45ms)
115+
[2026-02-20 12:40:33] tool_called: create_learning (success, 123ms)
116+
...
117+
```
118+
119+
### Disable Telemetry
120+
121+
```bash
122+
$ gitmem telemetry disable
123+
✓ Telemetry disabled
124+
Pending events: cleared (not sent)
125+
Local logs: preserved at .gitmem/telemetry.log
126+
```
127+
128+
### Clear Local Logs
129+
130+
```bash
131+
$ gitmem telemetry clear
132+
✓ Cleared all local telemetry logs
133+
(Remote data cannot be deleted — it's already anonymous)
134+
```
135+
136+
## Data Storage & Retention
137+
138+
- **Local logs:** Stored in `.gitmem/telemetry.log`, rotated after 30 days
139+
- **Remote storage:** Plausible Analytics (privacy-first, no cookies, GDPR compliant)
140+
- **Retention:** 90 days aggregate statistics, no raw events stored
141+
- **Location:** EU servers (GDPR compliant)
142+
143+
## Your Rights
144+
145+
✓ **Right to disable:** One command, instant effect
146+
✓ **Right to inspect:** View all data before it's sent
147+
**Right to clarity:** This policy, in plain English
148+
**Right to privacy:** No tracking, no profiling, no ads
149+
150+
## Public Dashboard
151+
152+
We publish aggregate telemetry data publicly:
153+
154+
**https://gitmem.ai/stats**
155+
156+
- Most-used tools
157+
- Error rates by version
158+
- Platform distribution
159+
- Performance percentiles
160+
161+
This transparency helps the community understand product health and priorities.
162+
163+
## Changes to This Policy
164+
165+
If we change what we collect, we'll:
166+
1. Update this document with a new version number
167+
2. Require re-consent before collecting new data types
168+
3. Announce changes in release notes
169+
170+
## Contact
171+
172+
Questions about privacy or telemetry?
173+
- **Email:** privacy@gitmem.ai
174+
- **GitHub:** https://github.com/gitmem-dev/gitmem/issues
175+
176+
---
177+
178+
**Summary:**
179+
- **Opt-in only** — disabled by default
180+
- **Zero PII** — no way to identify users
181+
- **Local-first** — inspect before sending
182+
- **Easy control** — enable/disable in one command
183+
- **Transparent** — public dashboard with aggregate stats

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Add this to your MCP client's config file:
136136
| **Session analytics** | Spot patterns in what keeps going wrong |
137137
| **Sub-agent briefing** | Hand institutional context to sub-agents automatically |
138138
| **Cloud persistence** | Memory survives machine changes, shareable across team |
139-
| **A/B testing** | Optimize scar phrasing based on what actually changes behavior |
139+
| **A/B testing analytics** | Measure which scar phrasings actually change agent behavior (free tier includes `GITMEM_NUDGE_VARIANT` for manual testing) |
140140

141141
The free tier gives you everything for solo projects. Pro makes recall smarter and memory portable.
142142

bin/gitmem.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Other commands:
5151
npx gitmem-mcp check --full Full diagnostic with benchmarks
5252
npx gitmem-mcp install-hooks Install hooks (standalone)
5353
npx gitmem-mcp uninstall-hooks Remove hooks (standalone)
54+
npx gitmem-mcp telemetry status Check telemetry settings
55+
npx gitmem-mcp telemetry enable Enable anonymous usage tracking (opt-in)
56+
npx gitmem-mcp telemetry disable Disable usage tracking
5457
npx gitmem-mcp server Start MCP server (default)
5558
npx gitmem-mcp help Show this help message
5659
@@ -200,6 +203,10 @@ async function cmdInit() {
200203
console.log("Add .gitmem/ to your .gitignore:");
201204
console.log(" echo '.gitmem/' >> .gitignore");
202205
console.log("");
206+
207+
// Prompt for telemetry (optional, non-blocking)
208+
promptTelemetryOptIn();
209+
203210
console.log("To upgrade to Pro tier (semantic search + Supabase persistence):");
204211
console.log(" Set SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY, then run init again.");
205212
return;
@@ -686,6 +693,29 @@ function cmdInstallHooks() {
686693
console.log(" npx gitmem-mcp install-hooks --force");
687694
}
688695

696+
/**
697+
* Prompt user to opt-in to telemetry (non-blocking, async)
698+
*/
699+
function promptTelemetryOptIn() {
700+
console.log("─────────────────────────────────────────────");
701+
console.log("");
702+
console.log("Help improve GitMem? (Optional)");
703+
console.log("");
704+
console.log("Send anonymous usage data to help us understand:");
705+
console.log(" • Which features are most useful");
706+
console.log(" • Where errors occur");
707+
console.log(" • Performance patterns");
708+
console.log("");
709+
console.log("✓ No queries, scars, or project content");
710+
console.log("✓ Randomized ID (not linked to you)");
711+
console.log("✓ View all data before it's sent");
712+
console.log("✓ Disable anytime");
713+
console.log("");
714+
console.log("To enable: npx gitmem-mcp telemetry enable");
715+
console.log("Privacy policy: https://gitmem.ai/privacy");
716+
console.log("");
717+
}
718+
689719
/**
690720
* Uninstall gitmem hooks.
691721
*
@@ -858,6 +888,9 @@ switch (command) {
858888
case "check":
859889
import("../dist/commands/check.js").then((m) => m.main(process.argv.slice(3)));
860890
break;
891+
case "telemetry":
892+
import("../dist/commands/telemetry.js").then((m) => m.main(process.argv.slice(3)));
893+
break;
861894
case "install-hooks":
862895
cmdInstallHooks();
863896
break;

docs/cli-ux-guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ Found 3 relevant scars for your plan: ← chatbot voice
434434
**Do this instead:**
435435

436436
```
437-
((●)) gitmem ── recall · 3 scars · "your plan" ← ripple + red product name
437+
((●)) gitmem ── 3 scars to review · "your plan" ← ripple + implied obligation
438438
← whitespace
439439
[!!] Title (critical, 0.87) ← red text severity
440440
← breathing room

0 commit comments

Comments
 (0)