用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill session-resume命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | session-resume |
| description | > Use when this capability is needed. |
Purpose: Verify session-skills permissions are configured to prevent repeated permission prompts.
Why this matters:
Implementation:
Run the permission check script:
"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/check_permissions.sh" "${PROJECT_ROOT:-$PWD}"
Script behavior:
When configuration needed:
The script outputs structured information:
session-* wildcards)Present configuration offer to user:
🔧 Session skills need one-time permission setup
[If missing file:]
No .claude/settings.local.json found. I'll create one with required permissions.
[If missing patterns:]
Missing required permissions ([count] patterns):
- Skill(session-closure)
- Skill(session-resume)
- [List other missing REQUIRED patterns]
[If old patterns found:]
Found deprecated patterns ([count] to remove):
- Bash(~/.claude/skills/session-closure/scripts/*)
- [List other FOUND_OLD patterns]
I can configure these automatically using this inline script:
[Show inline bash script that will be executed]
May I update .claude/settings.local.json to add these permissions?
After user approval, execute inline configuration script:
#!/bin/bash
# Inline permission configuration script
# Adds/updates .claude/settings.local.json with session-skills permissions
PROJECT_DIR="${PROJECT_ROOT:-$PWD}"
SETTINGS_FILE="$PROJECT_DIR/.claude/settings.local.json"
# Create .claude directory if needed
mkdir -p "$PROJECT_DIR/.claude"
# Required permission patterns
REQUIRED_PATTERNS='[
"Skill(session-closure)",
"Skill(session-resume)",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-closure}/scripts/check_permissions.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/check_permissions.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-closure}/scripts/check_uncommitted_changes.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-closure}/scripts/archive_resume.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-closure}/scripts/validate_resume.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-closure}/scripts/commit_resume.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/check_uncommitted_changes.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/list_archives.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/check_staleness.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Read(~/.claude/skills/session-closure/**)",
"Read(~/.claude/skills/session-resume/**)"
]'
# Old patterns to remove
OLD_PATTERNS=(
'Bash(~/.claude/skills/session-closure/scripts/*)'
'Bash(~/.claude/skills/session-resume/scripts/*)'
)
if [ ! -f "$SETTINGS_FILE" ]; then
# Create new settings file
cat > "$SETTINGS_FILE" <<EOF
{
"permissions": {
"allow": $REQUIRED_PATTERNS,
"deny": [],
"ask": []
}
}
EOF
-v jq >/dev/null 2>&1;
REQUIRED_JSON=$( | jq -c )
jq --argjson new \
\
> &&
After configuration:
Error handling:
Purpose: Allow projects to run custom preparation before the uncommitted changes check.
Why this matters:
Implementation:
Check for and run project hook if it exists:
HOOK_PATH="${PROJECT_ROOT:-$PWD}/.claude/hooks/session-pre-check.sh"
if [ -x "$HOOK_PATH" ]; then
"$HOOK_PATH" "${PROJECT_ROOT:-$PWD}"
fi
Hook location: .claude/hooks/session-pre-check.sh (project-level)
Hook contract:
Common use cases:
.pages, .numbers, temp files)Example hook (stash Apple Pages files):
#!/bin/bash
# .claude/hooks/session-pre-check.sh
# Stash Apple Pages files before session skills run
PROJECT_ROOT="${1:-$PWD}"
cd "$PROJECT_ROOT" || exit 1
# Find modified .pages files
PAGES_FILES=$(git status --porcelain | grep '\.pages$' | awk '{print $2}')
if [ -n "$PAGES_FILES" ]; then
echo "📦 Stashing Apple Pages files (autosave noise)..."
git stash push -m "session-pre-check: .pages files" -- $PAGES_FILES
echo "✓ Stashed. Will auto-pop after session skill completes."
fi
exit 0
If hook doesn't exist: Skip silently, proceed to Step 0.5
Error handling:
Purpose: Ensure clean git state before loading resume context.
Why this matters:
Implementation:
Run the uncommitted changes detection script:
"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/check_uncommitted_changes.sh" "${PROJECT_ROOT:-$PWD}"
Script behavior:
When changes detected (BLOCKING):
The script displays:
git status --short outputgit diff HEADRequired action when blocked:
When uncommitted changes are detected, you MUST commit them before proceeding. Follow the Git Commit Protocol (see below).
Process:
git add <files>Why blocking is necessary:
Error handling:
git statusLook for CLAUDE_RESUME.md (check both locations):
.claude/CLAUDE_RESUME.md (preferred, aligns with Claude Code patterns)CLAUDE_RESUME.md (legacy, project root)If CLAUDE_RESUME.md not found, check archives:
"${SKILL_BASE:-$HOME/.claude/skills/session-resume}/scripts/list_archives.sh" "${PROJECT_ROOT:-$PWD}" --format detailed
Script output:
Present to user:
📋 No current session resume found.
[Script output - archive list or "No previous sessions"]
Would you like to:
1. Start fresh (no resume needed)
2. Load a specific archive (if any exist)
Read CLAUDE_RESUME.md completely
Extract key sections:
Check Sync Status (if present):
Check Pending Outbound Handoffs (if present):
Present the resume to the user:
📋 Resuming from [Date] session:
[If Project Status present:]
**Project**: [Project name from resume title]
**Status**: [State emoji + description from Project Status]
**Last activity**: [One-line summary from resume]
[If Sync Status present and has stale dates:]
⚠️ Authoritative sources may need syncing:
- [Source]: Last synced [date] ([N] days ago)
[If Pending Outbound Handoffs present:]
📤 **Pending outbound handoffs**:
- [Destination]: [Summary] (sent [date], [N] days ago)
[If any >7 days: ⚠️ May need follow-up]
**Next focus**: [From "Next Session Focus" section]
**Pending tasks**: [Count] tasks remaining
[List top 3-5 tasks]
[If Key Decisions present: Highlight 1-2 key decisions]
Full context loaded. Ready to continue.
After presenting resume, offer:
Archive option (if desired):
Would you like to archive this resume to keep project clean?
(Moves to archives/CLAUDE_RESUME/ with timestamp)
Ready to work:
Ready to continue where you left off!
See CORE_PROCESSES.md § Git Commit Protocol for complete requirements.
Quick reference:
git commit -S -s -m "message"Hook enforcement (~/.claude/hooks/):
| Hook | Enforces |
|---|---|
| git-commit-compliance.py | -S -s flags, message quality (≥10 chars), no attribution |
| git-workflow-guidance.py | Separate git add from git commit |
Workflow when Step 0.5 blocks:
git status - See what's changedgit diff - Understand changesgit add <files> - Stage specific changesgit diff --staged - Review staged changesgit commit -S -s -m "..." - Commit with descriptive messageSession-resume skill v0.5.1 - Added pre-check hook, .claude/ location support, version sync (January 2026)
Source: christophera/claude_code_tools — distributed by TomeVault.