Context Travel MCP
Enables Claude agents to checkpoint their context state and reset back to saved points with handoff messages, maintaining clean context windows during complex tasks by avoiding fragmented summaries from compactions.
README
Context Travel MCP
An MCP server that gives Claude agents conscious control over their context lifecycle through "time travel"—the ability to checkpoint their mental state and later reset back to it with a message to their future self.
Why?
After multiple compactions, agents become confused by fragmented summaries. The "golden window" is right after orientation when understanding is complete and context is clean. This MCP lets agents:
- Checkpoint that golden state
- Work on complex tasks
- Reset back to the checkpoint with a handoff note
- Continue fresh, with full fidelity
Installation
# Run directly with npx
npx -y github:simen/mcp-memento
# Or install globally
npm install -g github:simen/mcp-memento
Claude Code Configuration
Add to your MCP settings (~/.claude/settings.json or project settings):
{
"mcpServers": {
"memento": {
"command": "npx",
"args": ["-y", "github:simen/mcp-memento"]
}
}
}
Tools
checkpoint_context
Save your current context state as a named checkpoint.
checkpoint_context(name: "oriented", note?: "Understood the auth system")
When to use:
- After fully understanding a codebase or task
- Before starting a large, context-heavy operation
- When you feel sharp and well-oriented
reset_to_checkpoint
Reset context to a checkpoint, injecting a handoff message to your future self.
reset_to_checkpoint(
name: "oriented",
message_to_self: "Bug fixed in auth/refresh.ts:142. Next: implement caching layer."
)
The message_to_self should include:
- What was accomplished since the checkpoint
- Key findings and decisions
- Clear next steps
- Critical details (file paths, variable names, gotchas)
list_checkpoints
Show available checkpoints for the current session.
get_context_stats
Get statistics about your current context window health:
- Turn counts
- Estimated tokens
- Compaction events
- Health indicator
delete_checkpoint
Remove a checkpoint you no longer need.
System Prompt Integration
Add to your agent's system prompt:
## Context Time Travel
You have tools for managing your own context window:
- `checkpoint_context(name)` — Save your current mental state
- `reset_to_checkpoint(name, message_to_self)` — Jump back with a note to yourself
- `list_checkpoints()` — See available restore points
- `get_context_stats()` — Check context health
**Good checkpoint moments:**
- After fully understanding a task or codebase
- Before starting a large exploration or refactor
- When you feel well-oriented and productive
**When to reset:**
- Context feels cluttered with old explorations
- You've completed a major task and want fresh space
- You notice confusion from summarized context
**Writing message_to_self:**
Write as if briefing a colleague taking over. Include what you did, key decisions, and specific next steps.
Session Discovery
The MCP discovers the current session via (in order):
CLAUDE_SESSION_IDenvironment variable~/.claude/debug/latestsymlink- Most recent
.jsonlin the PWD-based project directory
Environment Variables
| Variable | Description |
|---|---|
CLAUDE_SESSION_ID |
Explicit session ID |
CLAUDE_PROJECTS_DIR |
Override projects directory (default: ~/.claude/projects) |
CLAUDE_CHECKPOINTS_DIR |
Override checkpoints directory (default: ~/.claude/checkpoints) |
How It Works
Claude Code stores sessions as JSONL files at ~/.claude/projects/<escaped-cwd>/<session-id>.jsonl. Each line is a JSON object representing a message, tool use, or summary.
Checkpoint = copy the session file Reset = restore the file + append handoff message Handoff = synthetic user message injected after restore
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.