Team collective memory plugin for Claude Code.
Auto-capture tool usage → promote to knowledge cards → share via git.
session-memory is a Claude Code plugin that gives your team a shared knowledge base that grows automatically as you work.
- Individual: Like claude-mem, it records tool usage and injects context into new sessions
- Knowledge: Events get promoted to Cards — reusable lessons with context
- Team: Cards live in git, so
git pushshares knowledge with the entire team
# Install the plugin
/plugin install session-memory
# Or load locally for testing
claude --plugin-dir /path/to/claude-session-memoryThat's it. Zero config. The plugin starts capturing automatically.
You work normally with Claude Code
│
▼
PostToolUse hook captures events (Edit, Write, Bash)
│
├──→ Micro-inject: editing a file? Related cards injected instantly
│
▼
Events accumulate in .claude/memory/events/ (local, gitignored)
│
▼
Patterns detected → Card auto-created (with secret scanning)
│
├──→ Existing card? Evidence appended + importance bumped
│
▼
Cards saved to .claude/memory/cards/ (git committed, team shared)
│
▼
Next session → relevant cards auto-injected (scored by recency/importance/file overlap)
Raw tool usage logs. Stored per-user in JSONL format. Gitignored by default.
Knowledge units with structure: type, importance, files, tags. Markdown with YAML frontmatter. Git committed for team sharing.
Card types (ADR-lite):
| Type | Purpose | Example |
|---|---|---|
decision |
Why we chose this | "PostgreSQL over MongoDB" |
constraint |
Can't change this | "API rate limit 100/min" |
gotcha |
Watch out for this | "req.user can be null" |
runbook |
How to do this | "DB migration steps" |
onboarding |
New member guide | "Dev environment setup" |
Cards are living knowledge. When the same pattern recurs, evidence is automatically appended to the matching card, and its importance is bumped. Cards get stronger over time.
Session summaries stored per-session. Useful for timeline view and onboarding.
| Feature | Description |
|---|---|
| Auto-capture | PostToolUse hooks record Edit/Write/Bash events |
| Smart injection | Multi-signal scoring (git diff + interest + git log) with token budget |
| Micro-injection | Edit a file → related card TL;DR injected instantly |
| Auto-promotion | Patterns trigger card creation (3+ edits, error→fix, high importance) |
| Evidence accumulation | Recurring patterns strengthen existing cards |
| Secret scanning | Cards scanned for API keys, tokens, DB URLs before creation |
| Issue link extraction | Branch names and commit messages → card refs (GH-123, JIRA-456) |
| Onboarding | Role-based card packages for new team members |
| Web viewer | Static HTML dashboard for cards and timeline |
| Skill | Description |
|---|---|
/session-memory:status |
Show memory status and injection preview |
/session-memory:timeline |
Chronological session history |
/session-memory:search |
Search cards (keyword + structured: tag:auth type:gotcha file:src/) |
/session-memory:card |
Manually create a card (--type, --importance) |
/session-memory:prune |
Clean up old events, detect duplicate cards |
/session-memory:onboard |
Role-based onboarding (frontend, backend, devops, etc.) |
/session-memory:viewer |
Generate static HTML viewer for cards and timeline |
.claude/memory/
├── config.json # Project settings (optional)
├── events/ # Local only (gitignored)
│ ├── jay@macbook.jsonl
│ └── .interest.jsonl # File access signals
├── cards/ # Team shared (git committed)
│ └── mem_20260309_a1b2c3.md
├── summaries/ # Session archives (git committed)
│ └── 2026-03-09__abc123.md
└── viewer.html # Generated web viewer (optional)
Create .claude/memory/config.json to customize (all optional):
{
"maxInjectTokens": 2000,
"maxMicroInjectTokens": 200,
"maxDaysToKeep": 30,
"autoPromote": true,
"autoEvidence": true,
"secretScanning": true
}See lib/defaults.json for all available options.
Auto-shared via git: cards/ and summaries/ are committed, events/ are gitignored.
Merge strategy (add to your .gitattributes):
.claude/memory/cards/*.md merge=union
.claude/memory/summaries/*.md merge=union
Pre-commit hook (optional): templates/pre-commit-hook.sh scans cards for secrets before commit.
bash + jq. That's it. No Node.js, no Python, no database.
| claude-mem | session-memory | |
|---|---|---|
| Individual memory | Yes | Yes |
| Team sharing | No (local SQLite) | Yes (git) |
| Knowledge cards | No (events only) | Yes (ADR-lite) |
| Evidence accumulation | No | Yes |
| Micro-injection | No | Yes |
| Secret scanning | No | Yes |
| Token budget control | No | Yes |
| Issue link extraction | No | Yes |
| Web viewer | Yes (port 37777) | Yes (static HTML) |
| Role-based onboarding | No | Yes |
| Dependencies | Bun, Chroma, SQLite | bash, jq |
| Daemon process | Yes (port 37777) | No |
| License | AGPL-3.0 | MIT |
MIT