Getting Started

External context management for Claude Code. Never lose knowledge between sessions.

What is ContextVault?

ContextVault is a two-tier documentation system that helps AI coding assistants (like Claude Code) remember context across sessions. Instead of losing everything when a conversation ends, ContextVault persists your knowledge in organized markdown files.

Why ContextVault?

AI assistants start fresh every session. ContextVault solves this by creating a persistent knowledge base that Claude reads at session start, giving it full context of your project.

Key Features

Installation

Choose Your Installation Method

MCP Server (recommended) — works with any AI tool: Cursor, Windsurf, Cline, OpenCode, Continue, Copilot CLI, Claude Code.
Native Installer — optimized for Claude Code with hooks and slash commands.
Both use the same vault format and can run side by side with zero conflicts.

MCP Server (Any AI Tool)

Use ContextVault with any MCP-compatible AI tool:

npx contextvault-mcp

Then add to your AI tool's MCP configuration:

Cursor / Windsurf / Cline

Add to your .cursor/mcp.json, .windsurf/mcp.json, or Cline MCP settings:

{
  "mcpServers": {
    "contextvault": {
      "command": "npx",
      "args": ["-y", "contextvault-mcp"]
    }
  }
}

Claude Code

Add via CLI:

claude mcp add contextvault -- npx -y contextvault-mcp

Or add to ~/.claude.json:

{
  "mcpServers": {
    "contextvault": {
      "command": "npx",
      "args": ["-y", "contextvault-mcp"]
    }
  }
}
What the MCP Server Provides

25 tools (ctx_doc, ctx_error, ctx_decision, ctx_search, ctx_read, and 20 more) plus 4 auto-loaded resources (global index, project index, settings, documentation rules). Works as a stdio MCP server — no API keys, no cloud, 100% local.

Native Installer (Claude Code)

For Claude Code with hooks, slash commands, and deep integration:

macOS & Linux

curl -sL https://ctx-vault.com/install | bash

Windows

Native PowerShell installation (run as Administrator):

irm https://ctx-vault.com/install.ps1 | iex
Windows Note

For full hook support on Windows, install Git for Windows which includes Git Bash. The installer will auto-detect it.

What Gets Installed

Component MCP Server Native Installer
25 Commands/Tools MCP tools (ctx_*) Slash commands (/ctx-*)
Global Vault ~/.contextvault/ ~/.claude/vault/
Project Vault ./.contextvault/ ./.claude/vault/
Auto-Context 4 MCP resources CLAUDE.md + hooks
Enforcement Server-side Bash hooks

Quick Start

1. Initialize a Project

Navigate to your project and initialize ContextVault:

# Slash command (Claude Code):
/ctx-init

# MCP tool (Cursor, Windsurf, etc.):
# Just ask: "initialize contextvault" or call ctx_init

This creates a vault directory in your project with an index.md file.

2. Start Documenting

As you work, use commands to capture knowledge:

# Fixed a bug?
/ctx-error          # or MCP: ctx_error

# Made an architecture decision?
/ctx-decision       # or MCP: ctx_decision

# Learned something useful?
/ctx-doc            # or MCP: ctx_doc

# Ending your session?
/ctx-handoff        # or MCP: ctx_handoff

3. Auto-Document a Codebase

For new projects, let ContextVault scan and document automatically:

/ctx-bootstrap      # or MCP: ctx_bootstrap

This creates architecture docs and feature docs based on your codebase structure.

4. Continue in Future Sessions

Your AI tool automatically reads your vault indexes and has full context of your project. With MCP, indexes are loaded as resources. With native, Claude reads the index files via CLAUDE.md instructions.

Pro Tip

Use /ctx-status anytime to see your vault's current state — how many docs, which mode, etc.

Next Steps