Skip to main content

A CLI utility for capturing and restoring development session checkpoints.

Project description

๐Ÿ›ก๏ธ ckpt โ€” Checkpoint: The State Saver & Context Restorer for AI Coding Sessions

CI Status GitHub Release PyPI Version GitHub Stars License

Are your AI coding sessions suffering from context bloat, expensive token waste, and session amnesia?

When pair programming with AI agents (like Claude Desktop, Cursor, or Claude Code) or using Large Language Models, switching tasks or taking breaks is a painful context loss. Pasting massive git diffs and directory structures into chat windows burns through your tokens and confuses the AI.

ckpt (Checkpoint) solves this. It captures your entire development session state locally in a lightweight JSON package: your active git branch, latest commit hash, working directory changes, recent shell history, and a high-density, agent-generated "Mental Map" summarizing the session context, changes made, and next steps.

Restoring your workspace or catching your AI agent up is now as simple as a single command or tool call!


โšก 30-Second Quick Start (No Experience Required)

You don't need to be a terminal expert to start using ckpt. You can activate and use it instantly in less than 30 seconds!

Step 1: Install ckpt globally

Run one of these commands in your terminal to install ckpt on your system:

# Using uv (Recommended - ultra-fast)
uv tool install ckpt-cli

# Or using pipx
pipx install ckpt-cli

# Or using standard pip
pip install ckpt-cli

Step 2: Initialize your AI Provider (Optional)

If you want ckpt to automatically generate high-quality mental maps using an LLM when used via the CLI, run:

ckpt setup

(Choose between a local Ollama instance to keep 100% of your code offline, Google Gemini for lightning-fast cloud summaries, or OpenRouter to access any open/closed model).

Step 3: Start Checkpointing!

  • Save your progress:
    ckpt save -m "Refactored user authentication routes"
    
  • Restore a previous state interactively:
    ckpt restore
    
    (Use the Arrow Keys to scroll through your checkpoints cleanly and press Enter to restore!)

๐Ÿš€ The "Zero-Click" Setup: Let Your AI Do It!

Because modern coding AI assistants (like Claude, Cursor, or Cline) have direct access to your local filesystem, you don't even need to configure these JSON files yourself!

You can literally copy-paste one of the prompts below into your AI chat, and your AI assistant will automatically locate, parse, and update the configuration files on your operating system.

