← 返回 Skills 市场
athola

Nm Sanctum Session Management

作者 athola · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
105
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install nm-sanctum-session-management
功能描述
Manage Claude Code sessions with naming, checkpointing, and resume strategies
使用说明 (SKILL.md)

Night Market Skill — ported from claude-night-market/sanctum. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Session Management

When To Use

  • Managing session checkpoints and state preservation
  • Resuming work across Claude Code sessions

When NOT To Use

  • Short sessions that do not need checkpoints
  • Fresh starts where no prior session context exists

Overview

Claude Code supports named sessions for better workflow organization. Use this skill to manage complex, long-running work across multiple sessions.

Available Commands

Command Description
/rename Name the current session (auto-generates name if no argument given, 2.1.41+)
/resume Resume a previous session (REPL)
claude --resume \x3Cname> Resume from terminal

Workflow Patterns

1. Debugging Sessions

Name debug sessions for easy resumption:

# Start debugging
/rename debugging-auth-issue

# ... work on the issue ...

# If you need to pause, session is auto-saved
# Resume later:
claude --resume debugging-auth-issue

2. Feature Development Checkpoints

Create checkpoints during long feature work:

# After completing milestone 1
/rename feature-x-milestone-1

# Continue in new session
# Reference old session if needed

3. PR Review Sessions

For complex PR reviews that span multiple sittings:

# Start review
/rename pr-review-123

# Take breaks without losing context
# Resume:
claude --resume pr-review-123

4. PR-Linked Sessions (Claude Code 2.1.27+)

Sessions are automatically linked to PRs when created via gh pr create. Resume PR-specific sessions later:

# Resume session for a specific PR
claude --from-pr 156
claude --from-pr https://github.com/org/repo/pull/156

# Workflow: review → pause → resume with full context
/rename pr-review-156
# ... review work ...
# Later:
claude --from-pr 156

5. Investigation Sessions

When investigating issues that may require research:

# Start investigation
/rename investigate-memory-leak

# Pause to gather more info externally
# Resume with full context:
claude --resume investigate-memory-leak

Resume Screen Features

The /resume screen provides:

  • Grouped forked sessions: See related sessions together
  • Keyboard shortcuts (defaults, customizable via /keybindings):
    • Preview session content
    • Rename a session
  • Recent sessions: Sorted by last activity

6. Resume Hint on Exit (Claude Code 2.1.31+)

Claude Code now shows a resume hint when you exit, displaying the command to continue your conversation. This makes session resumption more discoverable — users no longer need to know about --resume beforehand.

Best Practices

Naming Conventions

Use descriptive, hyphenated names:

Pattern Example Use Case
debugging-\x3Cissue> debugging-auth-401 Bug investigation
feature-\x3Cname>-\x3Cmilestone> feature-search-v2 Feature development
pr-review-\x3Cnumber> pr-review-156 PR reviews
investigate-\x3Ctopic> investigate-perf Research
refactor-\x3Carea> refactor-api-layer Refactoring work

When to Name Sessions

Name sessions when:

  • Work will span multiple days
  • You might need to pause unexpectedly
  • The session contains valuable context
  • You want to reference it later

Session Cleanup

Unnamed sessions are eventually garbage collected. Named sessions persist longer. Periodically clean up old named sessions you no longer need.

Integration with Sanctum

Combine session management with other Sanctum skills:

  1. Before starting: Run Skill(sanctum:git-workspace-review) to capture context
  2. Name the session: /rename \x3Cdescriptive-name>
  3. Work: Use appropriate skills for the task
  4. Resume if needed: claude --resume \x3Cname>

Troubleshooting

Session Not Found

If a named session isn't appearing in /resume:

  • Check for typos in the name
  • Sessions may expire after extended inactivity
  • Use /resume screen to browse available sessions

Duplicate Sessions in VS Code

If you see duplicate session entries when resuming in VS Code:

  • Claude Code 2.1.38+: Fixed — resume now correctly reuses the existing session without creating duplicates
  • Older versions: Ignore the duplicate entries; they point to the same underlying session

Lost Context After Resume

If context seems incomplete or resume is slow:

  • Claude Code 2.1.30+: 68% memory reduction for --resume via stat-based session loading with progressive enrichment — especially impactful for users with many sessions. Also fixes hangs when resuming sessions with corrupted transcript files (parentUuid cycles).
  • Claude Code 2.1.29+: Fixed slow startup when resuming sessions with many once: true hooks — saved_hook_context loading is now optimized
  • Claude Code 2.1.21+: Fixed API errors when resuming sessions interrupted during tool execution — previously these sessions could fail to resume entirely
  • Claude Code 2.1.20+: Session compaction/resume is now fixed — resume correctly loads the compact summary instead of full history
  • Use /catchup to refresh git state
  • Use /debug (Claude Code 2.1.30+) for session troubleshooting diagnostics
  • Re-run Skill(sanctum:git-workspace-review) if needed
  • If on older versions: resumed sessions may reload uncompacted history, increasing context usage unexpectedly

