Context vault extension for Claude Code — archive, retrieve, and manage conversation context
Project description
claude-context-vault
Context vault extension for Claude Code. Prevents context loss during compaction by archiving conversation context to a local vault with layered retrieval.
The Problem
Claude Code builds context as you work. When context gets too large, it compacts — and important details can be lost. You lose track of earlier decisions, code changes, and discussions.
The Solution
claude-context-vault archives old conversation context to a local vault before it gets
compacted. When you need that old context back, Claude retrieves just the relevant
parts — summaries for quick answers, full chunks for deep dives.
Install
pip install claude-context-vault
claude-context-vault install
That's it. The install command registers the MCP server with Claude Code. The vault
directory is created automatically per-project at <project>/.claude/context-vault/.
Architecture
Note: PyPI doesn't render Mermaid diagrams. View the full architecture diagram on GitHub.
graph TD
A[Claude Code Session] -->|grows over time| B{Context Health}
B -->|Green| A
B -->|Yellow / Red| C[archive_context]
C --> D[MCP Server<br>local Python process]
D --> E[project/.claude/context-vault/]
E --> G[chunks/<br>chunk_001.json<br>chunk_002.json]
E --> H[summaries/<br>chunk_001.txt<br>chunk_002.txt]
E --> I[manifest.json]
A -->|"What did we discuss about X?"| J[retrieve_context]
J --> D
D -->|search by keywords| E
E -->|summaries + full chunks| A
style A fill:#4a9eff,color:#fff
style D fill:#ff9f43,color:#fff
style E fill:#2ecc71,color:#fff
How It Works
Once installed, Claude Code gains 6 new tools:
| Tool | What it does |
|---|---|
check_context_health |
Estimates context size, reports green/yellow/red status |
archive_context |
Stores conversation context in the vault with a summary |
retrieve_context |
Searches archived context by keywords |
list_archived |
Shows all archived chunks for the current project |
get_chunk |
Pulls full content of a specific archived chunk |
delete_chunk |
Removes an archived chunk |
Usage
Context archiving is currently manual — you trigger it by asking Claude. Automatic archiving via hooks is planned for v2.
Recommended Workflow
-
Check health periodically — Ask Claude: "Check my context health"
- Green: no action needed
- Yellow: consider archiving older context
- Red: archive now before compaction loses details
-
Archive before compaction — Ask Claude: "Archive the older context"
- Claude calls
archive_contextto store a summary + full chunk in the vault
- Claude calls
-
Retrieve after compaction — Ask Claude: "What did we discuss about authentication?"
- Claude calls
retrieve_contextto search the vault by keywords - If the summary isn't enough,
get_chunkpulls the full original
- Claude calls
Quick Commands
| Say this to Claude | What happens |
|---|---|
| "Check context health" | Calls check_context_health — reports size and status |
| "Archive the old context" | Calls archive_context — stores context in the vault |
| "What did we discuss about X?" | Calls retrieve_context — searches vault by keywords |
| "Show me all archived context" | Calls list_archived — lists all chunks |
| "Get the full details of chunk_001" | Calls get_chunk — retrieves full original content |
| "Delete chunk_001" | Calls delete_chunk — removes from vault |
Vault Location
All archived context is stored locally at <project>/.claude/context-vault/, inside
each project's own .claude directory. Nothing is sent to any server.
Uninstall
claude-context-vault uninstall
pip uninstall claude-context-vault
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_context_vault-0.3.0.tar.gz.
File metadata
- Download URL: claude_context_vault-0.3.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f800bf72675e6f8806c902ca840a3507f758704c2d313869aee4ddde95127bd2
|
|
| MD5 |
f1bac6db046a7907034e1fd94e1e82c6
|
|
| BLAKE2b-256 |
b4542061066d666e04451df045a9f8f35ebd2167b9ae7522a4832a6fc4dbf23d
|
File details
Details for the file claude_context_vault-0.3.0-py3-none-any.whl.
File metadata
- Download URL: claude_context_vault-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57525138d78197f17d7bfd1c929288d2044c82c36a8a4d1d375359ccef939561
|
|
| MD5 |
6d12fb44b0c60fc038c418ec700a741c
|
|
| BLAKE2b-256 |
9686fe82b46782aef82a10678138b728bca6ed80befdc20f30fd3b53ba437a55
|