关于 session-launcher
session-launcher 是用于延续 AI 对话工作的技能。它会搜索项目文件和记忆、恢复会话状态,并生成包含决策、阻碍、时间戳与链接的 HTML 面板。
主要功能
- 01搜索项目上下文文件
- 02加载记忆索引和过往决策
- 03恢复会话状态
- 04生成带链接的 HTML 面板
- 05呈现阻碍和时间锚点
适用场景
- 01在新对话中继续工作
- 02查看近期项目决策
- 03查找未解决阻碍和后续步骤
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ jackspace/ claudeskillz --skill session-launcher安装后在 Claude Code 中输入/session-launcher确认已加载。
附带文件SKILL.json
详细介绍
会话启动器
用途
确保不同对话之间不会丢失上下文。新会话开始时,此技能会:
- 搜索项目上下文文件
- 加载记忆索引和过往决策
- 读取会话状态
- 创建带有可操作链接的可视化仪表板
- 让你立即进入高效工作状态
适用于 SDAM 用户:通过外化所有会话上下文,弥补情景记忆缺失的问题。 适用于 ADHD 用户:消除“我刚才做到哪了?”的阻碍,让你立即继续工作。 适用于时间感知障碍患者:在所有上下文中显示明确的时间戳。
激活条件
- 用户说:“hi-ai”
- 用户说:“继续”“恢复上下文”“我刚才在做什么”
- 开始新对话时(主动提供)
核心工作流
1. 搜索上下文文件
按顺序检查以下位置:
# Current project context
./.context/current.json
./.context/session.json
./DECISIONS.md
./README.md
# User's memory storage
~/.claude-memories/ (Linux/macOS) or %USERPROFILE%\.claude-memories\ (Windows)index.json
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)current.json
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)projects/
2. 加载记忆索引
读取 ~/.claude-memories/ (Linux/macOS) or %USERPROFILE%\.claude-memories\ (Windows)index.json:
{
"total_memories": N,
"memories": [
{
"id": "unique-id",
"type": "DECISION|BLOCKER|CONTEXT|PREFERENCE|PROCEDURE",
"content": "the memory",
"timestamp": "ISO8601",
"tags": ["tag1", "tag2"],
"project": "project-name"
}
]
}
提取:
- 最近的决策(过去 7 天)
- 当前阻碍事项(状态 != "resolved")
- 项目上下文(与当前目录匹配)
- 用户偏好
3. 确定当前项目
通过以下方式确定项目:
- 当前工作目录名称
.context/project.txt(如果存在)- Git 仓库名称:
basename $(git rev-parse --show-toplevel 2>/dev/null) - 如果不明确,则询问用户
4. 创建会话仪表板
在 ~/.claude-artifacts/ (Linux/macOS) or %USERPROFILE%\.claude-artifacts\ (Windows)session-dashboard-{timestamp}.html 创建 HTML 文件:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Session Restored</title>
<style>
body {
font-family: monospace;
max-width: 1200px;
margin: 40px auto;
padding: 20px;
background: #1e1e1e;
color: #d4d4d4;
}
.section {
background: #252526;
border: 1px solid #3e3e42;
border-radius: 6px;
padding: 20px;
margin: 20px 0;
}
.section h2 {
margin-top: 0;
color: #4ec9b0;
border-bottom: 1px solid #3e3e42;
padding-bottom: 10px;
}
.timestamp {
color: #858585;
font-size: 0.9em;
}
.decision {
background: #2d2d30;
padding: 10px;
margin: 10px 0;
border-left: 3px solid #4ec9b0;
}
.blocker {
background: #2d2d30;
padding: 10px;
margin: 10px 0;
border-left: 3px solid #f48771;
}
.action {
display: inline-block;
background: #0e639c;
color: white;
padding: 8px 16px;
margin: 5px;
border-radius: 4px;
text-decoration: none;
}
.metric {
font-size: 2em;
color: #4ec9b0;
font-weight: bold;
}
</style>
</head>
<body>
<h1>🚀 Session Restored</h1>
<p class="timestamp">Restored at: {current_timestamp}</p>
<div class="section">
<h2>📁 Current Project</h2>
<div class="metric">{project_name}</div>
<p>Location: <code>{project_path}</code></p>
<p>Last worked: <span class="timestamp">{last_session_time}</span></p>
</div>
<div class="section">
<h2>🎯 Recent Decisions (Last 7 Days)</h2>
{for each recent decision:}
<div class="decision">
<strong>{decision.content}</strong>
<div class="timestamp">{decision.timestamp} - {relative_time}</div>
{if decision.tags:}<p>Tags: {tags_joined}</p>{endif}
</div>
{endfor}
</div>
<div class="section">
<h2>🚧 Active Blockers</h2>
{for each active blocker:}
<div class="blocker">
<strong>{blocker.content}</strong>
<div class="timestamp">{blocker.timestamp} - {relative_time}</div>
</div>
{endfor}
{if no blockers:}<p>✅ No active blockers</p>{endif}
</div>
<div class="section">
<h2>📊 Memory Stats</h2>
<p>Total memories: <span class="metric">{total_memories}</span></p>
<p>Decisions: {decision_count} | Blockers: {blocker_count} | Procedures: {procedure_count}</p>
</div>
<div class="section">
<h2>⚡ Quick Actions</h2>
<a href="file://~/.claude-memories/ (Linux/macOS) or %USERPROFILE%\.claude-memories\ (Windows)index.json" class="action">View All Memories</a>
<a href="file://{project_path}" class="action">Open Project</a>
<a href="file://~/.claude-artifacts/ (Linux/macOS) or %USERPROFILE%\.claude-artifacts\ (Windows)" class="action">View Artifacts</a>
</div>
</body>
</html>
5. 输出摘要
创建仪表板后,向用户输出:
🚀 Session Restored
📁 Project: {project_name}
📍 Location: {project_path}
🕐 Last worked: {relative_time}
📝 Recent Decisions ({count}):
{for each decision (max 5):}
• {decision.content} ({relative_time})
{endfor}
🚧 Active Blockers ({count}):
{for each blocker:}
• {blocker.content} ({relative_time})
{endfor}
💾 Memory: {total_memories} total memories loaded
📊 Dashboard: {dashboard_path}
✅ Full context restored. Ready to continue!
What would you like to work on?
记忆集成
读取记忆
始终检查记忆索引,查找:
- 项目专属上下文
- 用户偏好(技术栈、编码风格)
- 影响当前工作的过往决策
- 类似的过往问题/解决方案
时间锚定(适用于时间感知障碍患者)
将所有时间戳转换为相对格式:
- “2 小时前”
- “3 天前”
- “上周二”
- 同时包含 ISO 时间戳以确保精确性
上下文筛选
按以下条件筛选记忆:
- 项目匹配:
memory.project === current_project - 时效性:提高过去 30 天内记忆的权重
- 类型优先级:BLOCKER > DECISION > CONTEXT > PROCEDURE
- 相关性:如果有标签,则按标签匹配
会话状态管理
保存会话状态
结束对话前(如果用户说“再见”“回头见”“暂时到这里”):
- 创建/更新
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)current.json:
{
"project": "project-name",
"project_path": "/full/path",
"last_active": "ISO8601_timestamp",
"last_files": [
"/path/to/file1.js",
"/path/to/file2.py"
],
"last_topic": "Brief description of what we were working on",
"next_actions": [
"Suggested next step 1",
"Suggested next step 2"
]
}
- 使用会话摘要更新记忆索引:
{
"type": "NOTE",
"content": "Session ended: {brief_summary_of_work}",
"timestamp": "ISO8601",
"tags": ["session", "project-name"],
"project": "project-name"
}
项目专属会话
对于使用多个项目的用户,维护:
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)projects/
├── boostbox.json
├── toolhub.json
├── 88dimensions.json
└── mcp-stack.json
每个文件都包含项目专属状态。
可视化仪表板功能
适用于心盲症用户
始终提供:
- 具体指标(数字、计数)
- 可视化结构(HTML 仪表板)
- 明确的链接(可点击的文件路径)
- 状态指示(✅ ❌ 🚧 表情符号)
适用于 ADHD 用户
仪表板必须:
- 即时加载(<2 秒)
- 显示快捷操作(明确的下一步)
- 突出显示阻碍事项(醒目的红色/紧急视觉处理)
- 提供直接链接(单击即可访问文件)
适用于 SDAM 用户
仪表板必须:
- 外化所有上下文(不假设用户拥有记忆)
- 显示时间锚点(事件发生的时间)
- 展示决策历史(已做出的决定)
- 链接到产物(过往工作的证明)
错误处理
如果未找到上下文
👋 Hi! This looks like a fresh start.
I couldn't find existing session context, so let's establish some:
1. What project are you working on?
2. Should I create a memory index for you?
3. Would you like to start tracking decisions?
(I'll create the necessary directories and get you set up)
如果记忆索引损坏
⚠️ Memory index appears corrupted.
Creating backup at: ~/.claude-memories/ (Linux/macOS) or %USERPROFILE%\.claude-memories\ (Windows)backups/index-{timestamp}.json
Initializing fresh index...
✅ Fresh index created. Previous memories backed up.
如果检测到多个项目
🤔 I found context for multiple projects:
1. BOOSTBOX (last active: 2 days ago)
2. Tool Hub (last active: 5 days ago)
3. MCP Stack (last active: 1 week ago)
Which project would you like to work on?
与其他技能集成
记忆管理器
- 查询 memory-manager 以进行结构化记忆搜索
- 将复杂的记忆操作交由 memory-manager 处理
- 使用 memory-manager 的分类系统
上下文管理器
- 与 context-manager 协作维护
.context/目录 - 读取 context-manager 的结构化数据
- 通过 context-manager 更新会话状态
错误调试器
- 展示近期阻碍,供错误调试器参考
- 检查当前错误是否与过去的错误记忆相符
快速参考
文件位置
- 记忆索引:
~/.claude-memories/ (Linux/macOS) or %USERPROFILE%\.claude-memories\ (Windows)index.json - 当前会话:
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)current.json - 项目会话:
~/.claude-sessions/ (Linux/macOS) or %USERPROFILE%\.claude-sessions\ (Windows)projects/{name}.json - 仪表板:
~/.claude-artifacts/ (Linux/macOS) or %USERPROFILE%\.claude-artifacts\ (Windows)session-dashboard-*.html
触发短语
- “hi-ai”(主要触发词)
- “继续”
- “恢复上下文”
- “我之前在做什么”
- “我们上次进行到哪里了”
成功标准
✅ 用户说“hi-ai”后立即进入高效工作状态 ✅ 无需解释“我们之前在做什么” ✅ 所有过往决策一目了然 ✅ 显示当前阻碍 ✅ 在 2 秒内恢复上下文
评论
支持 Markdown