context-restore
Load a snapshot saved by /context-save and present it so this session can pick up where the last one left off without re-deriving decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Load a snapshot saved by /context-save and present it so this session can pick up where the last one left off without re-deriving decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | context-restore |
| description | Load a snapshot saved by /context-save and present it so this session can pick up where the last one left off without re-deriving decisions. |
| allowed-tools | ["Bash","Read","AskUserQuestion"] |
Reads the most recent (or named) /context-save snapshot and presents it to the agent + user so work resumes without losing the decisions and in-flight state captured before.
Adapted from garrytan/gstack/context-restore.
/compact if the trimmed context lost important task stateList available snapshots:
STATE_DIR="${CLAUDE_PROJECT_DIR}/.claude/state/context"
if [[ ! -d "$STATE_DIR" ]] || [[ -z "$(ls -A "$STATE_DIR" 2>/dev/null)" ]]; then
echo "No snapshots found. Use /context-save to create one."
exit 0
fi
ls -t "$STATE_DIR"/*.md 2>/dev/null | head -10
Pick which to restore. Default: most recent. If the user asks for a specific one (e.g., "restore the careerSystem snapshot"), match by filename slug. Use AskUserQuestion if more than one recent snapshot is plausible (within last 24h).
Read the picked snapshot and surface its key sections to the user, in this order:
Cross-check with current git state. Has the branch moved? Are the files-in-flight still showing as modified? If yes, surface as "still in flight." If no, ask: "the snapshot says you were editing X, but current git is clean — was that committed since?"
Optionally re-Read files-in-flight. Per harness-facts.md stale-file rule, if you're going to edit them, re-Read first.
| Trigger | Behavior |
|---|---|
/context-restore (no arg) | Load the most recent snapshot |
/context-restore <slug> | Load by filename slug (partial match OK) |
/context-restore list | Show all snapshots, don't restore — user picks next |
/context-restore clear | Delete all snapshots after confirmation (AskUserQuestion) |
After loading, summarize like:
Loaded: .claude/state/context/20260426-153012-tier2-impl.md (saved 2h ago)
In-flight: Implementing Tier 2 + Tier 3 picks from ecosystem review (#93)
Next step: Port refactoring-specialist subagent, run /context-budget, commit
Decisions carried over:
- Skipped pick #8 (TodoWrite sufficient for solo)
- effort: high only on /deep-review
- Dropped gstack telemetry scaffolding from port
Files in flight (1, all consistent with current git):
- Main/Features/CareerSystem/Services/CareerService.cs
Open questions: none
Surprises worth remembering: amend bypass was a real prevention-theater finding (now codified in harness-facts.md).
Ready to resume — say "continue" or specify a different next step.
/context-save — the writer side/compact — context-restore is what you run AFTER compact if you want the pre-compact decisions backAskUserQuestion.Author a culture's armor items and swap troop equipment rosters via the generator + validation pipeline. Use when adding/revamping armor. Enforces the canonical-folder + cover-attribute rules.
Give DOTS lords lore-driven skill values and traits via the DOTS SkillSet system. Use when a canonical lord has wrong stats or a culture roster needs a balance pass.
Author or revamp a DOTS culture's armor set, troop tree, and recruitment wiring end-to-end. Use for new cultures or troop-tree revamps. Follows docs/ai-includes/new-culture-authoring.md.
Use when reviewing an external repo or article to adopt practices into DOTS — security-vet first, map novel vs duplicative, port (never install), review, commit your changes.
Structured 4-phase self-debug for failing agent runs (looping, drifting, burning tokens). Capture, diagnose, contained recovery, report. Complements /investigate (which is for code bugs); this skill is for harness/agent failures.
Incrementally fix dotnet build errors with minimal diffs, one error at a time