
Claude线程连续性
STDIO自动保存和恢复Claude对话状态
自动保存和恢复Claude对话状态
Never lose context again! This MCP server automatically saves and restores project state when Claude threads hit token limits, ensuring seamless conversation continuity.
# 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. 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 (or clone repo to this location) # Place server.py and requirements.txt here
Edit your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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 continuity tools will now be available automatically.
The server automatically saves project state when:
When starting a new thread:
load_project_state: project_name="your-project"
Command | Description |
---|---|
save_project_state | Manually save current project state |
load_project_state | Restore full project context |
list_active_projects | View all tracked projects |
get_project_summary | Get quick project overview |
auto_save_checkpoint | Triggered automatically during conversations |
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"]
load_project_state: project_name="my-web-app"
list_active_projects
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 includes:
{ "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-07T10:30:00Z" }
python3 --version
cd ~/.mcp-servers/claude-continuity python3 server.py # Should show initialization messages
Permission Errors:
chmod +x ~/.mcp-servers/claude-continuity/server.py
Python Path Issues: Update the config to use full Python path:
{ "command": "/usr/bin/python3", "args": ["~/.mcp-servers/claude-continuity/server.py"] }
python3 test_server.py
claude-thread-continuity/
├── server.py # Main MCP server
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
└── examples/ # Usage examples
Contributions welcome! Please:
MIT License - see LICENSE file for details.
Before: 😫 Hit token limit → Lose all context → Re-explain everything → Lose momentum
After: 😎 Hit token limit → Start new thread → load_project_state
→ Continue seamlessly
Perfect for:
Built with ❤️ for the Claude community
Tired of losing context? This MCP server has your back!