skills/ → skills-dev(9), skills-req(10), skills-ops(4), skills-integration(8), skills-biz(4), skills-workflow(7) generate-marketplace.py 改为自动扫描所有 skills-* 目录。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.7 KiB
4.7 KiB
name, description
| name | description |
|---|---|
| session | Manage Claude Code sessions — save, reload, read, and search saved conversations. Triggers on /session commands or when user mentions saving session, reloading session, finding previous conversations, or continuing previous work. |
Session Management Skill
Save, reload, read, and search Claude Code sessions across conversations.
Commands
| Command | Description |
|---|---|
/session save |
Save current conversation with auto-generated title, summary, tags |
/session reload <id> |
Reload a session to continue working from where you left off |
/session read <id> |
View a session (read-only, no context load) |
/session search <query> |
Search sessions by keyword, tag, or date |
/session save
Auto-Save Mode
If triggered by <auto-save-trigger>, skip all confirmations and save immediately.
Steps
- Analyze conversation — main topics, problems solved, decisions made, files touched
- Generate title — 5–10 words, descriptive (e.g. "Implement JWT Authentication with Refresh Tokens")
- Generate summary with sections:
context: initial request or problemapproach: solution takenkeyChanges: main changes/implementationsoutcome: what was achievednextSteps: what remains (if any)
- Extract tags — 3–8 tags: technologies, task type, domain
- Get session ID — check
~/.claude/hooks/.current-session; if missing, useYYYY-MM-DD_HHmm - Filter conversation before saving:
- EXCLUDE: bash outputs, full file reads, tool results,
<system-reminder>tags, stack traces - INCLUDE: user requests, assistant reasoning, decisions, file paths modified, code changes summary
- EXCLUDE: bash outputs, full file reads, tool results,
- Save to
~/.claude/sessions/<id>_<sanitized-title>.json:{ "id": "YYYY-MM-DD_HHmm", "title": "...", "date": "ISO 8601", "timestamp": 1234567890, "tags": ["tag1", "tag2"], "summary": { "context": "...", "approach": "...", "keyChanges": "...", "outcome": "...", "nextSteps": "..." }, "metadata": { "messageCount": 0, "technologies": [], "filesModified": [] }, "conversation": [ { "role": "user|assistant", "content": "...", "toolSummary": "optional" } ] } - Update index
~/.claude/sessions/index.json— add entry, sort by date desc - Post-save — run
~/.claude/hooks/autosave-mark.sh, delete~/.claude/hooks/.pending-save - Confirm — show session ID, filename, title, tags
Output (manual mode)
Session saved!
ID: 2026-01-20_1430
Title: Implement Dark Mode Toggle Feature
Tags: react, css, ui, feature
File: ~/.claude/sessions/2026-01-20_1430_implement-dark-mode-toggle-feature.json
To reload: /session reload 2026-01-20_1430
Output (auto-save)
[Auto-saved] 2026-01-20_1430: "Implement Dark Mode Toggle Feature" (45 messages)
/session reload <id>
Load a session to continue working from where it left off.
Steps
- Resolve ID — accept exact ID, partial, or keywords; search index.json if ambiguous
- Load
~/.claude/sessions/<id>_<title>.json - Display context:
Loaded: [Title] Date: YYYY-MM-DD HH:mm (X days ago) | Tags: ... | Messages: N Files Modified: file1, file2 Context: ... Approach: ... Key Changes: ... Outcome: ... Next Steps: ... Session loaded. What would you like to work on? - Maintain context — reference session details, remember modified files, continue naturally
- Offer options based on Next Steps
/session read <id>
View a session without loading it as active context.
Steps
- Resolve ID (same as reload)
- Load and display — show metadata + summary by default
- Modes:
- Default: metadata + summary only
--full: full conversation history--messages N-M: specific message range
- End with actions: reload link, search link
/session search <query>
Search saved sessions.
Steps
- Load
~/.claude/sessions/index.json - Parse query — keywords, tags (
tag:react), dates (last week,January) - Search index first (fast); load individual files only for full-content search
- Display results (newest first, limit 10):
Found 3 sessions matching "react": 1. [2026-01-20_1430] Implement Dark Mode Toggle Feature Jan 20, 14:30 | react, css, ui Added dark mode toggle to application settings... To reload: /session reload <id> - If single result, offer to reload automatically
Query syntax
- Keywords:
search react authentication - Tag filter:
tag:bug-fix - Date:
last week,today,January 2026 - Boolean:
react AND jwt,react OR vue,react NOT bug - All:
list all sessions