trackmcp
Back to directory
peless

claude-thread-continuity

View on GitHub

๐Ÿง  Keep your Claude conversations flowing! An MCP server that automatically saves and restores project context when threads hit token limits.

57 stars PythonAI & Machine Learning Updated Oct 15, 2025

Documentation

๐Ÿง  Claude Thread Continuity MCP Server

Never lose context again! This MCP server automatically saves and restores project state when Claude threads hit token limits, ensuring seamless conversation continuity.

๐Ÿš€ Features

  • ๐Ÿ”„ 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

โœจ NEW: Anti-Fragmentation System

Version 1.1 introduces intelligent project validation to prevent the common issue of accidentally creating multiple similar projects:

  • ๐Ÿ” Fuzzy Name Matching - Detects similar project names (70% similarity threshold)
  • โš ๏ธ Validation Warnings - Suggests consolidation when similar projects exist
  • ๐Ÿ’ช Force Override - Bypass validation when genuinely different projects needed
  • ๐ŸŽฏ Configurable Thresholds - Adjust sensitivity for your workflow

Example Validation in Action

code
โŒ Project "Hebrew Speaking Evaluation MVP" blocked
โœ… Similar project found: "Hebrew Evaluation MVP" (85% similar)
๐ŸŽฏ Recommendation: Update existing project or use force=true

โšก Quick Start

bash
# 1. Clone the repository
git clone https://github.com/peless/claude-thread-continuity.git
cd claude-thread-continuity

# 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

๐Ÿ› ๏ธ Installation

1. Install the MCP Server

bash
# Create permanent directory
mkdir -p ~/.mcp-servers/claude-continuity
cd ~/.mcp-servers/claude-continuity

# Copy files (or clone repo to this location)
# Place server.py and requirements.txt here

2. Configure Claude Desktop

Edit 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:

json
{
  "mcpServers": {
    "claude-continuity": {
      "command": "python3",
      "args": ["~/.mcp-servers/claude-continuity/server.py"],
      "env": {}
    }
  }
}

3. Restart Claude Desktop

Close and reopen Claude Desktop. The continuity tools will now be available automatically.

๐ŸŽฏ How It Works

Automatic Context Saving

The server automatically saves project state when:

  • โœ… Files are created or modified
  • โœ… Technical decisions are made
  • โœ… Project milestones are reached
  • โœ… Every 10 messages (fallback)

Smart Validation Process

Before saving, the system:

1. Checks for Similar Names - Uses fuzzy matching to find existing projects

2. Calculates Similarity - Compares project names with 70% threshold

3. Provides Recommendations - Suggests consolidation or renaming

4. Allows Override - Use `force: true` for edge cases

Context Restoration

When starting a new thread:

1. Load Project: `load_project_state: project_name="your-project"`

2. Full Context Restored: All technical decisions, files, and progress restored

3. Continue Seamlessly: Pick up exactly where you left off

๐Ÿ”ง Available Commands

CommandDescriptionNEW in v1.1
`save_project_state`Save current project stateโœจ Now with validation
`load_project_state`Restore full project context
`list_active_projects`View all tracked projects
`get_project_summary`Get quick project overview
`validate_project_name`Check for similar project namesโœจ NEW
`auto_save_checkpoint`Triggered automatically

๐Ÿ’ก Usage Examples

Starting a New Project (with Validation)

code
save_project_state: project_name="my-web-app", current_focus="Setting up React components", technical_decisions=["Using TypeScript", "Vite for bundling"], next_actions=["Create header component", "Set up routing"]

Checking Name Before Creating

code
validate_project_name: project_name="my-webapp", similarity_threshold=0.7

Force Override When Needed

code
save_project_state: project_name="my-web-app-v2", force=true, current_focus="Starting version 2"

Continuing After Token Limit

code
load_project_state: project_name="my-web-app"

Viewing All Projects

code
list_active_projects

๐Ÿ—‚๏ธ Data Storage

