← 返回
未分类 中文

Claude Session

Claude Code session management. Topics — id (current session UUID), list (enumerate sessions), search (keyword + result validation), import, summarize, analy...
Claude Code session management. Topics — id (current session UUID), list (enumerate sessions), search (keyword + result validation), import, summarize, analy...
drumrobot
未分类 clawhub v0.3.0 3 版本 100000 Key: 无需
★ 0
Stars
📥 642
下载
💾 1
安装
3
版本
#latest

概述

Session

Integrated skill for managing Claude Code sessions.

Topics

TopicDescriptionGuide
---------------------------
analyzeSession statistics, tool usage patterns, optimization insightsanalyze.md
archiveMove a completed session out of the active project key to ~/.claude/projects/.bak/_.jsonl (flat naming, single backup root)archive.md
classifyClassify project sessions (delete/keep/extract)classify.md
splitAnalyze topic boundaries and recommend session split pointssplit.md
compressAI-compress sessions via UTCP/code-modecompress.md
destroyDelete current session and restart IDEdestroy.md
idLook up current session ID (UUID)id.md
importPipeline session data to other agents/skillsimport.md
installRegister session-id-inject hook in settings.jsoninstall.md
listEnumerate current-project sessions (UUID + mtime + size)list.md
migrateMove sessions between projects (main repo → worktree)migrate.md
moveMove specific sessions by ID to another project + update cwdmove.md
purgeDelete dead sessions (hook-only, no assistant response) permanentlypurge.md
renameAssign and look up custom title for sessionrename.md
repairRestore session structure (chain, tool_result, UUID)repair.md
searchKeyword session search with result validation (verb/path/class checks)search.md
summarizeView and summarize conversation content from other sessionssummarize.md
urlGenerate claude-sessions web URL from session IDurl.md

Quick Reference

Summarize (View/Summarize Sessions)

/session summarize                 # select project/session then summarize
/session summarize <session_id>    # summarize a specific session

Detailed guide

Import (Pipeline Delivery)

/session import --hookify          # deliver to hookify
/session import --analyze          # analysis pipeline
/session import --to <agent>       # deliver to specific agent

Detailed guide

Analyze (Session Analysis)

/session analyze                   # analyze current session
/session analyze <session_id>      # analyze specific session
/session analyze --sync            # sync to Serena memory

Detailed guide

Archive (Move Session Out of Active Project)

/session archive <session_id>                                     # move to ~/.claude/projects/.bak/<project-key>_<uuid>.jsonl
bash ~/.claude/skills/claude-session/scripts/archive-session.sh <session_id>           # direct script call
bash ~/.claude/skills/claude-session/scripts/archive-session.sh <session_id> --dry-run # preview only

Moves to ~/.claude/projects/.bak/_.jsonl (flat naming, single backup root shared with transient backups). UUID portion preserved unchanged. Updates INDEX.md ledger.

Detailed guide

Split (Topic Split Recommendation)

/session split                     # Recommend split for current conversation
/session split <session_id>        # Recommend split for specific session
/session split --execute           # Execute recommendation immediately

Detailed guide

Classify (Session Classification)

/session classify                  # classify current project sessions
/session classify --depth=medium   # required when classifying sessions scheduled for split
/session classify --execute        # execute immediately after classification

> ⚠️ --depth=medium or higher required before split — fast only reads the last 3 messages, so it may miss different topics at the end of the session.

> 🔍 RAG MCP auto-detection — If a vector store MCP (Qdrant / Chroma / Weaviate / Pinecone / etc.) is registered in the current context, classify additionally recommends sessions worth saving to RAG. Vendor-agnostic — uses whichever store tool is detected. See Section 8 of classify.md.

Detailed guide

Move (Move Specific Sessions by ID)

/session move <session_id> <target_project_path>                   # default: --cwd-mode first
/session move <session_id> <target_project_path> --cwd-mode all    # update all cwd occurrences
/session move <session_id> <target_project_path> --cwd-mode first  # update only first cwd

Move explicit session IDs to another project directory and update cwd references via Python script. Cross-platform (Windows + macOS/Linux). Unlike migrate, no classification — just direct move.

Detailed guide

Migrate (Move Sessions Between Projects)

/session migrate                           # classify + move code sessions to worktree
/session migrate --dry-run                 # preview only
/session migrate <source> <target>         # specify source/target projects

Classifies sessions as CODE/INFRA/TINY/READ, then moves CODE sessions to worktree project and optionally deletes TINY sessions.

Detailed guide

Compress (Session Compression)

/session compress <session_id>    # compress specific session
/session compress                 # batch compress sessions containing "hookEvent":"Stop"

Register claude-sessions-mcp with UTCP, then call via code-mode.

Detailed guide

List (Enumerate Current-Project Sessions)

/session list                       # list current-project sessions (UUID + mtime + size)
/session list --all-projects        # summary across all projects
/session list --limit 20            # top N by mtime

Non-destructive enumeration. For categorization or cleanup, use classify or purge instead.

Detailed guide

ID (Current Session ID Lookup)

/session id                          # look up current session ID

Current session ID — fast path (handle here, do NOT read id.md):

  1. Hook injection (preferred) — Look for Current session ID: {uuid} in conversation context. SessionStart hook ~/.claude/hooks/session-id-inject.sh injects it as additionalContext at session start. If present, return the UUID immediately.
  2. File path UUIDs — Scan recent tool results for UUID pattern [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} in subagent/task/transcript paths. Return if found.
  3. Marker fallback — Only if 1 & 2 fail: read id.md for the marker→grep procedure.

Detailed guide

Search (Keyword Session Search)

/session search Makefile remove          # find sessions by keyword
/session search --today ansible/Makefile # only sessions modified today
/session id <keyword>                    # legacy alias — routed to search

Always run the result-validation gate (verb ambiguity, artifact location, action class) before reporting matches as the answer to "which session did X" — a misplaced artifact path is a "task orphaned" signal, not a successful match.

Detailed guide

Destroy (Delete Session)

scripts/destroy-session.sh

Detailed guide

Purge (Dead Session Cleanup)

/session purge                    # dry-run: list dead sessions in current project
/session purge <project_name>     # dry-run: specific project
/session purge --all              # dry-run: all projects

Dead session = 10 lines or fewer + no "type":"assistant" response.

Script: scripts/purge-dead-sessions.sh [--delete]

Detailed guide

Repair (Session Recovery)

/session repair                          # select session, then validate and repair
/session repair <session_id>             # repair specific session
/session repair --dry-run                # preview only
/session repair --check-only             # validate only (no repair)

Repair targets:

  • Broken chain (missing parentUuid)
  • Orphan tool_result (no matching tool_use)
  • Duplicate UUIDs

Detailed guide

Rename (Naming a Session)

Current session → output a copyable /rename list (NO script, NO AskUserQuestion):

Session name suggestions:

1. `/rename Candidate 1`
2. `/rename Candidate 2`
3. `/rename Candidate 3`

/rename is a Claude Code built-in command — it cannot be invoked via Bash or the Skill tool. The user copies and pastes the desired line. Do NOT call rename-session.sh for the current session (it is reserved for other sessions by ID).

Other session (session ID specified) → apply via script:

# Assign a name to a specific session
bash scripts/rename-session.sh <session_id> "name"

# Check current title
bash scripts/rename-session.sh --show <session_id>

# List named sessions in current project
bash scripts/rename-session.sh --list

Detailed guide

Project Name Conversion Rules

Actual PathProject Name
---------------------------
/Users/es6kr/works/.vscode-Users-es6kr-works--vscode
/Users/es6kr/Sync/AI-Users-es6kr-Sync-AI

Rule: all non-alphanumeric characters → - (i.e., replace(/[^a-zA-Z0-9]/g, '-'))

Requirements

  • claude-sessions-mcp MCP server required
  • Serena MCP server (when using analyze --sync)

版本历史

共 3 个版本

  • v0.3.0 当前
    2026-06-03 12:59
  • v0.1.6
    2026-05-21 12:57 安全 安全
  • v0.1.4
    2026-05-03 05:58 安全 安全

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

Commit Tidy

drumrobot
分析暂存/已提交变更,推荐拆分或压缩策略;interactive-amend - 基于工作树的 amend+rebase 循环,用于处理领先于 HEA 的提交...
★ 1 📥 585

Tdd

drumrobot
用于编码和缺陷修复的测试驱动开发(TDD),包括 Red→Green→Refactor 循环、预期行为定义、缺陷修复 TDD、反模式 [cycle.md]、运行...
★ 0 📥 1,173

Repo

drumrobot
项目初始化工具集。贡献 - 根据项目结构自动生成 CONTRIBUTING.md [contributing.md]。可使用 “init”、 “project init”、 “initialize pr...”
★ 1 📥 678