๐Ÿ’ฌ Prompts to Copy-Paste Into Your AI Assistant:

  • For Claude Desktop:

    "Please find my Claude Desktop configuration file on my system and add the checkpoint MCP server to it. Use the command 'uvx' with args ['--from', 'ckpt-cli', 'ckpt-mcp']."`

  • For VS Code (Cline / Roo Code):

    "Please locate my Cline/Roo Code MCP settings JSON file under my VS Code AppData folder, and register the checkpoint MCP server using the 'uvx --from ckpt-cli ckpt-mcp' command."

  • For Cursor:

    "Please add the checkpoint MCP server with command 'uvx --from ckpt-cli ckpt-mcp' to Cursor's global storage configuration file."

  • For Antigravity (Your Google Gemini Partner Agent):

    "Installa ed attiva automaticamente il server MCP per il salvataggio dei checkpoint nel mio ambiente di lavoro."

The AI assistant will find the file (e.g. %APPDATA%\Claude\claude_desktop_config.json on Windows, or ~/Library/Application Support/ on macOS), insert the checkpoint server block, and write the file. You will just need to approve the file write, and the tool is instantly active!


๐Ÿ”Œ AI & Model Context Protocol (MCP) Integration

ckpt features a built-in Model Context Protocol (MCP) server. This allows AI assistants like Cursor, Claude Desktop, Windsurf, or Claude Code to programmatically save, list, and restore checkpoints in real-time.

[!TIP] The Direct Mental Map Hack (No API Key Required!) When you pair ckpt with an AI agent in your editor, you don't even need to configure Ollama or Gemini! The AI agent already knows exactly what it has done. It will automatically pre-generate the Mental Map in memory and inject it directly into your checkpoint. This saves API costs, operates instantly, and uses the agent's live context perfectly!

How to prompt your AI Agent to handle it

Once you have added ckpt to your AI editor (see configuration guides below), you can literally tell your AI agent:

  • "Save a checkpoint of my current progress before you refactor this module."
  • "Can you show me the list of recent snapshots and restore the state from 10 minutes ago?"
  • "Use the checkpoint MCP server to save a snapshot before installing this library."

โš™๏ธ 1-Minute Configuration for AI Editors

Here is how to hook up ckpt's MCP server to your favorite AI tools so they can use it automatically.

1. Cursor Setup

Configure ckpt inside Cursor to give your AI agent full snapshot powers:

  1. Open Cursor Settings -> Features -> MCP.
  2. Click + Add New MCP Server.
  3. Fill out the dialog:
    • Name: checkpoint
    • Type: command
    • Command: uvx --from ckpt-cli ckpt-mcp
  4. Click Save. You're done!

2. Claude Desktop Setup

Add ckpt to your Claude Desktop configuration file:

  • macOS / Linux: ~/.config/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following block to the mcpServers section:

{
  "mcpServers": {
    "checkpoint": {
      "command": "uvx",
      "args": [
        "--from",
        "ckpt-cli",
        "ckpt-mcp"
      ]
    }
  }
}

3. Windsurf Setup

Configure ckpt inside Windsurf:

  1. Open Windsurf Settings -> Mcp.
  2. Click Add MCP Server.
  3. Choose Command and configure it:
    • Name: checkpoint
    • Command: uvx --from ckpt-cli ckpt-mcp
  4. Save and enjoy automated state recovery!

4. Claude Code Setup

Install ckpt-mcp in your environment and register it using Claude Code's instructions:

# Register using Claude Code's system rules
"Use the checkpoint MCP server tools ('save_snapshot', 'list_snapshots') to capture progress before complex changes and restore context."

๐Ÿ—๏ธ Architecture Flow

ckpt coordinates your local terminal, Git workspace, and your AI assistant to form a cohesive, secure lifecycle:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                Developer / AI Agent Interface                โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  ckpt save / save_snapshot
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                          ckpt Engine                         โ”‚
    โ”‚  - Git Tree (Unified diffs, active branch, modified files)   โ”‚
    โ”‚  - Shell History (~/.zsh_history, PowerShell history, etc.)  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  In-Memory / LLM Payload
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                     Mental Map Generator                     โ”‚
    โ”‚  - DIRECT: Injected by AI agent directly in memory           โ”‚
    โ”‚  - LOCAL: Ollama (LLaMA-3 / Mistral)                         โ”‚
    โ”‚  - CLOUD: Google Gemini or OpenRouter (Capped at 3k chars)   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  JSON Metadata & Summary
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                      Persistent Store                        โ”‚
    โ”‚  - Snapshot Location: ~/.config/ckpt/snapshots/<id>.json     โ”‚
    โ”‚  - Linux/macOS Permissions: Locked to Owner only (0o600)    โ”‚
    โ”‚  - Windows Security: Uninherited ACLs with Full Control only โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ›ก๏ธ Security, Privacy & Safety

  • 100% Offline Capability: By default, ckpt works entirely offline with local git metadata. If you choose Ollama as your LLM provider, all mental map generation occurs on your local machine. No code ever leaves your computer.
  • Encrypted & Locked Configs: Your checkpoint storage is secured with system-level permission controls (0o600 on Unix and custom uninherited ACLs on Windows) to prevent unauthorized read access by other users or processes.
  • Path-Traversal Protection: Every checkpoint operation validates the input snapshot ID using a strict hexadecimal regex (^[a-f0-9]{1,64}$). Any attempt to pass directory traversal parameters (like ../../passwd) is caught and blocked instantly.

๐Ÿ“„ License

Licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckpt_cli-0.2.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckpt_cli-0.2.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file ckpt_cli-0.2.0.tar.gz.

File metadata

  • Download URL: ckpt_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ckpt_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6ef608af349eaac3cadaf7916bafaae6d9b75f779d643ab53d5f8a5647b6b5ac
MD5 926ef6d079c52bfa8d63fffbbe693cb7
BLAKE2b-256 636d9236006387b0c74ab2ab9614f1c765c3c657020d72348314aa35f406c60f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckpt_cli-0.2.0.tar.gz:

Publisher: publish.yml on Marcelluxx/ckpt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ckpt_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ckpt_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ckpt_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7ef7f37f2f9b55b00e2edb4f8a977605c535f826db4a477ded662dff5ee3b4
MD5 9525d83382d7315251e967421db8a47f
BLAKE2b-256 0ee6e4364a437a38f24101ba4ea0b67c262ec4a2a4aa96cc28e0ce8755e29c91

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckpt_cli-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Marcelluxx/ckpt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page