CodeContext
Semantic memory system for Claude Code sessions. Captures learnings, stores them with vector embeddings, and provides retrieval via semantic similarity search.
Features
- Automatic Memory Capture: Hooks capture learnings from coding sessions
- Semantic Search: Find relevant past experiences using natural language
- Project Summaries: AI-generated summaries injected into new sessions
- Conflict Detection: Identifies contradictory or outdated memories
- Memory Consolidation: Merges related memories to reduce redundancy
Quick Start
Installation
# Install the package
pip install claude-codecontext
# Initialize for all projects (global)
codecontext init --global
# Or initialize for current project only
codecontext init --project
Interactive Setup
codecontext init
This will prompt you to choose between:
- Global - Active for ALL projects (~/.claude/)
- Project - Active only for THIS project (./.claude/)
Basic Usage
# Search your memories
codecontext query "authentication flow"
# Add a new memory
codecontext add --type bugfix --title "Fixed timezone" --fact "Use make_naive=True"
# Quick note (auto-classifies)
codecontext note "Always use utcnow() for storage"
# View project summary
codecontext summary
# List known gotchas
codecontext gotchas
# Check server health
codecontext health
Installation Modes
| Mode | Hooks Location | Data Location | Use Case |
|---|---|---|---|
| Global | ~/.claude/hooks/codecontext/ |
~/.codecontext/ |
Single user, all projects |
| Project | ./.claude/hooks/codecontext/ |
./.codecontext/ |
Per-project isolation |
Commands
| Command | Description |
|---|---|
init |
Set up hooks and skills |
uninstall |
Remove hooks (preserves data by default) |
server |
Start the CodeContext server |
query <text> |
Semantic search |
add |
Add a memory with type, title, fact |
note <text> |
Quick capture with auto-classification |
resolve <desc> |
Mark a priority as completed |
files <path> |
Find memories by file |
summary |
View project summary |
summary-generate |
Generate/regenerate summary |
recent |
Show recent memories |
gotchas |
List known pitfalls |
stats |
Project statistics |
projects |
List all projects |
health |
Server health check |
Memory Types
| Type | Description |
|---|---|
bugfix |
Bug fixes and solutions |
feature |
New functionality |
discovery |
How things work |
decision |
Architecture choices |
refactor |
Code restructuring |
optimization |
Performance improvements |
gotcha |
Pitfalls to avoid |
resolution |
Completed priorities |
Server
The CodeContext server runs locally and provides:
- REST API for memory operations
- Web UI for browsing memories
- Background tasks for consolidation
# Start server manually
codecontext server
# With custom port
codecontext server --port 9000
# Development mode with auto-reload
codecontext server --reload
The server starts automatically when hooks fire or CLI commands run.
Architecture
~/.codecontext/
├── projects/
│ └── {encoded-project-path}/
│ ├── vector_db/ # LanceDB storage
│ ├── summary.json # Current summary
│ └── sessions/ # Session logs
├── config.json # Server config
└── .codecontext_mode # Installation marker
Uninstalling
# Remove hooks, keep your data
codecontext uninstall --global
# Remove everything including memories
codecontext uninstall --global --remove-data
Development
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# With GPU support
pip install -e ".[full]"
Requirements
- Python 3.10+
- Claude Code CLI (for hooks)
- ~200MB disk space (FastEmbed model)
Windows
On Windows, you need the Visual C++ Redistributable for the embedding model to work:
Download and install: https://aka.ms/vs/17/release/vc_redist.x64.exe
This is required because the onnxruntime library (used for embeddings) depends on the Visual C++ Runtime.
License
MIT License - see LICENSE
Metadata
Release files for claude-codecontext 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| claude_codecontext-0.1.10.tar.gz | 167.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claude_codecontext-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 379.9 kB
Release files / claude_codecontext-0.1.10.tar.gz
| Download URL | claude_codecontext-0.1.10.tar.gz |
|---|---|
| Size | 167.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60f80a844935dd08947456088ae660e5f169d35ade542855fd7d6dcab4489ef3
|
|
BLAKE2b-256 checksum How to use checksums |
ebf48551bdb371497b0791e1f5c2e44d2d39ed80f086fa7d6d4bfefc2136b36e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / claude_codecontext-0.1.10-py3-none-any.whl
| Download URL | claude_codecontext-0.1.10-py3-none-any.whl |
|---|---|
| Size | 212.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fef7cf6fbd1df57f851087548d050a4da4887e996f4f5ee265f3753a5c78b7a
|
|
BLAKE2b-256 checksum How to use checksums |
fb1f51b598b9d945af139d0b70cd68fe3d831d11219d1ac2fb4c040c891cc395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|