Skip to main content

English · 简体中文

The MemoryHub map: a project's sessions as checkpoints on a timeline

MemoryHub

Manage every AI coding session as git-backed memory — save it purified, load it back, curate it on a map.

Managing context is all you need; leave everything else to the model.

MemoryHub (mh) is a small Python CLI and a local web map for Claude Code, pi and Codex. A session ends and mh save keeps it; the next session runs mh load and the project's memory is back; mh ui is where you manage all of it.

  • Every session kept, none of the noise — purified to the User/Agent dialog by rule, no model call, stored as a file in a checkpoint, committed to a git repo you own
  • Loaded when it matters — the next session starts from the checkpoint you are at, its parents and its links, newest first within a token budget
  • Curated, not hoarded — skip a session, drop or rewrite an exchange, move a session, write a summary instead, from the map or the terminal
  • Shaped like the project — stages from a template, parallel takes at a stage, sub-checkpoints for a smaller scope, links between the ones that belong together

CI License Python Agents PyPI

uv tool install memoryhub-mh && mh skill install

Linux or macOS · git ≥ 2.32 · Python ≥ 3.12 · on PyPI as memoryhub-mh. See the changelog for what is new.

See it in action

Real captures of the map on a small café-site project, not mockups.

Click a node Open a checkpoint Save the running session
The node menu: open, make current, sub-checkpoint, another take, link, rename, delete A checkpoint's sessions; one unticked and skipped on load The save box: a summary or the full dialog, to which checkpoint
Everything you can do to it, with a word on each. Untick a session and every load leaves it out. A summary the agent writes — or every word, curated by you.

A saved session is the dialog and nothing else. Edit or delete an exchange; the hub keeps the history.

A saved session, purified, with edit and delete on each exchange

The session running right now, thinking and tool calls included, with the save box on top.

The live session panel with the save box

New checkpoint: the template's next stage, another take at this one, a sub-checkpoint, or any name.

The new-checkpoint menu

Quick start

1. Install

uv tool install memoryhub-mh   # the package is memoryhub-mh, the command is mh
mh skill install               # teaches Claude Code the /mh workflow
Install Upgrade
uv — fetches Python 3.12 if the machine has none uv tool install memoryhub-mh uv tool upgrade memoryhub-mh
pipx pipx install memoryhub-mh pipx upgrade memoryhub-mh
pip — Python ≥ 3.12, in a venv pip install memoryhub-mh pip install -U memoryhub-mh

Hooks run plain mh, so it must be on PATH: uv and pipx put it there, a venv only while it is active. The development version is uv tool install git+https://github.com/solknight48/memoryhub.

2. Give the project a hub

cd my-site
mh init --template frontend   # .memoryhub/ with the stages of a frontend project
mh checkpoint                 # the first stage: requirement-analysis

3. Work, save, load

# … work with Claude Code; at the end the agent runs:
mh save                       # this session, purified, into the checkpoint
# next time:
mh load                       # the memory, back in context
mh ui                         # the map

mh hook install makes Claude Code run the load at session start and the save at the end.

Manage sessions

You want to On the map In the terminal
Keep this session save box → Full dialog mh save
Keep a summary instead save box → Summary mh save --compact --with agent
Leave a session out of loads untick it mh skip CKPT/SESSION
Fix or drop one exchange edit / delete on the exchange mh edit, mh rm -x N
Move a session elsewhere move… on its row mh mv CKPT/SESSION CKPT
Load two checkpoints together node → Link to… mh link A B
Work in a smaller scope node → Sub-checkpoint… mh checkpoint NAME --under CKPT
Try the stage again, in parallel node → Another take mh checkpoint --at STAGE
Load a node whole tick "with sub-checkpoints" mh load --tree
Find where a session came from open original ↗ mh trace CKPT/SESSION
Bring in past sessions mh import
Undo anything git -C .memoryhub revert HEAD

Why MemoryHub

  • Purified, mechanically — tool calls, thinking, harness wrappers and the unanswered last question are stripped by rule. What is stored reads like the conversation, and costs nothing to produce.
  • A git repo, not a database.memoryhub/ is plain markdown in a normal repository: diff it, push it, revert it, read it without mh.
  • Independent by default — checkpoints load alone unless you link them; a sub-checkpoint loads inside its parents; a take is a parallel path, not a copy.
  • The map tells the truth — purple is exactly what the next mh load packs; a link the load does not reach is grey; a terminal change shows up within a poll.
  • Local only — loopback, a per-run token, no cloud. Nothing leaves the machine unless you push the hub. The one model call there is, the summary, uses the CLI you already run.

How it works

