用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill session-cleanup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | session-cleanup |
| description | > Use when this capability is needed. |
Purpose: Verify session-cleanup permissions are configured to prevent repeated permission prompts.
Run the permission check script:
"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_permissions.sh" "${PROJECT_ROOT:-$PWD}"
Script behavior:
When configuration needed:
Present configuration offer to user:
🔧 Session-cleanup skill needs one-time permission setup
Missing required permissions:
- Skill(session-cleanup)
- [Other patterns from script output]
I can configure these automatically. May I update .claude/settings.local.json?
After user approval, execute inline configuration script:
#!/bin/bash
# Inline permission configuration for session-cleanup skill
PROJECT_DIR="${PROJECT_ROOT:-$PWD}"
SETTINGS_FILE="$PROJECT_DIR/.claude/settings.local.json"
mkdir -p "$PROJECT_DIR/.claude"
# Session-cleanup required permission patterns
REQUIRED_PATTERNS='[
"Skill(session-cleanup)",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_permissions.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_uncommitted_changes.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/detect_complexity.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/find_local_cleanup.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Bash(\"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_stale_planning.sh\" \"${PROJECT_ROOT:-$PWD}\")",
"Read(~/.claude/skills/session-cleanup/**)"
]'
if [ ! -f "$SETTINGS_FILE" ]; then
cat > "$SETTINGS_FILE" <<EOF
{
"permissions": {
"allow": $REQUIRED_PATTERNS,
"deny": [],
"ask": []
}
}
EOF
echo "✅ Created $SETTINGS_FILE with session-cleanup permissions"
else
if command -v jq >/dev/null 2>&1; then
REQUIRED_JSON=$(echo "$REQUIRED_PATTERNS" | jq -c '.')
jq --argjson new "$REQUIRED_JSON" \
'.permissions.allow = ([.permissions.allow[], $new[]] | unique)' \
"$SETTINGS_FILE" > ".tmp" &&
After configuration: Proceed to Step 0.5. Future sessions will skip this step.
Ensure clean git state before audit:
"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_uncommitted_changes.sh" "${PROJECT_ROOT:-$PWD}"
Script behavior:
When blocked: Commit changes first, then re-run "session cleanup".
Determine appropriate depth for session review:
"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/detect_complexity.sh" "${PROJECT_ROOT:-$PWD}"
Output determines depth:
Use the detected depth to calibrate Step 2 analysis.
Detect planning documents that may be abandoned or need completion:
"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/check_stale_planning.sh" "${PROJECT_ROOT:-$PWD}"
Script behavior:
When stale docs found:
The script identifies documents that haven't been updated in >30 days and suggests:
Add stale docs to the [ASK user] category in Step 2 - user decides disposition.
Why this matters: Planning docs are ephemeral by design. Stale docs indicate either:
See: CORE_PROCESSES.md § Transient Artifacts Overview for staleness thresholds.
Core of session-cleanup: Guided but flexible analysis.
Execute this ultrathink prompt, adjusting depth based on Step 1:
Ultrathink session review [DEPTH from Step 1]:
Consider these categories:
(a) Session continuity - did work match the plan/resume?
(b) Document staleness - any planning docs ready for deletion?
(c) File proliferation - any new files that should be integrated?
(d) Cross-references - any stale paths or broken links?
(e) Technical debt - any workarounds, TODOs, or deferred issues?
(f) Test coverage (BLOCKING) - if skills/hooks modified, were tests written?
- No deployment without tests (skill-deployment.md § Step 0)
- v1.7.3 shipped without tests - this is the anti-pattern to prevent
(g) Issue resolution - any GitHub issues resolved? Close with details.
(h) Marketplace changes (BLOCKING) - if marketplace.json modified:
- Schema validated against Claude Code docs?
- All keys recognized (no `tools`, etc.)?
- hooks/mcpServers use .json config format?
- Installation tested end-to-end?
- v1.7.2-1.7.4 had invalid schema - this is the anti-pattern to prevent
Categorize findings as:
- [EXECUTE now] - do before session closes
- [DEFER to next session] - capture in resume
- [ASK user] - need decision/clarification
Depth adjustments:
Output format:
## Session Review Findings
### [EXECUTE now]
- Item 1
- Item 2
### [DEFER to next session]
- Item 1
### [ASK user]
- Question 1
### Summary
[1-2 sentence summary of session state]
Quick coverage check (not re-analysis):
After completing Step 2, verify you addressed:
If any item missed, add to [EXECUTE now] or [DEFER] list.
Check for project-specific cleanup checklist:
"${SKILL_BASE:-$HOME/.claude/skills/session-cleanup}/scripts/find_local_cleanup.sh" "${PROJECT_ROOT:-$PWD}"
If local file found (checked in order):
.claude/processes/local-session-cleanup.md (preferred)claude/processes/local-session-cleanup.md (legacy)If no local file: Skip this step (generic cleanup complete).
Present findings and transition:
## Session Cleanup Complete
**Depth**: [light/standard/thorough]
**Findings**: [count] EXECUTE, [count] DEFER, [count] ASK
### Action Items
[List any [EXECUTE now] items to complete]
### For Resume
[List [DEFER] items to capture]
### Questions
[List [ASK] items needing user input]
---
When ready to close session, say "close context" or invoke session-closure.
Important: Session-cleanup does NOT auto-invoke session-closure (safety).
Session-cleanup skill v0.5.2 - Added category (h) marketplace validation (January 2026)
Source: christophera/claude_code_tools — distributed by TomeVault.