Never lose context again! This MCP server automatically saves and restores project state when Claude threads hit token limits, ensuring seamless conversation continuity.
π Huge thanks to peless for creating the original Claude Thread Continuity server! This fork adds conversation state accumulation capabilities through some casual vibe coding. Instead of overwirting the state overy time you save. I'm definitely not a programmer. Maybe its also possible with the original and im too dumb to get it lmao honestly.
Accumulates context across multiple threads instead of overwriting.
Original behavior:
- Each
save_project_statecompletely overwrote previous data - Lost conversation history when switching threads
Enhanced behavior:
append_listsmode - Intelligently appends to arrays while updating scalar fieldsmergemode - Updates specific fields while preserving othersreplacemode - Original overwrite behavior (still default)- Conversation accumulation - Build up technical decisions, file lists, and context over time
| Mode | Behavior | Best For |
|---|---|---|
append_lists |
Adds new items to existing arrays, updates other fields | Multi-session development projects |
merge |
Updates specific fields while preserving others | Focused updates to project aspects |
replace |
Complete overwrite (original behavior) | Starting fresh or major pivots |
- π Automatic State Persistence - Auto-saves project context during conversations
- β‘ Seamless Restoration - Instantly restore full context when starting new threads
- π‘οΈ Smart Validation - Prevents project fragmentation with intelligent name checking
- π Privacy First - All data stored locally on your machine
- π― Zero Configuration - Works invisibly once set up
- π Smart Triggers - Auto-saves on file changes, decisions, milestones
- ποΈ Multi-Project Support - Manage multiple concurrent projects
# 1. Clone this enhanced fork
git clone https://github.com/[your-username]/claude-thread-continuity-enhanced.git
cd claude-thread-continuity-enhanced
# 2. Install dependencies
pip install -r requirements.txt
# 3. Test the enhanced server
python3 test_server.py
# 4. Add to Claude Desktop config
# See setup instructions below# Create permanent directory
mkdir -p ~/.mcp-servers/claude-continuity
cd ~/.mcp-servers/claude-continuity
# Copy files from this fork
# Place server.py and requirements.txt hereEdit your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"claude-continuity": {
"command": "python3",
"args": ["~/.mcp-servers/claude-continuity/server.py"],
"env": {}
}
}
}Close and reopen Claude Desktop. The enhanced continuity tools will now be available automatically.
The enhanced server now supports three merge strategies:
# Append mode - builds up lists over time (RECOMMENDED for multi-session projects)
save_project_state: project_name="my-app", technical_decisions=["Added Redis caching"], files_modified=["cache.py"], merge_mode="append_lists"
# Merge mode - updates specific fields
save_project_state: project_name="my-app", current_focus="Database optimization", merge_mode="merge"
# Replace mode - original behavior (complete overwrite)
save_project_state: project_name="my-app", current_focus="Starting fresh", merge_mode="replace"Session 1:
save_project_state: project_name="react-dashboard",
current_focus="Setting up project structure",
technical_decisions=["Using Vite", "TypeScript setup"],
files_modified=["package.json", "vite.config.ts"],
merge_mode="append_lists"Session 2 (different thread):
# Load previous context
load_project_state: project_name="react-dashboard"
# Add more without losing previous decisions
save_project_state: project_name="react-dashboard",
technical_decisions=["Added Zustand for state management"],
files_modified=["src/store.ts"],
merge_mode="append_lists"Result: Your project now has accumulated:
technical_decisions:["Using Vite", "TypeScript setup", "Added Zustand for state management"]files_modified:["package.json", "vite.config.ts", "src/store.ts"]
Before saving, the system:
- Checks for Similar Names - Uses fuzzy matching to find existing projects
- Calculates Similarity - Compares project names with 70% threshold
- Provides Recommendations - Suggests consolidation or renaming
- Allows Override - Use
force: truefor edge cases
| Command | Description | Enhancement in Fork |
|---|---|---|
save_project_state |
Save current project state | β¨ Now supports merge_mode parameter |
load_project_state |
Restore full project context | Same as original |
list_active_projects |
View all tracked projects | Same as original |
get_project_summary |
Get quick project overview | Same as original |
validate_project_name |
Check for similar project names | Same as original |
auto_save_checkpoint |
Triggered automatically | Same as original |
# Day 1: Initial setup
save_project_state: project_name="e-commerce-api",
current_focus="Setting up Express server",
technical_decisions=["Node.js with Express", "MongoDB database"],
files_modified=["server.js", "package.json"],
merge_mode="append_lists"
# Day 2: Adding authentication (new thread)
load_project_state: project_name="e-commerce-api"
save_project_state: project_name="e-commerce-api",
current_focus="Implementing JWT authentication",
technical_decisions=["JWT for auth tokens", "bcrypt for password hashing"],
files_modified=["auth/middleware.js", "models/User.js"],
merge_mode="append_lists"
# Day 3: Product management (another new thread)
load_project_state: project_name="e-commerce-api"
save_project_state: project_name="e-commerce-api",
current_focus="Building product CRUD operations",
technical_decisions=["Mongoose for ODM", "Input validation with Joi"],
files_modified=["routes/products.js", "models/Product.js"],
merge_mode="append_lists"Result: Your project now has a complete history of all decisions and files across all sessions!
# Just update the current focus without touching other fields
save_project_state: project_name="my-project",
current_focus="Debugging authentication flow",
merge_mode="merge"save_project_state: project_name="my-web-app-v2",
force=true,
current_focus="Starting version 2"Project states are stored locally at:
~/.claude_states/
βββ project-name-1/
β βββ current_state.json
β βββ backup_*.json
βββ project-name-2/
βββ current_state.json
βββ backup_*.json
Each saved state now includes merge tracking:
{
"project_name": "my-project",
"current_focus": "What you're working on now",
"technical_decisions": ["Accumulated", "decisions", "over", "time"],
"files_modified": ["All", "files", "ever", "touched"],
"next_actions": ["Current planned steps"],
"conversation_summary": "Brief context summary",
"last_updated": "2025-06-15T10:30:00Z",
"version": "1.2",
"merge_mode_used": "append_lists",
"validation_bypassed": false
}- Arrays/Lists: New items are appended to existing lists (duplicates avoided for strings)
- Other Fields: Overwritten with new values
- Best For: Multi-session development where you want to accumulate decisions and files
- All Fields: New data updates/overwrites existing fields
- Missing Fields: Preserved from existing state
- Best For: Focused updates to specific aspects of a project
- All Data: Completely overwrites existing state
- Best For: Starting fresh or major project pivots
Same as original, plus:
Lists getting too long:
Occasionally use replace mode to start fresh, or manually clean up your project state files.
Unexpected merge behavior:
Check the merge_mode_used field in your saved state to see which mode was applied.
Disclaimer: This fork was created through "vibe coding" with Claude's assistance. I'm not a professional programmer - just someone who wanted better conversation continuity! The implementation works for my use case, but there might be edge cases I haven't considered. Use at your own discretion and feel free to improve! π€
- Added
merge_modeparameter tosave_statemethod - Implemented three merge strategies with list deduplication
- Updated tool schema to expose merge mode options
- Enhanced state metadata to track merge behavior
- Maintained backward compatibility with original behavior
- Python 3.8+
- MCP SDK 1.0+
- difflib (built-in, for fuzzy matching)
All credit for the original amazing work goes to peless!
If you want to improve this fork:
- Go fork yourself! Fork this repository
- Make your improvements (probably better than my vibe coding! π)
- Submit a pull request
MIT License - same as the original project.
Original version: π« Hit token limit β Start new thread β Lose conversation context β Re-explain recent decisions
Enhanced version: π Hit token limit β Start new thread β load_project_state β save_project_state with merge_mode="append_lists" β All context accumulates over time!
Perfect for:
- ποΈ Long-term Development Projects - Build up complete history of decisions and files
- π Extended Learning Sessions - Accumulate knowledge and progress over multiple conversations
- βοΈ Iterative Writing Projects - Keep track of all changes and decisions across sessions
- π§ Complex Debugging - Maintain complete context of attempted solutions and findings
- β¨ Multi-Session State Accumulation - Lists build up over time instead of being overwritten
- β¨ Three Merge Strategies -
append_lists,merge, andreplacemodes - β¨ Smart List Management - Automatic deduplication for string arrays
- β¨ Enhanced Metadata - Track which merge mode was used
- π€ Backward Compatible - Original behavior preserved as default
- β¨ Project Validation System - Prevents fragmentation with fuzzy name matching
- β¨ validate_project_name tool - Manual name checking
- β¨ Force Override capability - Bypass validation when needed
- π Initial release with core continuity functionality
Original by peless | Enhanced fork with β€οΈ and vibe coding
Now with true conversation continuity - your project context actually grows over time!