Skip to main content

A CLI utility for capturing and restoring development session checkpoints.

Project description

ckpt โ€” 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 and session amnesia?

When pair programming with AI agents or large language models (LLMs), transferring your current state after a context switch or break is painful. Dumping your entire directory tree or pasting endless lines of raw git diffs into chat windows consumes millions of expensive cloud tokens and confuses the LLM.

ckpt solves this by capturing and restoring development session states locally. It bundles your active git branch, latest commit, uncommitted changes, recent shell command history, and a high-density, 150-word AI-generated "Mental Map" (summarizing what you are working on, key changes made, and next steps).


โšก Quick Start

You can run ckpt instantly without installation using uvx, or install it permanently as a global CLI tool.

Option A: Instant Run (via uv)

Run ckpt immediately on any machine where Astral's uv is installed:

# Capture your current session checkpoint and generate an AI mental map
uvx --from ckpt-cli ckpt save -m "Extracted middleware validation logic"

# Restore a prior state by its 8-character ID
uvx --from ckpt-cli ckpt restore a1b2c3d4

Option B: Global CLI Installation

Install ckpt permanently to your path:

# Install globally via uv
uv tool install ckpt-cli

# Or install globally via pipx
pipx install ckpt-cli

# Initialize your AI provider (Ollama or Google Gemini)
ckpt setup

# Save your first checkpoint
ckpt save -m "Work in progress: authentication refactoring"

# Revert unstaged changes and restore prior session context
ckpt restore <checkpoint-id>

๐Ÿ—๏ธ Architecture

ckpt acts as a coordination bridge between your local shell environment, git tree, local/remote LLM intelligence, and your AI assistant:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                     Developer Command Line                   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  ckpt save
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                          ckpt Engine                         โ”‚
    โ”‚  - Git Tree (diffs, branch, modified files)                  โ”‚
    โ”‚  - Shell History (~/.zsh_history, ~/.bash_history)           โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  Prompt Payload
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                         LLM Provider                         โ”‚
    โ”‚  - Ollama (Local LLaMA-3 / Mistral)                          โ”‚
    โ”‚  - Google Gemini (API-driven Content Generation)             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  150-Word "Mental Map"
                                   โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                      Persistent Store                        โ”‚
    โ”‚  - Snapshot JSON: ~/.config/ckpt/snapshots/<id>.json         โ”‚
    โ”‚  - Strict Permissions: Read-Write Owner Only (0o600 / ACLs) โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”Œ Model Context Protocol (MCP) Integration

ckpt ships with a built-in Model Context Protocol (MCP) server over standard input/output (stdio), allowing AI editors like Cursor, Claude Desktop, or Claude Code to programmatically query, list, and create checkpoints during a session.

1. Cursor Setup

Configure ckpt inside Cursor:

  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

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
{
  "mcpServers": {
    "checkpoint": {
      "command": "uvx",
      "args": [
        "--from",
        "ckpt-cli",
        "ckpt-mcp"
      ]
    }
  }
}

3. Claude Code Setup

Install ckpt-mcp in your environment and run it via Claude Code's system rules:

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

๐Ÿ›ก๏ธ Privacy & Security (FAQ)

Q: Does ckpt send my private code to the cloud?

A: By default, no! ckpt supports Ollama out of the box. If you configure a local Ollama instance (running LLaMA-3, Mistral, etc.), all your git diffs, histories, and mental maps are generated entirely on your local GPU/CPU. No external calls are made.

If you choose Google Gemini as your provider during ckpt setup, only the necessary git diff snippet (capped at 3,000 characters) and your recent command list are sent securely via TLS to Google AI Studio APIs to synthesize the summary.

Q: How secure are my checkpoint files on disk?

A: Very secure. ckpt enforces strict file and folder permissions during save operations:

  • macOS / Linux: Configuration folders are locked to 0o700 and files to 0o600 (readable/writeable by the owner only).
  • Windows: The system explicitly uninherits ACL permissions and grants Full Control (F) exclusively to the active Windows username.

Q: Can a compromised repository escape directory structures?

A: No. ckpt validates all snapshot IDs using strict regular expression guards (^[a-f0-9]{1,64}$) before executing any load, restore, or unlink command. Path traversal attempts like ../../etc/passwd or ..\win.ini are blocked instantly and raise a CheckpointNotFoundError.


๐Ÿ“„ 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.1.1.tar.gz (28.4 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.1.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ckpt_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 28.4 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.1.1.tar.gz
Algorithm Hash digest
SHA256 bdd1dc2294af39197a9097eda2631faa3b255e7a9dec8f05d74a65768e1be4fb
MD5 6c084a6d463c335d8165251bf2ab36f1
BLAKE2b-256 c6822b540c4e868051917800c51f62137a515fdc51deea503b5e8f745a2c4bd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckpt_cli-0.1.1.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.1.1-py3-none-any.whl.

File metadata

  • Download URL: ckpt_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.8 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23ebae9a54f6ad524aa1e1ea7b4194c0eea42db5dc2c42afa1f20f30805a9346
MD5 a6ff14ee98ea7480337fe9989803c0f0
BLAKE2b-256 185accf5d1164cf48e50b611a44a44e800338991bea5768589bba2ec78aaed3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckpt_cli-0.1.1-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