macOS Orphaned Processes (Claude Code 2.1.46+)

Previously, disconnecting from a terminal on macOS could leave orphaned Claude Code processes running. This is now fixed in 2.1.46+. If you encounter stale CC processes on older versions, manually check and kill them:

# Find orphaned claude processes
ps aux | grep -i claude | grep -v grep

7. Automatic Memory (Claude Code 2.1.32+)

Claude now automatically records and recalls memories as it works. Session summaries, key results, and work logs are captured implicitly and recalled in future sessions. This provides passive cross-session continuity without manual checkpoint management.

  • No action required: Memory recording is automatic on first-party Anthropic API
  • Complements named sessions: Automatic memory handles implicit continuity; named sessions provide explicit organization
  • Token overhead: Recalled memories add to baseline context — factor this into MECW budgets

8. Agent Persistence on Resume (Claude Code 2.1.32+)

--resume now re-uses the --agent value from the previous conversation by default. Agent-specific workflows that are resumed will continue with the same agent configuration without needing to re-specify it.

# Start with a specific agent
claude --agent my-agent

# Resume later — my-agent is automatically used
claude --resume

See Also

  • /catchup - Refresh context from git changes
  • /clear - Start fresh session
  • Skill(sanctum:git-workspace-review) - Capture repo context
安全使用建议
This skill is a documentation-style helper for Claude Code session naming and resumption and appears internally consistent. It does assume you run it inside Claude Code and may call other Sanctum/Claude Code commands or skills (e.g., git-workspace-review, /debug). Before installing or using it: ensure you trust the Claude Code plugins it references (those other skills may access your workspace or repositories), keep sensitive data out of long-lived named sessions, and periodically clean old named sessions. No credentials are requested by this skill itself, but integrations like 'gh pr create' or other invoked skills may require tokens—review those plugins' permission needs before enabling them.
功能分析
Type: OpenClaw Skill Name: nm-sanctum-session-management Version: 1.0.0 The skill bundle contains documentation for managing Claude Code sessions, including naming, checkpointing, and resuming workflows. It consists of a metadata file and a Markdown guide (SKILL.md) that provides instructions for an AI agent to assist users with session management. There is no executable code or evidence of malicious intent, data exfiltration, or prompt injection attacks.
能力评估
Purpose & Capability
Name, description, and commands (e.g., /rename, claude --resume) align with session checkpointing and resume workflows. It does not request unrelated binaries, credentials, or config paths.
Instruction Scope
SKILL.md stays within session-management workflows but references other Claude Code commands/skills (e.g., Skill(sanctum:git-workspace-review), /catchup, /debug) and describes session file behavior (compaction, transcripts). These references are expected for a session manager but mean the skill effectively assumes a Claude Code environment and other plugins/tools may be invoked.
Install Mechanism
Instruction-only skill with no install spec and no code files—nothing is written to disk or downloaded by the skill itself.
Credentials
The skill declares no required environment variables, credentials, or config paths. Mentions of integrations (gh pr create, resume from PR) are descriptive and do not ask for GitHub tokens or other secrets.
Persistence & Privilege
always: false and user-invocable: true. The skill does not request permanent presence or elevated privileges; it relies on the host Claude Code runtime to perform resume actions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install nm-sanctum-session-management
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /nm-sanctum-session-management 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Session management skill for Claude Code, enabling named sessions, checkpointing, and seamless session resumption. - Provides commands for naming, checkpointing, and resuming sessions across workflows. - Supports advanced resume and debugging flows including PR-linked sessions, feature milestones, and investigations. - Improved resume experience: Grouped forks, keyboard shortcuts, session preview, and context enrichment. - Automatic memory (Claude Code 2.1.32+): Summaries and key results are recalled in future sessions. - macOS orphaned process issue resolved (Claude Code 2.1.46+). - Optimized performance and bug fixes for session resume, duplicate entries, and agent persistence on resume.
元数据
Slug nm-sanctum-session-management
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Nm Sanctum Session Management 是什么?

Manage Claude Code sessions with naming, checkpointing, and resume strategies. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 105 次。

如何安装 Nm Sanctum Session Management?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install nm-sanctum-session-management」即可一键安装,无需额外配置。

Nm Sanctum Session Management 是免费的吗?

是的,Nm Sanctum Session Management 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Nm Sanctum Session Management 支持哪些平台?

Nm Sanctum Session Management 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Nm Sanctum Session Management?

由 athola(@athola)开发并维护,当前版本 v1.0.0。

💬 留言讨论