Skip to main content

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

  1. 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
  2. Archive before compaction — Ask Claude: "Archive the older context"

    • Claude calls archive_context to store a summary + full chunk in the vault
  3. Retrieve after compaction — Ask Claude: "What did we discuss about authentication?"

    • Claude calls retrieve_context to search the vault by keywords
    • If the summary isn't enough, get_chunk pulls the full original

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_context_vault-0.3.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_context_vault-0.3.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

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

Hashes for claude_context_vault-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f800bf72675e6f8806c902ca840a3507f758704c2d313869aee4ddde95127bd2
MD5 f1bac6db046a7907034e1fd94e1e82c6
BLAKE2b-256 b4542061066d666e04451df045a9f8f35ebd2167b9ae7522a4832a6fc4dbf23d

See more details on using hashes here.

File details

Details for the file claude_context_vault-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_context_vault-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57525138d78197f17d7bfd1c929288d2044c82c36a8a4d1d375359ccef939561
MD5 6d12fb44b0c60fc038c418ec700a741c
BLAKE2b-256 9686fe82b46782aef82a10678138b728bca6ed80befdc20f30fd3b53ba437a55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page