🎁 Get the FREE AI Skills Starter Guide — Subscribe →
BytesAgainBytesAgain
🦀 ClawHub

Claude Session

by @drumrobot

Claude Code session management. Topics — id (current session UUID), list (enumerate sessions), search (keyword + result validation), import, summarize, analy...

Versionv0.3.0
Downloads2,206
TERMINAL
clawhub install claude-session

📖 About This Skill


name: claude-session metadata: author: es6kr version: "0.1.4" description: Integrated skill for Claude Code session management. id - look up current session ID + keyword session search, import - import session, summarize - summarize session, analyze - session stats/analysis, classify - classify/organize sessions, compress - compress session, destroy - delete current session, migrate - move sessions between projects (main repo to worktree), move - move specific sessions by ID to another project + update cwd [move.md], repair - restore session structure (chain, tool_result), rename - assign custom title to session, url - generate claude-sessions web URL from session ID, Use when: "session ID", "current session", "session id", "get session", "session analysis", "session classify", "session compress", "session delete", "session repair", "chain repair", "session name", "name session", "session search", "find session", "which session", "session import", "session analyze", "session classify", "session compress", "session migrate", "session move", "move session to project", "update session cwd", "worktree session", "move session", "worktree session move", "session repair", "session rename", "chain repair", "session url", "session web URL", "claude-sessions url", "session split", "split recommendations", "topic split", "session purge", "dead session", "clean dead sessions", "session cleanup"

Session

Integrated skill for managing Claude Code sessions.

Topics

| Topic | Description | Guide | |-------|-------------|-------| | analyze | Session statistics, tool usage patterns, optimization insights | analyze.md | | classify | Classify project sessions (delete/keep/extract) | classify.md | | split | Analyze topic boundaries and recommend session split points | split.md | | compress | AI-compress sessions via UTCP/code-mode | compress.md | | destroy | Delete current session and restart IDE | destroy.md | | id | Look up current session ID (UUID) | id.md | | import | Pipeline session data to other agents/skills | import.md | | migrate | Move sessions between projects (main repo → worktree) | migrate.md | | move | Move specific sessions by ID to another project + update cwd | move.md | | purge | Delete dead sessions (hook-only, no assistant response) permanently | purge.md | | rename | Assign and look up custom title for session | rename.md | | repair | Restore session structure (chain, tool_result, UUID) | repair.md | | summarize | View and summarize conversation content from other sessions | summarize.md | | url | Generate claude-sessions web URL from session ID | url.md |

Quick Reference

Summarize (View/Summarize Sessions)

/session summarize                 # select project/session then summarize
/session summarize     # summarize a specific session

Detailed guide

Import (Pipeline Delivery)

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

Detailed guide

Analyze (Session Analysis)

/session analyze                   # analyze current session
/session analyze       # analyze specific session
/session analyze --sync            # sync to Serena memory

Detailed guide

Split (Topic Split Recommendation)

/session split                     # Recommend split for current conversation
/session split         # 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.

Detailed guide

Move (Move Specific Sessions by ID)

/session move                     # default: AskUserQuestion for cwd mode
/session move   --cwd-mode all    # update all cwd occurrences
/session move   --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           # 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     # compress specific session
/session compress                 # batch compress sessions containing "hookEvent":"Stop"

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

Detailed guide

ID (Session ID Lookup + Keyword Search)

/session id                          # look up current session ID
/session id Makefile remove          # search sessions by keyword
/session id --today ansible/Makefile # search only today's sessions by file path

Current session ID: output unique marker → search JSONL with find-session-id.sh → return UUID Keyword search: grep project JSONL → sort by modification time descending → return most recent matching session

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      # 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              # 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)

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

    Assign a name to the latest session in the current project

    bash scripts/rename-session.sh "name"

    Check current title

    bash scripts/rename-session.sh --show

    List named sessions in current project

    bash scripts/rename-session.sh --list

    Detailed guide

    Project Name Conversion Rules

    | Actual Path | Project Name | |-------------|--------------| | /Users/user/works/.vscode | -Users-user-works--vscode | | /Users/user/Sync/AI | -Users-user-Sync-AI |

    Rule: / → -, remove leading / from path

    Requirements

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