一键导入
reanchor
Re-initializes session context after context overflow restart. Internal skill - invoked by session.sh restart.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Re-initializes session context after context overflow restart. Internal skill - invoked by session.sh restart.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | reanchor |
| description | Re-initializes session context after context overflow restart. Internal skill - invoked by session.sh restart. |
| version | 2 |
| tier | lightweight |
| trigger | internal |
Re-initializes session context after context overflow restart.
[!!!] THIS IS A RECOVERY SKILL -- Follow the protocol EXACTLY.
[!!!] CRITICAL BOOT SEQUENCE:
~/.claude/directives/COMMANDS.md, ~/.claude/directives/INVARIANTS.md, and ~/.claude/directives/TAGS.md.¶INV_SKILL_PROTOCOL_MANDATORY.Output this block in chat with every blank filled:
Boot proof:
- COMMANDS.md — §CMD spotted:
________- INVARIANTS.md — ¶INV spotted:
________- TAGS.md — §FEED spotted:
________
[!!!] If ANY blank above is empty: STOP. Go back to step 1 and load the missing file. Do NOT read Phase 1 until every blank is filled.
Arguments:
--session: Session directory path--skill: Original skill to resume--phase: Phase to resume at--continue: Auto-continue execution after reanchoring (no pause for user)Role: You are the Session Restorer.
Goal: Re-initialize a skill session after context overflow restart, then resume work at the saved phase.
Trigger: Invoked automatically by session.sh restart when context overflows.
Action: Before doing anything, announce your recovery plan.
Output this blockquote:
Context Overflow Recovery
Reanchoring session after context overflow restart:
- Session:
[SESSION_DIR]- Skill:
[SKILL]- Resuming at:
[PHASE]- Mode:
[--continue present ? "Auto-continue" : "Manual"]I will now:
- Activate session and load standards
- Read dehydrated context
- Load required files and skill protocol
- Log the restart entry
- Reinstate logging discipline (critical -- fresh context loses muscle memory)
- Resume at
[PHASE]
Action: Re-register this Claude process with the session.
engine session activate [SESSION_DIR] [SKILL]
Announce: "Reanchoring session: [SESSION_DIR]"
Action: Load the core standards into context. These are required for all skills.
Files to Read (in order):
~/.claude/directives/COMMANDS.md -- Command definitions~/.claude/directives/INVARIANTS.md -- System invariants.claude/directives/INVARIANTS.md -- Project invariants (if exists)Action: Load the dehydrated context to understand where we left off.
File: [SESSION_DIR]/DEHYDRATED_CONTEXT.md
Extract from dehydrated context:
Action: Load all files listed in the "Required Files" section of dehydrated context.
Path Conventions (resolve correctly):
| Prefix | Location | Example |
|---|---|---|
~/.claude/ | User home | ~/.claude/skills/refine/SKILL.md -> shared engine |
.claude/ | Project root | .claude/directives/INVARIANTS.md -> project-local config |
sessions/ | Project root | sessions/2026_02_05_FOO/REFINE_LOG.md -> session artifacts |
WARNING: ~/.claude/ is not .claude/. If a file is not found, do NOT blindly swap prefixes -- check which is correct for that file type.
Priority Order:
_LOG.md, _PLAN.md, DETAILS.mdSkill Templates by Type:
implement: ~/.claude/skills/implement/assets/TEMPLATE_IMPLEMENTATION_LOG.md, TEMPLATE_IMPLEMENTATION.md, TEMPLATE_IMPLEMENTATION_PLAN.mdanalyze: ~/.claude/skills/analyze/assets/TEMPLATE_ANALYSIS_LOG.md, TEMPLATE_ANALYSIS.mdfix: ~/.claude/skills/fix/assets/TEMPLATE_FIX_LOG.md, TEMPLATE_FIX.mdbrainstorm: ~/.claude/skills/brainstorm/assets/TEMPLATE_BRAINSTORM_LOG.md, TEMPLATE_BRAINSTORM.mdtest: ~/.claude/skills/test/assets/TEMPLATE_TESTING_LOG.md, TEMPLATE_TESTING.mdAction: Load the original skill's protocol so you know how to continue.
File: ~/.claude/skills/[SKILL]/SKILL.md
Examples:
~/.claude/skills/implement/SKILL.md~/.claude/skills/analyze/SKILL.md~/.claude/skills/fix/SKILL.mdNote: In v2, the protocol is inline in SKILL.md. There is no separate references/ file.
Action: Skip to the phase specified in arguments.
DO NOT:
DO:
_LOG.md:
~/.claude/scripts/log.sh [SESSION_DIR]/[SKILL_UPPER]_LOG.md <<'EOF'
## [YYYY-MM-DD HH:MM:SS] Context Overflow Restart
* **Resumed At**: [PHASE]
* **Last Action**: [from dehydrated context]
* **Next Steps**: [from dehydrated context]
EOF
engine session phase [SESSION_DIR] "[PHASE]"Announce: "Reanchored: [SESSION_DIR] -- resuming [SKILL] at [PHASE]"
[!!!] CRITICAL: Fresh context means you've lost the logging muscle memory. Reinstate it NOW.
Action: Before doing ANY work, acknowledge the logging rules you MUST follow.
Output this blockquote verbatim:
Logging Discipline Reinstated
I will obey
§CMD_APPEND_LOG_VIA_BASH_USING_TEMPLATEto§CMD_THINK_IN_LOG:
- Log File:
[SESSION_DIR]/[SKILL_UPPER]_LOG.md- Cadence: Every 3-4 tool calls, log a status update
- Format: Use the log template schemas from
TEMPLATE_[SKILL]_LOG.md- Timestamps: Every entry header starts with
[YYYY-MM-DD HH:MM:SS]- Blind Write: Do NOT re-read the log file. Trust the append.
Thought Triggers (review before each tool call):
- Starting something? -> Log it
- Hit an error? -> Log it
- Made a choice? -> Log it
- Stuck? -> Log it
- Succeeded? -> Log it
Constraint: If you make 3+ tool calls without logging, you are failing the protocol.
Action: After rehydration is complete, report intent for the RESUMED skill.
Output this blockquote:
Resuming
[SKILL]at[PHASE]Context restored from:
DEHYDRATED_CONTEXT.md
- Ultimate Goal: [from dehydrated context]
- Last Action: [from dehydrated context]
- Next Steps: [from dehydrated context]
Continuing now...
Auto-Continue (if --continue flag is present):
Manual Mode (if --continue flag is NOT present):
/dehydrate restart again.Session: [SESSION_DIR]
Skill: [SKILL]
Phase: [PHASE]
Log: [SESSION_DIR]/[SKILL_UPPER]_LOG.md
Dehydrated: [SESSION_DIR]/DEHYDRATED_CONTEXT.md
LOGGING CHECKLIST (ask yourself constantly):
- Did I log what I'm about to do?
- Did I log the result?
- Has it been 3+ tool calls since my last log entry?
Thorough analysis of code, architecture, or topics — produces a structured research report. Supports goal-based modes: Explore (general research), Audit (risk-focused critique), Improve (actionable suggestions), Custom (user-defined lens). Triggers: "analyze this code", "deep dive into", "research this topic", "investigate how X works", "audit this", "critique this", "suggest improvements", "find risks in".
Structured ideation and trade-off analysis for design and architecture decisions. Triggers: "brainstorm ideas", "explore this problem", "think through trade-offs", "challenge assumptions", "discuss architecture".
Executes routine maintenance and cleanup tasks from a structured task queue. Triggers: "do some chores", "housekeeping tasks", "small cleanup tasks", "work through a task queue".
Drives feature implementation following structured development protocols. Triggers: "implement this feature", "build this", "write the code", "TDD implementation", "execute the plan".
Iterative prompt and schema refinement using TDD methodology for LLM workloads. Triggers: "refine the prompt", "improve extraction", "iterate on schema", "prompt TDD", "tune the model".
Reviews and validates work across sessions for consistency and correctness. Triggers: "review session work", "validate debriefs", "approve session reports", "end-of-day review".