Project states are stored locally at:

code
~/.claude_states/
โ”œโ”€โ”€ project-name-1/
โ”‚   โ”œโ”€โ”€ current_state.json
โ”‚   โ””โ”€โ”€ backup_*.json
โ””โ”€โ”€ project-name-2/
    โ”œโ”€โ”€ current_state.json
    โ””โ”€โ”€ backup_*.json
  • Privacy: Everything stays on your machine
  • Backups: Automatic backup rotation (keeps last 5)
  • Format: Human-readable JSON files
  • Validation: Metadata tracks validation bypass status

๐Ÿ—๏ธ Project State Structure

Each saved state includes:

json
{
  "project_name": "my-project",
  "current_focus": "What you're working on now",
  "technical_decisions": ["Key choices made"],
  "files_modified": ["List of files created/changed"],
  "next_actions": ["Planned next steps"],
  "conversation_summary": "Brief context summary",
  "last_updated": "2025-06-15T10:30:00Z",
  "version": "1.1",
  "validation_bypassed": false
}

๐Ÿ›ก๏ธ Validation Configuration

Default Settings

  • Similarity Threshold: 70% (0.7)
  • Comparison Method: Fuzzy string matching
  • Auto-save Behavior: Bypasses validation (uses `force=true`)

Customizing Validation

code
validate_project_name: project_name="test-project", similarity_threshold=0.8

Higher threshold = stricter matching (0.9 = 90% similar required)

Lower threshold = looser matching (0.5 = 50% similar triggers warning)

๐Ÿ” Troubleshooting

Tools Not Appearing

1. Check Claude Desktop logs

2. Verify Python 3 is in your PATH: `python3 --version`

3. Validate JSON config syntax

4. Restart Claude Desktop completely

Testing the Enhanced Server

bash
cd ~/.mcp-servers/claude-continuity
python3 test_server.py

The test suite now includes validation testing and will report:

  • โœ… Basic functionality tests
  • โœ… Project validation tests
  • โœ… Fuzzy matching accuracy
  • โœ… Force override functionality

Common Issues

Validation Too Strict:

Lower the similarity threshold or use `force=true`

Permission Errors:

bash
chmod +x ~/.mcp-servers/claude-continuity/server.py

Python Path Issues:

Update the config to use full Python path:

json
{
  "command": "/usr/bin/python3",
  "args": ["~/.mcp-servers/claude-continuity/server.py"]
}

๐Ÿงช Development

Requirements

  • Python 3.8+
  • MCP SDK 1.0+
  • difflib (built-in, for fuzzy matching)

Running Tests

bash
python3 test_server.py

Enhanced test suite includes:

  • Basic functionality validation
  • NEW: Project name similarity testing
  • NEW: Validation workflow testing
  • NEW: Force override testing
  • NEW: MCP tool validation

Project Structure

code
claude-thread-continuity/
โ”œโ”€โ”€ server.py           # Main MCP server (enhanced with validation)
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ”œโ”€โ”€ test_server.py     # Comprehensive test suite
โ”œโ”€โ”€ README.md          # This file
โ”œโ”€โ”€ LICENSE            # MIT License
โ””โ”€โ”€ examples/          # Usage examples

๐Ÿค Contributing

Contributions welcome! Please:

1. Fork the repository

2. Create a feature branch

3. Add tests for new functionality

4. Submit a pull request

Current Development Priorities

  • [ ] Integration with external project management tools
  • [ ] Advanced similarity algorithms
  • [ ] Project merging utilities
  • [ ] Custom validation rules

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿš€ Why This Matters

Before v1.1: ๐Ÿ˜ซ Hit token limit โ†’ Lose all context โ†’ Re-explain everything โ†’ Lose momentum

Common Problem: ๐Ÿ˜ค Create "Hebrew MVP", then "Hebrew Evaluation MVP", then "Hebrew Speaking MVP" โ†’ Context scattered across multiple projects

