Lesson 10: Performance, Cost, and Privacy Compliance
10.1 Token Cost Estimation
Utilizing memory systems incurs additional token overhead. Here are the estimated increments:
| System | Startup Overhead | Runtime Overhead | Daily Token Increase (Est.) |
|---|---|---|---|
| auto memory | ~5-25 KB | Nearly 0 | ~25 KB |
| claude-mem | ~10-50 KB | "Distillation" cost post-tool call | ~100-500 KB |
Cost Estimate: Using claude-mem during active development typically adds approximately $0.05 - $0.30 to daily API costs (based on Claude 3.5 Sonnet).
10.2 Latency and Disk Usage
- Interaction Latency: claude-mem runs Hooks after every tool call, which can slow down operations by about 50-200ms. For batch script scenarios, using the
--bareflag is recommended to improve speed. - Disk Growth:
- auto memory: Extremely slow growth, limited by the 25KB index constraint.
- claude-mem: SQLite grows by ~10MB per 1,000 records; Chroma vector DB grows by ~20-50MB.
10.3 Privacy and Security Risks
| Risk Point | auto memory | claude-mem |
|---|---|---|
| Code Upload Risk | Extremely Low (records key conclusions only) | Medium (distills nearly every tool interaction via remote LLM) |
| Secret Leakage Risk | Low (structured notes, human-auditable) | Medium (auto-captured, might distill sensitive info into Observations) |
| Cross-Project Leak | No (isolated by working directory) | Yes (shared globally; searches may retrieve info from other projects) |
10.4 Security Recommendations for Sensitive Projects
For projects with strict privacy requirements:
- Disable Plugins: Add
claude-mem@thedotmacktodisabledPluginsin the project's.claude/settings.local.json. - Offline Mode: Use
claude --barefor tasks; this skips all Hooks, LSP, and memory systems. - Regular Audits:
- Check
~/.claude/projects/*/memory/for plaintext keys. - Audit the
summaryfield inclaude-mem.dbvia SQL:sqlite3 ~/.claude-mem/claude-mem.db "SELECT summary FROM observations" | grep -E 'sk-|pk_'
- Check