CONTINUITY
Provides session persistence, crash recovery, decision tracking, and context compression for AI assistants, enabling seamless multi-session continuity.
README
CONTINUITY
Session State Persistence for AI Systems
Crashes lose seconds, not hours. Every AI instance picks up exactly where the last one left off.
The Problem
AI assistants are stateless by design. Every session starts fresh. This is fine for one-off questions but catastrophic for multi-session projects where architectural decisions compound and context is everything.
- Sessions crash, hit token limits, or end — and the next one starts blind
- Architectural decisions get re-debated from scratch
- Completed work gets forgotten; hours vanish into reconstruction
- The same problems get solved repeatedly across different codebases
The Solution
8 tools that handle session persistence, crash recovery, decision tracking, and context compression. Plug CONTINUITY into Claude Desktop (or any MCP-compatible client) and session continuity becomes automatic.
It's the difference between a collaborator who remembers your project and one who asks "so what are we working on?" every morning.
Tools
| Tool | Purpose |
|---|---|
continuity_save_session |
Generate structured handoff at session end |
continuity_load_session |
Resume from last session with compressed context |
continuity_checkpoint |
Lightweight state save every 3-5 operations |
continuity_recover_crash |
Detect crash and auto-recover from last checkpoint |
continuity_log_decision |
Record architectural decisions with rationale + alternatives |
continuity_query_decisions |
Search decision history to prevent re-debates |
continuity_compress_context |
Smart context compression (20K tokens → 1K) |
continuity_handoff_quality |
Validate handoff completeness before saving |
Installation
Prerequisites
- Node.js >= 18
- Claude Desktop or any MCP-compatible client
Setup
git clone https://github.com/duke-of-beans/CONTINUITY.git
cd CONTINUITY
npm install --include=dev
npm run build
Configure Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"CONTINUITY": {
"command": "node",
"args": ["/path/to/CONTINUITY/dist/index.js"],
"env": {
"CONTINUITY_DATA_DIR": "/path/to/your/.continuity"
}
}
}
}
Restart Claude Desktop. You'll see 8 new tools available.
Configuration
CONTINUITY_DATA_DIR controls where state is stored. Defaults to ~/.continuity.
.continuity/
├── config.json # Settings (auto-generated with defaults)
├── state.db # SQLite database
├── sessions/ # JSON state snapshots + markdown handoffs
└── decisions/ # JSONL decision log
Usage
Session Lifecycle
Session Start:
→ continuity_recover_crash() # Check for unclean shutdown
→ continuity_load_session() # Load last session context
During Work:
→ continuity_checkpoint() # Every 3-5 tool calls
→ continuity_log_decision() # When architectural choices are made
Session End:
→ continuity_handoff_quality() # Validate completeness
→ continuity_save_session() # Generate handoff for next session
Decision Registry
Stop re-debating the same architectural choices:
continuity_log_decision({
workspace: "my-project",
category: "architectural",
decision: "Use PostgreSQL over Neo4j",
rationale: "Simpler ops, graph extension covers graph needs",
alternatives: ["Neo4j", "DGraph", "ArangoDB"],
impact: "high",
revisit_trigger: "If graph queries exceed 10K nodes/sec"
})
Later, in any new session:
continuity_query_decisions({ keyword: "database", workspace: "my-project" })
// → Returns the decision with full rationale, preventing re-debate
Crash Recovery
continuity_recover_crash({ workspace: "my-project" })
// → Detects unclean shutdown
// → Returns last checkpoint with active files, next steps, recovery context
// → Zero context loss if checkpoints were regular
Architecture
Storage Layer
├── SQLite (state.db) → Checkpoints, session records, fast queries
├── JSONL (decisions.jsonl) → Append-only architectural decision log
└── JSON (sessions/*.json) → Full session state snapshots + markdown handoffs
Tool Modules
├── session-tools.ts → save, load, checkpoint, crash recovery
├── decision-tools.ts → log + query architectural decisions
└── utility-tools.ts → compression, handoff validation
Server
└── mcp-server.ts → MCP SDK wiring, tool registration, error handling
Works With
Compatible with Claude Desktop, Cursor, and any MCP-compatible client. Designed to compose with other MCP servers — any server can trigger checkpoints via the standard tool interface.
License
MIT — Use it, fork it, build on it.
Author
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。