Mpm Session Pause logo

Mpm Session Pause

Community
bobmatnyc
mpm-session-pause

Pause session and save current work state for later resume

Overview

Publisherbobmatnyc
Repositoryclaude-mpm
Skill namempm-session-pause
Stars
152
Forks
34
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by bobmatnyc on GitHub. Read the source before you install it.

Installation

Install the Mpm Session Pause AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm.git /tmp/claude-mpm
mkdir -p .claude/skills
cp -r /tmp/claude-mpm/plugin/skills/mpm-session-pause .claude/skills/mpm-session-pause
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mpm Session Pause in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mpm Session Pause on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mpm Session Pause is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/mpm-session-pause

Pause the current session and save all work state for later resume.

What This Does

When invoked, this skill:

  1. Captures current work state (todos, git status, context summary)
  2. Creates session files at .claude-mpm/sessions/session-{timestamp}.* (project-local)
  3. Updates .claude-mpm/sessions/LATEST-SESSION.txt pointer
  4. Prunes stale git worktrees under <repo>/.claude/worktrees/ (see below)
  5. Shows the session file path for later resume

Usage

/mpm-session-pause [optional message describing current work]

Examples:

/mpm-session-pause
/mpm-session-pause Working on authentication refactor, about to test login flow
/mpm-session-pause Need to context switch to urgent bug fix

Worktree Pruning (issues #892, #894)

At pause time, MPM automatically prunes stale agent worktrees and orphaned directories under <repo>/.claude/worktrees/.

Registered-worktree pruning (#892)

Safety classification — a registered worktree is PRESERVED if ANY of the following is true:

  • It has uncommitted changes (staged or unstaged).
  • It has untracked files.
  • Its branch has commits not yet merged into the main branch (or not pushed to its upstream remote).
  • It is marked as locked by git.
  • Any git command fails (fail-safe: when in doubt, PRESERVE).

Only worktrees that are provably clean and fully merged are removed via git worktree remove (never --force).

Orphaned-directory sweep (#894)

git worktree list only reports registered worktrees. Directories under .claude/worktrees/ that are no longer registered (e.g. left behind after git worktree remove --force) are invisible to git and accumulate indefinitely. MPM performs a separate filesystem scan to find and remove them.

Safety classification — an orphaned directory is PRESERVED if ANY of the following is true:

  • It has uncommitted or untracked changes (git status --porcelain non-empty).
  • It has a .git entry but git status fails (ambiguous state → PRESERVE).
  • Its branch has commits not merged into the main branch.
  • Its merge status cannot be determined (fail-safe: when in doubt, PRESERVE).
  • It is a plain (non-git) directory that contains any files or subdirectories (preserved to avoid deleting unmanaged data). Only empty plain directories are swept.
  • The git worktree list command fails entirely (sweep is skipped and the summary records orphan_sweep_skipped to explain why).

A strict path-containment guard ensures deletion can never escape .claude/worktrees/ — symlinks that resolve outside the directory are rejected and preserved.

Output — after the session files are written, the pause command prints a concise cleanup summary, e.g.:

Worktree Cleanup:
  Pruned 2 stale worktree(s)
  Preserved 1 worktree(s) with unsaved work
    /repo/.claude/worktrees/agent-abc: branch has commits not merged into main branch
  Swept 1 orphaned directory
  Preserved 1 orphaned directory with unsaved work
    /repo/.claude/worktrees/leftover-xyz: has uncommitted or untracked changes

Opt-out — pass --no-prune-worktrees to skip all cleanup (both registered pruning and orphan sweep):

bash
claude-mpm session pause --no-prune-worktrees

Implementation

Run the console script directly — no interpreter resolution needed:

bash
# Basic pause (includes worktree pruning)
claude-mpm session pause

# With a descriptive message
claude-mpm session pause -m "End of day — auth refactor in progress"

# Skip worktree pruning
claude-mpm session pause --no-prune-worktrees

# Export a copy to a specific location
claude-mpm session pause --export /tmp/session-backup.json

If the user provided a message after /mpm-session-pause, pass it via -m:

bash
claude-mpm session pause -m "<user message here>"

If claude-mpm session pause fails

If the command exits non-zero, capture the full error and show it verbatim — do not summarise with a generic "not importable" message:

bash
claude-mpm session pause 2>&1
rc=$?
if [ "$rc" -ne 0 ]; then
    echo ""
    echo "ERROR: claude-mpm session pause failed (exit $rc)."
    echo "Full error shown above."
    echo ""
    echo "Diagnostic steps:"
    echo "  1. Verify claude-mpm is on PATH:  command -v claude-mpm"
    echo "  2. Check the actual import error:  python3 -c 'import claude_mpm' 2>&1"
    echo "  3. If a transitive dep fails (e.g. shadowed stdlib module), check"
    echo "     sys.path[0] is not /tmp:  python3 -c 'import sys; print(sys.path[0])'"
fi

Note on misleading ImportError messages (issue #781): A bare except ImportError can fire for transitive failures (e.g. a stray /tmp/bisect.py shadowing stdlib bisect) unrelated to claude_mpm itself. Always inspect the actual exception — e.name tells you which module failed. If e.name does not start with claude_mpm, the problem is a shadowed or missing transitive dependency, not a missing claude_mpm installation.

What Gets Saved

Session State:

  • Session ID and timestamp
  • Current working directory
  • Git branch, recent commits, and file status
  • Primary task and current phase
  • Context message (if provided)
  • TaskList state (pending/in-progress tasks from Claude Code)

Resume Instructions:

  • Quick-start commands
  • Validation commands
  • Files to review

File Formats:

  • .md - Human-readable markdown (for reading)
  • .json - Machine-readable (for tooling)

Session File Location

All session files are stored in the project-local directory:

<project-root>/.claude-mpm/sessions/
├── LATEST-SESSION.txt          # Pointer to most recent session
├── session-YYYYMMDD-HHMMSS.md
└── session-YYYYMMDD-HHMMSS.json

This ensures sessions are scoped to the project that created them — pausing in project A and opening project B will never load project A's session state.

Token Budget

Token usage: ~5-10k tokens to execute (2-5% of context budget)

Benefit: Saves all remaining context for future resume, allowing you to:

  • Context switch to urgent tasks
  • Take a break and resume later
  • Archive current work state before major changes

Resume Later

To resume this session:

/mpm-session-resume

Or from the CLI:

bash
claude-mpm session resume

Or manually:

bash
cat .claude-mpm/sessions/LATEST-SESSION.txt
cat .claude-mpm/sessions/session-YYYYMMDD-HHMMSS.md

Git Integration

Session files are stored in the project-local .claude-mpm/sessions/ directory. Add this directory to your .gitignore — session state is machine-specific and should not be committed. No git commit is created by the pause operation.

Use Cases

Context switching:

/mpm-session-pause Switching to urgent production bug

End of work session:

/mpm-session-pause Completed API refactor, ready for testing tomorrow

Before major changes:

/mpm-session-pause Saving state before attempting risky refactor

When approaching context limit:

/mpm-session-pause Hit 150k tokens, starting fresh session

Related Commands

  • /mpm-session-resume — Resume from most recent paused session
  • claude-mpm session resume — CLI entry point for resume
  • claude-mpm session pause --help — Full CLI usage

Notes

  • Session files are stored project-locally in .claude-mpm/sessions/ (not synced across machines)
  • Add .claude-mpm/sessions/ to .gitignore
  • No git commit is created — sessions live outside version control
  • LATEST-SESSION.txt always points to most recent session in the current project
  • Session pause is manual-only; context-usage crossing thresholds (70%+) only prints informational warnings (auto-pause is disabled)

Frequently asked questions

What does the Mpm Session Pause AI skill do?

Pause session and save current work state for later resume

Why use Mpm Session Pause on TypingMind?

Because you install it once and use it with any model. Mpm Session Pause is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mpm Session Pause in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/bobmatnyc/claude-mpm/tree/main/plugin/skills/mpm-session-pause. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Mpm Session Pause?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mpm Session Pause?

As many as you like. As long as a model supports skills, you can use Mpm Session Pause with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mpm Session Pause AI skill free?

It is published on GitHub by bobmatnyc. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