用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/joshka0/foxctl --skill session-restore命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | Session Restore |
| description | Restore context from a saved session to continue work |
Restores session state after context compaction with context injection.
This skill runs automatically via the SessionStart hook, but can be invoked manually:
foxctl run session/restore --input '{"trigger": "compact"}'
The skill injects a markdown context block containing:
~/.claude/plans/| Parameter | Type | Description |
|---|---|---|
trigger | string | Source: compact, resume, startup |
workspace | string | Project workspace path (default: cwd) |
{
"hook_output": {
"decision": "approve",
"reason": "Restored session snapshot from 5m ago",
"context": "## Session Continuity Context\n...",
"env": {
"FOXCTL_SESSION_RESTORED": "true",
"FOXCTL_SNAPSHOT_ID": "snap-1234567890"
}
},
"snapshot_id": "snap-1234567890",
"snapshot_age": "5m",
"items_restored": 4
}
The session-restore.sh hook runs on SessionStart events:
{
"matcher": "compact|resume",
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-restore.sh"
}]
}
--force.running); terminal statuses set
ended_at, non-terminal clear it on reopen.~/.foxctl/sessions/active/<workspace_hash>.json
(stores session_id, agent_id, lineage) for hooks without env access.FOXCTL_SESSION_ID, FOXCTL_AGENT_ID + fallbacks
(CLAUDE_SESSION_ID, OPENCODE_SESSION_ID, CURSOR_SESSION_ID,
TERM_SESSION_ID) are forwarded by exec/WASI runners so restored sessions
attribute correctly.foxctl sessions chain --session <id>; trajectories
store session_id for joins.The injected context follows this structure:
## Session Continuity Context
_Restored after compact (snapshot from 5m ago)_
### Active Plan
**Plan Title** (`plan-file.md`) Sections:
- Section 1
- Section 2
### Active Task
**Task Title** (ID: 01ABC...) Task description here
### Pending Work
- :hourglass: Pending task
- :arrows_counterclockwise: In-progress task
### Gotchas & Learnings
- **Task**: Important learning
---
_Continue where you left off._
基于 SOC 职业分类