| name | deep-resume |
| description | Use when the user wants to resume an active deep-work session โ restoring context from previous artifacts and continuing from the current phase. Triggers on `/deep-resume`, "resume session", "deep-work ์ด์ด์", "์ธ์
์ฌ๊ฐ", "์ด์ ์์
๊ณ์", or when interrupted mid-phase. Detects active session via env var โ pointer file โ legacy fallback, restores worktree context, migrates state if version-bumped, clears phase cache, and dispatches to the per-phase resume skill. Supports `--session=<id>`, `--resume-from=<phase>`, `--worktree=<path>`. |
| user-invocable | true |
Invocation
์ด ์คํฌ์ ๋ ๊ฐ์ง ๊ฒฝ๋ก๋ก ํธ์ถ๋ฉ๋๋ค โ ์ด๋ ์ชฝ์ด๋ ๋ณธ SKILL ๋ณธ๋ฌธ์ ์ ์ฐจ๋ฅผ ๊ทธ๋๋ก ์คํํฉ๋๋ค:
- Claude Code ์ฌ๋์ โ ์ฌ์ฉ์๊ฐ
/deep-resume [args...] ์
๋ ฅ (skill ์ user-invocable: true ๊ฐ ์ฌ๋์ ์ง์
์ ํ์ฉ).
- ํ ์์ด์ ํธ / Codex / Copilot CLI / Gemini CLI / SDK โ
Skill({ skill: "deep-work:deep-resume", args: "..." }) ํํ๋ก ๋ช
์ invoke (cross-platform ํ์ค ๊ฒฝ๋ก).
๋ ๊ฒฝ๋ก ๋ชจ๋ args ๋ ๋์ผํ ํ ํฐ ๋ฌธ์์ด๋ก ์ ๋ฌ๋๋ฉฐ, ๋ณธ๋ฌธ ($ARGUMENTS ์๋ฆฌ) ์ ํ์๊ฐ ๋์ผํ๊ฒ ์ฒ๋ฆฌํฉ๋๋ค.
Inputs (skill args)
| ์ธ์ | ์๋ฏธ |
|---|
| (์์) | Auto-detect active session + ํ์ฌ phase resume |
--session=<id> | ๋ช
์ ์ธ์
ID resume |
--resume-from=<phase> | `brainstorm |
--worktree=<path> | worktree ๊ฒฝ๋ก ๋ช
์ |
๋น args / ๋งค์นญ๋์ง ์๋ ํ ํฐ โ ๋ณธ๋ฌธ์ default ๋ถ๊ธฐ๋ก ์ง์
.
Prerequisites
์ด entry skill ์ deep-work-orchestrator (Phase dispatch) ๋ฐ deep-work-workflow (reference skill โ Phase ๊ท์ฝ/Exit Gate/M3 envelope) ์ ํจ๊ป ๋์ํฉ๋๋ค. ํ์ฑ deep-work ์ธ์
์ด ์์ ๋๋ ์ธ์
state file (.claude/deep-work.<SESSION_ID>.md) ์ ๋ณ์ (work_dir, current_phase, active_slice ๋ฑ) ๋ฅผ ์ฝ์ด ๋์ํ๋ฉฐ, ์ธ์
์ธ๋ถ์์๋ standalone ์คํ์ด ๊ฐ๋ฅํ ๊ฒฝ์ฐ ๋ณธ๋ฌธ์ ๋ถ๊ธฐ๋ฅผ ๋ฐ๋ฆ
๋๋ค.
Cross-platform self-containment: Claude Code ์์๋ sibling skill ์ด description ๋งค์นญ์ผ๋ก ์๋ ๋ก๋๋ฉ๋๋ค. Codex / Copilot CLI / Gemini CLI / Agent SDK ์์ Skill() ๋ก ํธ์ถ ์ sibling auto-load ๋ณด์ฅ์ด ์ฝํ ์ ์์ผ๋ฏ๋ก, ๋ณธ๋ฌธ์ self-contained ์ผ๋ก ๋ณด์กด๋์ด ์์ต๋๋ค โ state file ํด์, $ARGUMENTS ํ์ฑ, AskUserQuestion ๋ถ๊ธฐ, ์ถ๋ ฅ ํฌ๋งท์ด ์ธ๋ผ์ธ.
Utility (v6.2.4) โ standalone ๋ช
๋ น. /deep-work init์ stale ์ธ์
๊ฐ์ง๋ง ์ํํ๋ฉฐ, active ์ธ์
์ ํยทworktree ์ปจํ
์คํธ ๋ณต์ยทstate ๋ง์ด๊ทธ๋ ์ด์
ยทphase cache ์ ๋ฆฌยทphase๋ณ resume dispatch๋ ์ด ์ปค๋งจ๋๊ฐ ์ ์ผํ ๊ฒฝ๋ก์
๋๋ค.
ํฅํ ๊ธฐ๋ฅ ์ด๊ด ํ ์ญ์ ์์ (spec ยง7 follow-up).
v6.4.2: parse-deep-work-flags ํ์๊ฐ --session=<id>, --resume-from=brainstorm (๋ฐ research|plan|implement|test), --worktree=<path> ํ๋๊ทธ๋ฅผ ์ง์ํฉ๋๋ค.
Deep Work Session Resume
You are resuming an active Deep Work session โ restoring context from previous artifacts and continuing from the current phase.
Language
Detect the user's language from their messages or the Claude Code language setting. Output ALL user-facing messages in the detected language. The display templates below use Korean as the reference format โ translate naturally to the user's language while preserving emoji, formatting, and structure. Do NOT mix languages within a single message.
Instructions
1. Detect active session & extract WORK_DIR (multi-session aware)
Resolve the session to resume using the following priority:
1a. Direct session ID (env var)
If DEEP_WORK_SESSION_ID environment variable is set:
- Read
.claude/deep-work.${DEEP_WORK_SESSION_ID}.md directly
- If the file exists and
current_phase is not idle: proceed to Step 1.5 with this session
- If the file doesn't exist or phase is
idle: fall through to 1b
1b. Registry-based session discovery
Read the registry (.claude/deep-work-sessions.json). Filter to sessions where current_phase is NOT idle.
If no active sessions in registry:
- Check for legacy fallback: read
.claude/deep-work.local.md
If exactly 1 active session in registry:
- Auto-select this session
- Update the pointer file:
write_session_pointer SESSION_ID
- Read
.claude/deep-work.${SESSION_ID}.md
- Proceed to Step 1.5
If 2+ active sessions in registry:
- Present selection UI using AskUserQuestion:
์ฌ๊ฐํ ์ธ์
์ ์ ํํ์ธ์:
1. [SESSION_ID] [task_description] ([current_phase], [last_activity])
2. [SESSION_ID] [task_description] ([current_phase], [last_activity])
...
- After user selects a session:
- Update the pointer file:
write_session_pointer SELECTED_SESSION_ID
- Read
.claude/deep-work.${SELECTED_SESSION_ID}.md
- Proceed to Step 1.5
1c. Extract state
From the resolved state file, extract current_phase, work_dir, task_description, started_at, team_mode, plan_approved, test_retry_count, max_test_retries, preset, evaluator_model, assumption_adjustments, skipped_phases, plan_review_retries, and auto_loop_enabled from the YAML frontmatter.
์ ๊ท state ํ๋ ๋ณต์ (v6.12)
-
Read(../shared/references/model-routing-guide.md#model-routing-state-decode-v612)๋ก
decodedRouting/decodedRoutingMeta๋ฅผ ๋ณต์ํ๋ค.
-
methodology_policy_json๊ณผ review_execution_json์ ๊ฐ๊ฐ JSON.parseํด policy mode,
risk class, review mode override, floor baseline, channels, human ack,
external change lock, risk acceptances๋ฅผ ๋ณต์ํ๋ค. ๋ถ์ฌ/์์์ {}๋ก fail-openํ๊ณ
๊ธฐ์กด ์ธ์
๊ธฐ๋ณธ๊ฐ์ ์ ์งํ๋ค.
-
risk_profile_json, policy_shadow_json, slice_risk_shadow_json๋ ๊ฐ์ JSON-string
๊ท์น์ผ๋ก ๋ณต์ํ๋ค. resume ์ธ์๊ฐ state์ ๋ช
์ ๊ฐ์ ๋ณ๊ฒฝํ์ง ์๋ ํ ์๋ ๊ฐ์ ๋ณด์กดํ๋ค.
-
execution_override: inline | delegate | null (v6.4.0 โ sets decide_execution_mode override for inline escape hatches)
-
active_cluster_takeover: "<cluster_id>" | null (v6.4.0 โ debug takeover ์ค ์ธ์
์ค๋จ ์, resume ํ๋ฉด ํด๋น cluster๋ฅผ inline์ผ๋ก ์ด์ด ์คํ)
-
delegation_snapshot: "<git hash>" | null (v6.4.0 C-1.1 โ delegate ์ง์
์ง์ capture๋ commit hash. verify-receipt pass ์ null๋ก clear. resume ์ non-null์ด๋ฉด "verify-receipt fail ํ interrupt" ์ ํธ๋ก ํด์๋์ด Rollback Protocol AskUserQuestion์ ์ฌํ์ํ๋ค.)
Set $WORK_DIR to the value of work_dir (used in all subsequent steps).
If current_phase is idle or empty:
โน๏ธ ์๋ฃ๋ ์ธ์
์
๋๋ค.
๋ฆฌํฌํธ ํ์ธ: `/deep-status --report` ยท ์ฌ์์ฑ: `/deep-report`
์ ์ธ์
์์: /deep-work <์์
์ค๋ช
>
Stop here.
1.4. State ์คํค๋ง ๋ง์ด๊ทธ๋ ์ด์
(v6.0.2)
Resume ์ state ํ์ผ์ phase_review ํ๋๊ฐ ์์ผ๋ฉด ๋น ๊ฐ์ฒด๋ก ์๋ ์ด๊ธฐํ:
If phase_review field is missing from state YAML frontmatter:
- Add
phase_review: {} to the state file
- Log:
๐ phase_review ํ๋ ์ด๊ธฐํ ์๋ฃ (v6.0.2 ๋ง์ด๊ทธ๋ ์ด์
)
If review_results field exists (v5.5 legacy):
- Read
review_results.{phase} values
- Migrate to
phase_review.{phase}.reviewed: true for phases that have review data
- Keep
review_results for backward compatibility (read-only)
๋ชจ๋ธ ๋ผ์ฐํ
์ฌํด์ (v6.12.0): decodedRoutingMeta.runtime์ด ํ์ฌ ๊ฐ์ง ๋ฐํ์
(node "${CLAUDE_PLUGIN_ROOT}/scripts/detect-runtime.js")๊ณผ ๋ค๋ฅด๋ฉด decoded tiers๋ฅผ ํ์ฌ
์นดํ๋ก๊ทธ๋ก ์ฌํด์ํ๋ค. ๊ฒฐ๊ณผ๋ model_routing_json/model_routing_meta_json JSON-string
์ค์นผ๋ผ๋ก atomic ๊ฐฑ์ ํ๊ณ 1ํ ์๋ดํ๋ค. decoded meta ๋ถ์ฌ๋ skipํ๋ค. runtime ๋ณ๊ฒฝ ์
concrete pin์ ๋๋กญํ๊ณ ํด๋น phase๋ ์ฌํด์๋ tier๋ฅผ ์ฌ์ฉํ๋ค(1ํ ์๋ด).
1.5. Worktree restoration (v4.1)
If worktree_enabled is true in the state file:
-
Read worktree_path from state file
-
Check if the worktree still exists on disk:
[ -d "[worktree_path]" ] && echo "exists" || echo "missing"
-
If exists: Set working directory context to the worktree path.
-
If missing (user manually deleted the worktree):
2. Restore context
Based on the current phase, load the relevant artifacts to restore AI context:
Phase: brainstorm
- Read
$WORK_DIR/brainstorm.md if it exists
- If it has content: display "์ด์ ๋ธ๋ ์ธ์คํฐ ๊ฒฐ๊ณผ ๋ฐ๊ฒฌ" and read the content for context
- If it doesn't exist or is empty: note "๋ธ๋ ์ธ์คํฐ ์ฐ์ถ๋ฌผ ์์"
- Set
phase_context to "ํ์ ์ค"
Phase: research
- Read
$WORK_DIR/research.md if it exists
- If it has content: display "์ด์ ๋ฆฌ์์น ์ผ๋ถ ๋ฐ๊ฒฌ" and read the content to understand what was already analyzed
- If it doesn't exist or is empty: note "๋ฆฌ์์น ์ฐ์ถ๋ฌผ ์์"
- Set
phase_context to "๋ถ์ ์ค"
Phase: plan
- Read
$WORK_DIR/research.md if it exists โ only the Executive Summary and Key Findings sections (stop reading after --- separator or the next ## heading after Key Findings). This provides research context without consuming excessive tokens.
- If it doesn't exist: display warning "โ ๏ธ research.md๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค"
- Read
$WORK_DIR/plan.md if it exists (for review continuation)
- Set
phase_context to "๋ฆฌ๋ทฐ ๋๊ธฐ" if plan.md exists, "์์ฑ ๋๊ธฐ" if not
- Read
review_state from state file
- If
"in_progress": note "๋ฆฌ๋ทฐ ์งํ ์ค์ด์์"
- If
review_results.plan.judgments_timestamp exists: note "์ข
ํฉ ํ๋จ ์๋ฃ, ์ฌ์ฉ์ ํ์ธ ๋๊ธฐ"
- Otherwise: note "๋ฆฌ๋ทฐ ์งํ ์ค"
- If
"completed": note "๋ฆฌ๋ทฐ ์๋ฃ๋จ"
- Review finding์
readFindings({workDir: WORK_DIR, point: "plan", round})๋ก ๋ณต์ํ๋ค.
canonical ์ฐ์ /legacy fallback๊ณผ source:'legacy'๋ฅผ ๋ณด์กดํ๋ฉฐ raw cross-review ํ์ผ์
์ง์ ์ ํํ์ง ์๋๋ค. structural plan-review.json์ ์ ์ ์์ฝ์๋ง ์ฌ์ฉํ๋ค.
Phase: implement
- Read
$WORK_DIR/research.md if it exists โ only Executive Summary (1 paragraph)
- Read
$WORK_DIR/plan.md in full โ this is the implementation guide
- Parse the Slice Checklist: count
- [x] (completed) and - [ ] (incomplete)
- Identify the last completed task and the next incomplete task
- Calculate progress:
completed / total * 100
- If plan.md doesn't exist: "โ ๏ธ plan.md๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. /deep-plan์ ๋จผ์ ์คํํ์ธ์." โ Stop
- Set
phase_context to "N/M ์๋ฃ"
Phase: test
- Read
$WORK_DIR/plan.md โ only Plan Summary section (approach, scope, risk)
- Read
$WORK_DIR/test-results.md if it exists โ focus on the most recent attempt's Failures section
- Read
test_retry_count and max_test_retries from the state file
- Set
phase_context to "์๋ N/M"
File resilience: If any file fails to read (missing, corrupted), display a warning but continue with available data. Only stop if a critical dependency is missing (e.g., plan.md missing during implement phase).
3. Display resume status
Deep Work ์ธ์
์ ์ฌ๊ฐํฉ๋๋ค
์์
: [task_description]
ํ์ฌ ๋จ๊ณ: [Phase ์ด๋ฆ] ([phase_context])
์์
ํด๋: [work_dir]
ํ๋ฆฌ์
: [preset]
ํ๊ฐ์ ๋ชจ๋ธ: [evaluator_model]
์์: [started_at]
Assumption ์กฐ์ : [N]๊ฑด ๋๋ ์์
๊ฑด๋๋ด ๋จ๊ณ: [list] ๋๋ ์์
์ปจํ
์คํธ ๋ณต์:
[โ
/โฌ] research.md [์์ฝ ๋ก๋ / ์์]
[โ
/โฌ] plan.md [์ ๋ฌธ ๋ก๋ / ์์ฝ ๋ก๋ / ์์]
[โ
/โฌ] ์ฒดํฌ๋ฆฌ์คํธ ์งํ๋ฅ : N/M (XX%) โ implement๋ง
[โ
/โฌ] ํ
์คํธ ๊ฒฐ๊ณผ (์๋ N/M) โ test๋ง
[โ
/โฌ] ๋ฆฌ๋ทฐ ์ํ: [์๋ฃ (8/10) / ์งํ์ค / ๋๊ธฐ / ์คํต] โ plan๋ง
โถ๏ธ [๋ค์ ํ๋]
Omit lines that don't apply to the current phase (e.g., don't show ์ฒดํฌ๋ฆฌ์คํธ for research phase). (If preset is empty or not set, omit the ํ๋ฆฌ์
line.) If evaluator_model is empty or not set, omit the ํ๊ฐ์ ๋ชจ๋ธ line. If assumption_adjustments is empty or not set, show "์์". If skipped_phases is empty or not set, show "์์".
3.5. Phase cache cleanup (v6.1)
Before dispatching to the phase skill, delete any stale phase cache to ensure a clean resume:
rm -f .claude/.phase-cache-${SESSION_ID} 2>/dev/null
Where ${SESSION_ID} is the resolved session ID from Step 1.
4. Auto-continue
Execute the appropriate phase skill based on the current phase. Each skill handles its own resume logic (review state detection, checkpoint restoration, etc.) internally.
brainstorm
Brainstorm phase๋ Orchestrator Exit Gate ์ฌํ์(v6.3.1 F1)๊ฐ ํ์ํฉ๋๋ค.
Orchestrator๋ฅผ ๊ฒฝ์ ํ์ฌ resumeํฉ๋๋ค:
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=brainstorm")
brainstorm_completed_at์ด ์์ผ๋ฉด Orchestrator ยง3-1 Exit Gate ์ฌํ์.
- ๋ฏธ์๋ฃ๋ฉด brainstorm skill์ ์ฒ์๋ถํฐ ์ฌ์คํ.
research
Research phase๋ Orchestrator์ Review + Approval Workflow๋ฅผ ๊ฑฐ์ณ์ผ current_phase๊ฐ ์ง์ ํฉ๋๋ค.
Phase skill์ ์ง์ ํธ์ถํ๋ฉด current_phase๊ฐ ๋ณ๊ฒฝ๋์ง ์์ dead-end๊ฐ ๋ฉ๋๋ค.
Orchestrator๋ฅผ ๊ฒฝ์ ํ์ฌ resumeํฉ๋๋ค:
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=research")
Orchestrator๊ฐ research skill ํธ์ถ โ review โ approval โ plan ์ง์ ๊น์ง ์ฒ๋ฆฌํฉ๋๋ค.
plan
Plan phase๋ Orchestrator Exit Gate ์ฌํ์(v6.3.1 F1)๊ฐ ํ์ํฉ๋๋ค.
Orchestrator๋ฅผ ๊ฒฝ์ ํ์ฌ resumeํฉ๋๋ค:
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=plan")
plan_completed_at + plan_approved: true์ด๋ฉด Orchestrator ยง3-3 Exit Gate ์ฌํ์ (paused-after-approval ๋ณต๊ท ๊ฒฝ๋ก). current_phase๋ฅผ implement๋ก ๊ฐ์ ์ ํํ์ง ์์ โ Option A F1์์ ์ด ์ํ๋ ์ ๋นํ ์ผ์์ ์ง ์ํ์.
plan_approved: false์ด๋ฉด Orchestrator ยง3-3์ด review+approval ๋จ๊ณ ์ฌ๊ฐ.
implement
Implement phase๋ Orchestrator Exit Gate ์ฌํ์(v6.3.1 F1)๊ฐ ํ์ํฉ๋๋ค.
Orchestrator๋ฅผ ๊ฒฝ์ ํ์ฌ resumeํฉ๋๋ค:
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=implement")
implement_completed_at + ๋ชจ๋ slice receipt complete์ด๋ฉด Orchestrator ยง3-4 Exit Gate ์ฌํ์.
- ๋ฏธ์๋ฃ slice๊ฐ ์์ผ๋ฉด implement skill์ด slice-level resume ์ํ (๊ธฐ์กด Resume Detection ๋ก์ง).
test
Test phase๋ Orchestrator Exit Gate ์ฌํ์(v6.3.1 F1)๊ฐ ํ์ํฉ๋๋ค.
-
If test_passed: true:
All Pass๋ ์ธ์
. Orchestrator ยง3-5 Exit Gate ์ฌํ์:
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=test")
-
Otherwise (retry ์งํ ์ค ๋๋ exhausted):
Skill("deep-work-orchestrator", args="--session={SESSION_ID} --resume-from=test")
Orchestrator ยง3-5๊ฐ test skill์ ํธ์ถํ๊ณ retry loop์ ์ด์ด์ ๊ด๋ฆฌํฉ๋๋ค.