After v1.1: ๐Ÿ˜Ž Hit token limit โ†’ Start new thread โ†’ `load_project_state` โ†’ Continue seamlessly + Smart validation prevents fragmentation

Perfect for:

  • ๐Ÿ—๏ธ Complex Development Projects - Keep track of architecture decisions without fragmentation
  • ๐Ÿ“š Learning & Research - Maintain context across study sessions with consistent naming
  • โœ๏ธ Writing Projects - Remember plot points without creating duplicate character projects
  • ๐Ÿ”ง Multi-session Debugging - Preserve debugging state with clear project organization

๐Ÿ“ˆ Version History

v1.1.0 (Current)

  • โœจ Project Validation System - Prevents fragmentation with fuzzy name matching
  • โœจ validate_project_name tool - Manual name checking
  • โœจ Force Override capability - Bypass validation when needed
  • โœจ Enhanced Testing - Comprehensive validation test suite
  • ๐Ÿ› Bug Fixes - Improved error handling and edge cases

v1.0.0

  • ๐Ÿš€ Initial release with core continuity functionality

Built with โค๏ธ for the Claude community

*Tired of fragmented projects? Version 1.1 keeps your context organized!*

Frequently asked questions

What is claude-thread-continuity?

claude-thread-continuity is ๐Ÿง  Keep your Claude conversations flowing! An MCP server that automatically saves and restores project context when threads hit token limits.

How do I install claude-thread-continuity?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is claude-thread-continuity open source?

Yes โ€” it is hosted on GitHub at https://github.com/peless/claude-thread-continuity and has 57 stars.

Related MCP tools

All-Hands-AIopenhands

๐Ÿ™Œ OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.

64,677 Python
agentartificial-intelligencechatgpt+6
mem0aimem0

Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.

42,646 Python
agentsaiai-agents+12
zhayujiechatgpt-on-wechat

ๅŸบไบŽๅคงๆจกๅž‹ๆญๅปบ็š„่Šๅคฉๆœบๅ™จไบบ๏ผŒๅŒๆ—ถๆ”ฏๆŒ ๅพฎไฟกๅ…ฌไผ—ๅทใ€ไผไธšๅพฎไฟกๅบ”็”จใ€้ฃžไนฆใ€้’‰้’‰ ็ญ‰ๆŽฅๅ…ฅ๏ผŒๅฏ้€‰ๆ‹ฉChatGPT/Claude/DeepSeek/ๆ–‡ๅฟƒไธ€่จ€/่ฎฏ้ฃžๆ˜Ÿ็ซ/้€šไน‰ๅƒ้—ฎ/ Gemini/GLM-4/Kimi/LinkAI๏ผŒ่ƒฝๅค„็†ๆ–‡ๆœฌใ€่ฏญ้Ÿณๅ’Œๅ›พ็‰‡๏ผŒ่ฎฟ้—ฎๆ“ไฝœ็ณป็ปŸๅ’Œไบ’่”็ฝ‘๏ผŒๆ”ฏๆŒๅŸบไบŽ่‡ชๆœ‰็Ÿฅ่ฏ†ๅบ“่ฟ›่กŒๅฎšๅˆถไผไธšๆ™บ่ƒฝๅฎขๆœใ€‚

39,573 Python
aiai-agentchatgpt+17
assafelovicgpt-researcher

An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to

24,026 Python
agentaiautomation+8
jlowinfastmcp

๐Ÿš€ The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.

19,927 Python
agentsfastmcpllms+6
1Panel-devmaxkb

๐Ÿ”ฅ MaxKB is an open-source platform for building enterprise-grade agents. MaxKB ๆ˜ฏๅผบๅคงๆ˜“็”จ็š„ๅผ€ๆบไผไธš็บงๆ™บ่ƒฝไฝ“ๅนณๅฐใ€‚ for the Model Context Protocol. Enhance AI assistants with po

19,062 Python
agentagentic-aichatbot+11

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP