Skip to main content
Glama

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:

  1. Checkpoint that golden state

  2. Work on complex tasks

  3. Reset back to the checkpoint with a handoff note

  4. Continue fresh, with full fidelity

Related MCP server: genpark-agent-execution-tree-rollback-checkpointer-skill

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

  1. CLAUDE_SESSION_ID environment variable

  2. ~/.claude/debug/latest symlink

  3. Most recent .jsonl in 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

Available Tools

5 tools
checkpoint_contextA

Save your current context state as a named checkpoint. Use this when you're well-oriented and want to be able to return to this mental state later.

Good moments to checkpoint:

  • After fully understanding a codebase or task

  • Before starting a large, context-heavy operation

  • When you feel sharp and well-oriented

The checkpoint captures your entire conversation history up to this point.

Inputs: name (required), note.

delete_checkpointC

Delete a checkpoint you no longer need.

Inputs: name (required).

get_context_statsA

Get statistics about your current context window health.

Returns:

  • Number of turns (user and assistant messages)

  • Estimated token count

  • Number of compaction/summary events

  • Context age

Use this to decide when you might want to checkpoint or reset.

Inputs: no named parameters.

list_checkpointsB

List all available checkpoints for the current session. Shows when each was created and any notes attached.

Inputs: no named parameters.

reset_to_checkpointA

Reset your context back to a saved checkpoint, injecting a handoff message to your future self.

The message_to_self will appear as if you wrote it just before the reset. Use it to brief your future self on:

  • What was accomplished since the checkpoint

  • Key findings and decisions

  • Clear next steps

  • Critical details (file paths, variable names, gotchas)

After calling this, your context will be restored to the checkpoint state plus your handoff message.

Inputs: name (required), message_to_self (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a distinct and non-overlapping purpose: checkpoint_context saves context, delete_checkpoint removes it, get_context_stats provides metrics, list_checkpoints enumerates saved states, and reset_to_checkpoint restores to a checkpoint. There is no ambiguity in tool selection.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (e.g., checkpoint_context, delete_checkpoint, get_context_stats, list_checkpoints, reset_to_checkpoint). The naming is uniform and predictable across the set.

    Tool Count5/5

    With 5 tools, the server is well-scoped for managing context checkpoints, covering creation, deletion, listing, restoration, and monitoring. Each tool earns its place without being excessive or insufficient.

    Completeness5/5

    The tool set provides complete lifecycle coverage for context checkpoint management: create (checkpoint_context), read (list_checkpoints, get_context_stats), update (reset_to_checkpoint), and delete (delete_checkpoint). There are no obvious gaps for the domain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables coding agents to keep project state, evidence, and decisions bound to the repository, and to resume work across sessions and hosts by receiving a bounded, revalidated context packet instead of a full transcript. It also lets agents record checkpoints, handoffs, and closeouts while keeping deterministic decision and routing authority in code.
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables long-running autonomous agents to snapshot environment and context states, evaluate the viability of competing reasoning branches, and roll back to an earlier checkpoint when an exploration path fails without restarting from scratch. Exposes this tree-of-thoughts state management over the Model Context Protocol for use in Claude Desktop, Cursor, and custom agentic frameworks.
      7
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude and other AI agents to store decisions, patterns, and knowledge once and retrieve relevant context automatically across sessions, surviving context limits, restarts, and compaction.
      17 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude coding assistants to persist and restore context across sessions and compactions, saving decisions, progress, and file contents in channels and checkpoints for later retrieval. Supports search, change tracking, and sharing memory between parallel sessions.
      150 npm
      MIT