Step What happens
Save The session's transcript is found, each user turn paired with the reply that followed, everything else stripped.
Store The dialog lands as <end-time>_<session>.md in the current checkpoint, one commit in the hub. A session lives in exactly one checkpoint.
Load The current checkpoint, its parents and its links; sessions merged by time, newest first, within the budget (20 000 tokens by default).
Map mh ui draws the hub: stages, takes, sub-checkpoints, links, what the next load packs, and the session being written right now.
Curate Skips, edits, moves and summaries are commits like any other; the map and the CLI share one rule for each.

Commands

Command What it does
mh init [--global] [--claude] [--template T] Create the hub.
mh checkpoint [name] [--at STAGE] [--under CKPT] New checkpoint; becomes current. No name: the template's next stage; --at alone: one more take at a stage (design-2); --under: a sub-checkpoint (design.head-page).
mh template [name] [--list [-v]] [--clear] Stage template — default names for the checkpoints ahead.
mh save [CKPT] [--to CKPT] [--file MD] [--session-id ID] [--transcript P] Purify the current session into a checkpoint.
mh save [CKPT] --compact --file MD Store an agent-written summary instead of the full dialog.
mh save [CKPT] --compact --with agent [--focus TEXT] Have the session's own CLI (claude -p or pi -p; --with claude/pi picks one) write the summary and store it.
mh import [--to CKPT] [--agent A]... [--dry-run] Backfill this project's past sessions (Claude Code, pi, Codex).
mh load [CKPT...] [--no-links] [--tree] [--budget N] [--all] [--json] Warm-start pack: selection + linked closure, time-merged; --tree adds the sub-checkpoints under the selection.
mh link A B / mh unlink A B Make checkpoints load together / stop that.
mh list / mh show CKPT[/SESSION] / mh search Q Inspect the hub.
mh trace CKPT/SESSION Find the original transcript a saved session was purified from.
mh rm CKPT[/SESSION] [-x N] [--force] Delete a checkpoint, a session, or one exchange.
mh mv CKPT/SESSION CKPT / mh rename CKPT NAME Move a session / rename a checkpoint.
mh edit CKPT/SESSION -x N [--user T] [--agent T] Rewrite one side of an exchange.
mh skip CKPT/SESSION / mh unskip CKPT/SESSION Leave a session out of mh load (it stays in its checkpoint) / load it again.
mh back [N] / mh forward [N] / mh goto CKPT Move the current pointer.
mh status / mh log Position and counts / the hub's git journal.
mh sync pull --rebase + push to origin; conflicts auto-abort.
mh hubs [--prune] All registered hubs.
mh ui [--port N] [--budget N|none] [--read-only] [--detach] [--stop] [--session ID] Open the checkpoint map in a browser and curate the hub.
mh hook install [--user] [--remove] [--budget N] [--tree] Automate load/save through Claude Code hooks.
mh skill install Install the Claude Code skill.

Hands-free

mh hook install            # this project: load at session start, save at the end
mh hook install --user     # every project
mh hook install --remove   # undo

SessionStart injects mh load; SessionEnd and PreCompact run mh save.

Reference and scope

  • PyPI — releases, each a vX.Y.Z tag published by CI · CHANGELOG.md — what changed when · CONTRIBUTING.md — the invariants a change must keep, and how a release is cut
  • scripts/showcase.py rebuilds the screenshots above from a throwaway project
  • Out of scope on purpose: a hosted service, typing into the running session, choosing the template from the map

License

MIT — free to use, modify and distribute.

Contributing

Issues and pull requests are welcome. Start with the contribution guide; every change keeps the suite hermetic and both READMEs in step.

Download files

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

Source Distribution

memoryhub_mh-0.4.0.tar.gz (188.7 kB view details)

Uploaded Source

Built Distribution

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

memoryhub_mh-0.4.0-py3-none-any.whl (120.3 kB view details)

Uploaded Python 3

File details

Details for the file memoryhub_mh-0.4.0.tar.gz.

File metadata

  • Download URL: memoryhub_mh-0.4.0.tar.gz
  • Upload date:
  • Size: 188.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for memoryhub_mh-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4241165ee901eaec90e347cbbfcc52b5bf1201f5a462688d0ed333b816be8025
MD5 80e63c5754f0d8e74d32243fb50bf8c6
BLAKE2b-256 417c2f78f211fe26578fb9c6c988a52d4fd438e65ae706f1fd210eeef0c107fb

See more details on using hashes here.

File details

Details for the file memoryhub_mh-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: memoryhub_mh-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 120.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for memoryhub_mh-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec92c42385cc2462d852e57fefaa6e11b03ab75d79b5dcb586f42ce0e08f9ebb
MD5 ede41e74dea0e8b21fc7b222e7ff21e3
BLAKE2b-256 0ec2622ba698b7470e33be03b9afcf3314277621184a722af630c9d047d8018a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page