Your persistent memory layer for Claude.
Every conversation with Claude starts fresh. Context Vault fixes that. Save decisions, patterns, and knowledge into searchable scopes that persist across sessions and projects.
- You explain the same project context repeatedly
- Decisions made in past conversations are forgotten
- "Maintain a docs file" is manual friction
- Switching between projects means rebuilding context
Context Vault is an MCP server that gives Claude persistent memory:
- Save naturally - "Remember this pattern for later"
- Organize by scope - Per-project, per-topic, or personal knowledge
- Search everything - Full-text search across all your saved context
- Load on demand - Start a new chat, load your scope, continue where you left off
- Works everywhere - Any MCP client (Claude Code, Claude Desktop, custom agents)
git clone https://github.com/Dunya-8a/ClaudeContextVault.git
cd ClaudeContextVault
bun install && bun run buildAdd .mcp.json to your project (already included), restart Claude Code.
"Remember that we're using JWT for auth, not sessions"
"Save this API pattern to my project scope"
"Add this error handling snippet for later"
"Search my project for authentication decisions"
"What patterns have I saved about error handling?"
"Load my Backend API scope"
"What do you know about this project?"
"Search all my scopes for database patterns"
"Import my TypeScript patterns into this project"
Project Memory Save architectural decisions, API designs, and rationale. When you return to a project months later, the context is there.
Personal Patterns Library Build a collection of your preferred approaches: error handling, testing patterns, code styles. Use across all projects.
Learning & Research Save insights, code examples, and links as you learn. Search and resurface them when relevant.
Team Knowledge (via bundles)
Export scopes as .vault bundles. Share with teammates or transfer between machines.
| Tool | Description |
|---|---|
list_scopes |
List all scopes with item counts |
create_scope |
Create a new scope |
get_scope |
Get scope with items (paginated) |
update_scope |
Update scope name, description, or tags |
delete_scope |
Delete scope and all items |
add_item |
Add note/snippet/link/file |
update_item |
Update item title, content, tags, etc. |
delete_item |
Delete an item |
search_scope |
Full-text search within a scope |
search_all |
Full-text search across all scopes |
summarize_scope |
Get content for summarization |
export_scope |
Export as .vault bundle |
import_scope |
Import from .vault bundle |
- note - Free-form markdown (decisions, documentation, ideas)
- snippet - Code with optional language metadata
- link - URLs with descriptions
- file - Local file contents
Content supports full markdown with no size limit.
Environment variables (set in .mcp.json):
| Variable | Default | Description |
|---|---|---|
VAULT_DIRECTORY |
OS-appropriate app data folder | Data storage location |
LOG_LEVEL |
info |
Logging level (debug, info, warn, error) |
┌─────────────────────────────────────────────────────────┐
│ Claude Code / Desktop │
│ (MCP Client) │
└─────────────────────────┬───────────────────────────────┘
│ stdio
┌─────────────────────────▼───────────────────────────────┐
│ Context Vault Server │
│ (MCP Server, Node.js) │
├─────────────────────────────────────────────────────────┤
│ Tools (13) │ Services │
│ - list_scopes │ - ScopeService │
│ - create_scope │ - ItemService │
│ - add_item │ - SearchService │
│ - search_all │ - BundleService │
│ - export_scope │ │
│ - ... │ │
├─────────────────────────────────────────────────────────┤
│ SQLite + FTS5 │
│ (Full-text search, BM25 ranking) │
└─────────────────────────────────────────────────────────┘
Stack:
- Runtime: Node.js 20+
- Language: TypeScript
- Database: SQLite via better-sqlite3
- Search: FTS5 with BM25 ranking
- Protocol: MCP (Model Context Protocol)
- Validation: Zod schemas
All data is stored locally:
- Database:
$VAULT_DIRECTORY/vault.db(SQLite with FTS5) - Bundles:
$VAULT_DIRECTORY/bundles/(gzip-compressed JSON)
bun run build # Build
bun run test # Run 40 tests
bun run typecheck # Type checkContext Vault includes instructions (.claude/CLAUDE.md) that enable natural saving:
"Remember that we're using PostgreSQL for this project"
"Save this error handling pattern for later"
"Keep this API design decision"
Claude will automatically detect save intent and use the vault. It will also proactively suggest saving important decisions.
For explicit hook-based detection, see hooks/remember-this.md.
- "Remember this" auto-detection
- MCP Resources for automatic context loading
- Browser extension for saving web content
- Semantic search with embeddings
MIT