contextkeeper
io.github.TheRealDataBoss/contextkeeper
Documentation
contextkeeper
Zero model drift between AI agents.
Install
pip install contextkeeper
Quickstart
contextkeeper init
contextkeeper sync --agent claude
contextkeeper bootstrap --clipboard
# paste into any AI — full context restored
CLI Reference
| Command | Description |
|---|---|
init | Scaffold project context — state vector, conventions, tasks |
sync | Scan repo and update state vector with current project state |
bootstrap | Generate paste-ready briefing for any AI agent |
status | Show tracked projects and their current state |
doctor | Validate context files for consistency and missing fields |
migrate | Run database schema migrations |
export | Export project context to JSON/Markdown |
diff | Show what changed since last sync |
serve | Start the REST API server (FastAPI + Uvicorn) |
sessions | List and manage agent sessions |
tasks | List and manage project tasks |
decisions | List and manage architectural decisions |
auth | Create and revoke API keys (ck_ prefix, SHA-256 stored) |
Python SDK
from contextkeeper import ContextKeeperClient
client = ContextKeeperClient()
# Sessions
session = client.create_session(agent="claude", project="myproject")
client.end_session(session.id, summary="Implemented auth module")
# Tasks & decisions
client.create_task(project="myproject", title="Add rate limiting")
client.create_decision(project="myproject", title="Use PostgreSQL", rationale="Need JSONB")
# Handoff
handoff = client.create_handoff(from_session=s1.id, to_agent="gpt-4")
MCP Server
10 tools — native Claude Code integration via Model Context Protocol.
Add to claude_desktop_config.json:
{
"mcpServers": {
"contextkeeper": {
"command": "python",
"args": ["-m", "contextkeeper.mcp"]
}
}
}
Backends
# File (default) — zero config
contextkeeper init
# SQLite
contextkeeper init --backend sqlite
# PostgreSQL
contextkeeper init --backend postgres --db-url postgresql://user:pass@localhost/ck
REST API
14 endpoints + 3 auth endpoints. FastAPI with OpenAPI spec.
contextkeeper serve --port 8420
# → http://localhost:8420/docs (Swagger UI)
# → http://localhost:8420/openapi.json
Auth header: Authorization: Bearer ck_your_api_key
Multi-Agent Coordination
Three modes for concurrent agent access:
- sequential — one agent at a time (default)
- lock-based — pessimistic locking per resource
- merge — optimistic merge with conflict resolution
Links
License
MIT © TheRealDataBoss
