A CLI utility for capturing and restoring development session checkpoints.
Project description
ckpt โ The State Saver & Context Restorer for AI coding sessions.
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:
- Open Cursor Settings -> Features -> MCP.
- Click + Add New MCP Server.
- Fill out the dialog:
- Name:
checkpoint - Type:
command - Command:
uvx --from ckpt-cli ckpt-mcp
- Name:
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
0o700and files to0o600(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdd1dc2294af39197a9097eda2631faa3b255e7a9dec8f05d74a65768e1be4fb
|
|
| MD5 |
6c084a6d463c335d8165251bf2ab36f1
|
|
| BLAKE2b-256 |
c6822b540c4e868051917800c51f62137a515fdc51deea503b5e8f745a2c4bd9
|
Provenance
The following attestation bundles were made for ckpt_cli-0.1.1.tar.gz:
Publisher:
publish.yml on Marcelluxx/ckpt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ckpt_cli-0.1.1.tar.gz -
Subject digest:
bdd1dc2294af39197a9097eda2631faa3b255e7a9dec8f05d74a65768e1be4fb - Sigstore transparency entry: 1687670361
- Sigstore integration time:
-
Permalink:
Marcelluxx/ckpt@d299c9cb430cc2164ad39fd6acf5c38b54d473a7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Marcelluxx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d299c9cb430cc2164ad39fd6acf5c38b54d473a7 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ebae9a54f6ad524aa1e1ea7b4194c0eea42db5dc2c42afa1f20f30805a9346
|
|
| MD5 |
a6ff14ee98ea7480337fe9989803c0f0
|
|
| BLAKE2b-256 |
185accf5d1164cf48e50b611a44a44e800338991bea5768589bba2ec78aaed3c
|
Provenance
The following attestation bundles were made for ckpt_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Marcelluxx/ckpt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ckpt_cli-0.1.1-py3-none-any.whl -
Subject digest:
23ebae9a54f6ad524aa1e1ea7b4194c0eea42db5dc2c42afa1f20f30805a9346 - Sigstore transparency entry: 1687670479
- Sigstore integration time:
-
Permalink:
Marcelluxx/ckpt@d299c9cb430cc2164ad39fd6acf5c38b54d473a7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Marcelluxx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d299c9cb430cc2164ad39fd6acf5c38b54d473a7 -
Trigger Event:
release
-
Statement type: