Mpm Session Management 标志

Mpm Session Management

社区
bobmatnyc
mpm-session-management

用于管理上下文限制和恢复会话的 PM 会话管理框架

Add to TypingMind

概览

发布者bobmatnyc
代码仓库claude-mpm
技能名称mpm-session-management
星标数
152
复刻数
34
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 bobmatnyc 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Mpm Session Management AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/bobmatnyc/claude-mpm/tree/main/plugin/skills/mpm-session-management
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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-management .claude/skills/mpm-session-management
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Mpm Session Management,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Mpm Session Management。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Mpm Session Management 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

PM Session Management

Type: Framework Applies To: Project Manager Agent Load Priority: On-demand (context limit or session resume)

Umbrella skill. This skill covers the concepts of PM session lifecycle: the auto-pause threshold system, git-based continuity, and how session management fits the PM workflow. The concrete, user-invocable procedures live in two dedicated skills — use them for the actual steps:

  • mpm-session-pause — pause and persist current work state.
  • mpm-session-resume — load context from a paused session.

Do not duplicate their step-by-step instructions here; this skill points at them.

Purpose

This skill provides the conceptual model for PM session pause/resume when context limits are approaching or when resuming from a previous session. These protocols are only needed when hitting token limits or starting a session with existing pause state. For the operational steps, invoke mpm-session-pause / mpm-session-resume.

When This Skill Is Loaded

  • Context usage reaches 70%+ thresholds (informational warnings only)
  • Session starts with .claude-mpm/sessions/LATEST-SESSION.txt
  • User runs /mpm-session-resume

Context Usage Monitoring

The MPM framework continuously tracks context usage and provides informational warnings as usage approaches limits. Context-usage auto-pause (which used to abort sessions at 90% usage) was disabled in commit da5166603 (PR #646) to preserve legitimate active work.

Threshold Levels and Warnings

LevelUsageBehavior
Caution70%Informational warning: "Context usage at 70%. Consider wrapping up current work."
Warning85%Informational warning: "Context usage at 85%. Session nearing capacity."
Auto-Pause Disabled90%Informational warning: "Context usage at 90%. Consider wrapping up or running /compact (auto-pause is disabled)."
Critical95%Informational warning: "Context usage at 95%. Consider wrapping up or running /compact (auto-pause is disabled)."

Crossing these thresholds only produces informational warnings. No session pause is triggered, no ACTIVE-PAUSE.jsonl file is created. Sessions continue normally.

Manual Session Pause

To save session state before context limits:

  1. Use the /mpm-session-pause skill to explicitly create a session snapshot
  2. This captures git state, todos, task list, and accomplishments into .claude-mpm/sessions/session-{timestamp}.* files
  3. Sessions are stored in project-local .claude-mpm/sessions/ directory (not synced across machines)

Session Resume Protocol

Procedure. The step-by-step resume flow now lives in mpm-session-resume. Invoke that skill to load and display context from a paused session.

When resuming work:

  1. Use /mpm-session-resume to load the most recent paused session
  2. The skill detects .claude-mpm/sessions/LATEST-SESSION.txt and loads the associated snapshot
  3. Session accomplishments, pending tasks, and git context are displayed
  4. PM can continue work with full prior context

PM Response to Context Warnings

When PM sees context warnings (70%+), follow this protocol:

Immediate Actions

  1. Wrap up current work phase

    • Complete the current delegation cycle
    • Don't start new major tasks
  2. Document all in-progress tasks

    • Ensure all todos are updated with current status
    • Mark BLOCKED todos with specific blockers
    • Add context to in_progress todos
  3. Delegate remaining work with clear handoff

    • Provide detailed context to agents
    • Include acceptance criteria
    • Reference relevant files and commits
  4. Create summary

    • What was completed
    • What remains to be done
    • Any blockers or important context

Example Wrap-Up Sequence

Context at 85% - wrapping up current phase

Completed:
- ✅ OAuth2 implementation (commit abc123)
- ✅ Staging deployment verified

In Progress:
- 🔄 QA verification (api-qa testing login flow)

Remaining:
- Documentation update (auth flow docs)
- Production deployment

Creating session snapshot for clean resume...

Git-Based Session Continuity

Git history provides additional session context that complements session snapshots:

Useful Git Commands

bash
# Recent commits (what was delivered)
git log --oneline -10

# Uncommitted changes (work in progress)
git status

# Recent work (last 24 hours)
git log --since="24 hours ago" --pretty=format:"%h %s"

# Files changed recently
git log --name-status --since="24 hours ago"

Integration with Session Resume

When resuming a session, PM should:

  1. Load session snapshot (if available)
  2. Check git log for additional context
  3. Verify git status for uncommitted work
  4. Reconcile session state with git state

Example:

Resuming session...

Session snapshot: Work on OAuth2 authentication
Git log: Last commit "feat: add OAuth2 provider" (2 hours ago)
Git status: Uncommitted changes in src/auth/middleware.js

Context: Implementation complete, middleware updates in progress

Session Files Structure

Sessions are stored project-locally in .claude-mpm/sessions/:

.claude-mpm/sessions/
├── LATEST-SESSION.txt       # Pointer to most recent paused session
├── session-YYYYMMDD-HHMMSS.json   # Machine-readable session snapshots
└── session-YYYYMMDD-HHMMSS.md     # Human-readable markdown summary

File Purposes

  • LATEST-SESSION.txt: Points to most recent finalized session file
  • session-*.json: Complete session state (todos, git status, accomplishments, next steps)
  • session-*.md: Human-readable summary for quick review

Sessions are created manually via /mpm-session-pause skill. The ACTIVE-PAUSE.jsonl file (used during auto-pause) is no longer created since auto-pause is disabled.

Best Practices

When Context Limits Approach

  1. Monitor warnings: When you see context warnings (70%+), begin wrapping up
  2. Finish current phase: Complete the delegation in progress
  3. Update todos: Ensure all todos reflect current status
  4. Create session snapshot: Invoke /mpm-session-pause to save state for later resume
  5. Create handoff context: Document what's completed and what remains

When Resuming Sessions

  1. Review session snapshot: Understand what was accomplished
  2. Check git history: Verify actual state matches snapshot
  3. Validate uncommitted work: Any WIP that wasn't tracked?
  4. Continue from clear state: Don't duplicate completed work

Avoiding Session Bloat

  • Keep delegations focused and atomic
  • Don't load unnecessary context (use skills on-demand)
  • Complete and close todos regularly
  • Commit work incrementally (easier to resume)

Common Scenarios

Session pause/resume scenarios reduce to two procedures:

  • Approaching context limits / wrapping up → Follow the "PM Response to Context Warnings" protocol above, then invoke /mpm-session-pause to create a session snapshot that persists your work state.
  • Returning to work → Invoke /mpm-session-resume, which loads the most recent paused session snapshot and displays prior accomplishments, pending tasks, and git context.

Keep delegations atomic and commit incrementally so either procedure resumes from a clean point.

Integration with PM Workflow

Session management integrates with standard PM workflow:

User Request
    ↓
[Check for session resume state]
    ↓
Research (if needed)
    ↓
[Monitor context usage — watch for warnings]
    ↓
Implementation
    ↓
[Approaching limit? → /mpm-session-pause]
    ↓
Deployment
    ↓
QA
    ↓
Documentation
    ↓
[Save session snapshot if context is high]
    ↓
Report Results

Trigger Keywords

  • "context", "pause", "resume", "session"
  • "token", "limit", "usage"
  • "continue", "previous session"
  • Auto-loaded at 70%+ context usage
  • Auto-loaded when session files exist

Related Skills

  • mpm-session-pause - Procedure: pause and persist current work state
  • mpm-session-resume - Procedure: load context from a paused session
  • mpm-git-file-tracking - File tracking during pause/resume
  • mpm-verification-protocols - Verification state during pause
  • mpm-delegation-patterns - Resuming delegations mid-workflow

常见问题

Mpm Session Management AI 技能有什么作用?

用于管理上下文限制和恢复会话的 PM 会话管理框架

为什么在 TypingMind 中使用 Mpm Session Management?

因为您只需安装一次,就能搭配任何模型使用。Mpm Session Management 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Mpm Session Management?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/bobmatnyc/claude-mpm/tree/main/plugin/skills/mpm-session-management。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Mpm Session Management?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Mpm Session Management 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Mpm Session Management 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Mpm Session Management AI 技能免费吗?

bobmatnyc 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