/deep-loop:deep-loop-continuefrom deep-loop
deep-loop main tick — advances the kernel-returned next action in the current Workstream owner conversation, using native compact in place and handing off only at an exact terminal Workstream boundary. Triggered by '/deep-loop-continue', 'continue the loop', 'advance the loop', 'next tick', '루프 진행', '루프 계속', '다음 tick', '계속 진행', cross-platform Skill({ skill: "deep-loop:deep-loop-continue" }).
Ships in deep-loop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
[!IMPORTANT] Skill body echo 금지 — 이 스킬 본문을 사용자에게 그대로 출력하지 말 것. 사용자의 언어(language)를 감지하여 같은 언어로 응답한다. loop.json + handoff 파일이 source of truth — 이전 대화 컨텍스트를 가정하지 말 것. 비가역 외부 행동(push/PR/publish/merge/delete)은 proposal-only, 항상 사람 승인(human approval)을 받는다. maker/checker 분리 유지 — 같은 세션이 동일 workstream의 maker와 checker를 겸하지 않는다. 스킬은 durable state를 읽기만 하며, 모든 변경은 public kernel CLI로만 요청한다. 이미 받은 대상 특정 승인은 같은 작업에서 유지한다. 추가 질문은 실제 누락 정보나 새 권한에 한정한다.
로드된 SKILL.md 경로에서 이 플러그인의 absolute(절대) 루트를 계산하고, 아래 argv 템플릿의 DEEP_LOOP_ROOT를 실행 전에 그 절대 경로로 치환한다. literal DEEP_LOOP_ROOT 문자열을 Node에 전달하는 것은 금지한다. 환경 변수나 셸 확장으로 루트를 만들지 않는다.
호출은 제품 이름(Claude Code / Codex / Grok Build)을 직접 assertion한다. Claude Code는 /deep-loop-continue, Codex는 $deep-loop:deep-loop-continue, Grok Build는 /deep-loop-continue(모호하면 /deep-loop:deep-loop-continue)를 사용한다. 슬래시 호출이 Claude를 뜻하지 않는다. 환경 변수로 호스트를 단정하지 않는다.
Accept exactly three mutually exclusive forms: the normal invocation with no
arguments; the literal invocation-local internal mode prepared-fallback; or
exactly one canonical restored wrapper JSON string supplied by
deep-loop-compact restore in the same model turn. Route the canonical
restored wrapper directly to Stage A of §0.25 before generic argument rejection.
The prepared-fallback form is accepted only when the trusted SessionStart
prepared branch dispatches it. It grants no restore authority, carries no
capsule, and never changes durable state by itself. Reject every other argument,
multiple form, or conflicting mode.
For prepared-fallback, §1 still reads next-action --json exactly once. If
the returned action has advice:"compact", ignore only that advice and its
reason for this one tick, then consume the prepared-fallback mode exactly
once. Route and perform the original underlying action.type; never replace
or infer that action. Do not enter §4 Compact advice for this tick. This avoids
an immediate compact loop while preserving the kernel's routing authority.
/deep-loop-continue — 커널의 next-action을 한 단계 수행한다. 열린
Workstream affinity는 현재 owner conversation에 계속 남는다. 새 owner는
커널이 정확한 terminal Workstream boundary를 handoff action으로 반환한
뒤에만 준비한다.
handoff descriptor 또는 current run이 제공한 <run_id>는 논리적(logical) loop run id이며 run 수명 동안 불변(immutable)이다. lease owner가 세션마다 바뀌어도 이 값을 다시 대입하지 않는다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field session_chain.lease --project-root "<canonical_project_root>" --run-id <run_id>
현재 세션이 owner_run_id인지 확인한다. 아니면 Claude는 /deep-loop-resume, Codex는 $deep-loop:deep-loop-resume으로 lease를 인수해야 한다.
<owner_run_id> = lease.owner_run_id, <generation> = lease.generation. 여기서 lease는 방금 읽은 session_chain.lease다. 즉 <owner_run_id>는 session_chain.lease.owner_run_id, <generation>은 session_chain.lease.generation에서 매 tick 새로 읽고, <run_id>는 절대 재바인딩하지 않는다.
이 SessionStart(compact) comprehension tick 또는 같은 turn의 명시적
direct-human compact restore dispatch가 restored compact capsule wire를
공급했다면, 어떤 mutating CLI보다 먼저 이
gate를 실행한다. Stage A는 §0의 lease 명령보다도 먼저 순수 입력만 검사한다.
같은-turn compact restore dispatch에서는 canonical restored wire JSON 전체를
exactly one single string argument로 받는다. 이 wrapper argument는 정상적인
인자 없는 invocation의 예외이며, flat inspect descriptor나 inner capsule은
유효한 wire가 아니다.
wire가 2048 UTF-8 bytes를 초과하거나 missing, truncated, malformed, oversized
JSON이면 /deep-loop-status를 안내하고 즉시 stop한다. JSON.parse 후 다음
exact top-level key set만 허용한다:
marker, version, injected_by, capsule.
각 값은 marker:"deep-loop-compact-capsule-v1", version:1이어야 하고,
injected_by는 "sessionstart" 또는 "direct-human-skill"만 허용한다.
capsule은 exact key set
kind, phase, run_id, checkpoint_key, context_sha256,
pre_restore_loop_hash, owner_run_id, generation, runtime,
workstream_id, episode_id, provider_evidence, admission,
restore_event, restore_command만 가지며 kind은
deep-loop-compact-capsule, phase는 반드시 restored여야 한다.
provider_evidence도 exact boolean keys recorded, supplied, matched만
허용한다. 어느 key/type/enum/length 검사라도 실패하면 stop하며
session-profile set must not run; 다른 mutation도 실행하면 안 된다.
provenance와 admission은 서로 묶여 있다. injected_by:"sessionstart"이면
admission.kind:"postcompact-observation", admission.source:"sessionstart"
여야 한다. injected_by:"direct-human-skill"이면 admission은 정확히
kind:"human-attested", source:"direct-human-skill",
receipt_trigger:null이어야 하고 restore_command도 null이어야 한다.
두 provenance를 바꾸어 추측하거나 SessionStart 표식을 만들어내지 않는다.
Stage A 통과 뒤 §0의 fresh lease를 읽고, 이어서 다음 read-only state를 모두 읽는다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field session_chain.lease --project-root "<canonical_project_root>" --run-id <run_id>
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field session_chain.sessions --project-root "<canonical_project_root>" --run-id <run_id>
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field event_log_head --project-root "<canonical_project_root>" --run-id <run_id>
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field workstreams --project-root "<canonical_project_root>" --run-id <run_id>
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field current_episode --project-root "<canonical_project_root>" --run-id <run_id>
current lease owner의 session_chain.sessions row와 그 compact_cursor를 찾아
capsule의 run_id, owner_run_id, generation, runtime,
workstream_id, episode_id, checkpoint_key, context_sha256,
pre_restore_loop_hash, provider_evidence, committed admission,
restore_event와 exact-deep-equal 비교한다. owner session의 run id는
lease owner와 같아야 하고, cursor의 owner/generation/runtime도 fresh lease와
일치해야 한다. cursor restore_event는 current event_log_head와 같아야
하며, Workstream은 open/non-terminal이고 current episode가 그 Workstream에
속해야 한다.
불일치하면 다른 restore를 추측하지 말고 /deep-loop-status를 안내한 뒤
stop한다. model/effort are not part of the immutable capsule identity. 따라서
모든 immutable 검증이 성공한 뒤에만 §0.5 profile refresh를 조건에 따라
정확히 한 번 실행하고, 그 다음 §1의 fresh routing tick으로 진행한다.
§0에서 lease를 확보한 직후, 게이트/디스패치 이전에 현재 세션의 model/effort를 public kernel route로 갱신한다. 스킬이 상태 파일을 직접 쓰지 않는다.
현재 호스트가 알려 준 model과 effort를 직접 관측한다. 관측된 필드만 model/effort key로 넣어 한 줄 compact JSON을 만들고 다음 완전한 명령 하나를 사용한다. durable session_runtime이 grok이면 effort를 넣지 않는다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" session-profile set --session-profile '<session_profile_json_compact>' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
<session_profile_json_compact> 내부의 JSON double quotes(JSON 이중 따옴표)는 그대로 두고 바깥 single quotes로 argv 하나를 만든다. 둘 다 관측하지 못하면 이 refresh 전체를 건너뛴다(state 그대로 진행 — 무해).
next-action 응답만 따른다.공통 root/runtime 확인과 필요한 compact capsule admission을 마친 뒤 상태 버전을 읽는다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field schema_version --project-root "<canonical_project_root>" --run-id <run_id>
0.5.0이면 Read("DEEP_LOOP_ROOT/skills/deep-loop-workflow/references/goal-execution.md")의
Continue를 수행한다. 이후의 legacy action 표로 fall through하지 않는다. plan_next_work는
목표 안에서 AI가 다음 작업을 판단하도록 요청하는 action이다. 정상 작업·fix·리뷰·종료를
연결하고, 실제 승인된 목표가 끝날 때까지 현재 owner에서 진행한다.
0.4.0은 아래 기존 경로를 그대로 사용한다. 상태 버전이나 완료 표식을 직접 고치지 않는다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" next-action --json --project-root "<canonical_project_root>" --run-id <run_id>
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field autonomy.continuation_policy --project-root "<canonical_project_root>" --run-id <run_id>
action.type이 유일한 routing authority다.
await_human: action.reason과 커널 진단을 그대로 보고하고
/deep-loop-status를 안내한 뒤 멈춘다. 이 autonomous tick은 recovery,
budget relief, breaker reset, 또는 attended approval을 실행하지 않는다.
action.reason이 comprehension-debt이면 action.blocking_episode_ids가 실제 ack 대상(정착된 미리뷰 maker)이다. action.episode_id가 있으면 그것은 debt 때문에 막힌 episode이지 ack 대상이 아니다 — 그것을 ack해도 게이트는 풀리지 않는다. 차단된 개별 episode가 없는 discover 분기에서는 action.episode_id가 없을 수 있다.handoff: continuation_policy가 workstream-session이면 §4의
exact-boundary 경로만 수행한다. migrated compact-in-place 또는
rotate-per-unit이면 아래 legacy compatibility 경로만 수행한다.action.workstream_id가 존재하는 action에만 이 단계를 실행한다. 이는 dispatch_maker, dispatch_checker, fix_episode, await_result(진행 중인 maker/checker 폴링 시 워크트리 경로가 필요)를 포함한다.
workstream_id가 없는 action 타입(finish, handoff, await_human, discover)은 이 단계를 건너뛴다.
§1에서 실행한 next-action --json 결과의 action.workstream_id를 읽고, 커널에서 절대 worktree 경로를 얻는다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" path resolve --target workstream --workstream <workstream_id> --project-root "<canonical_project_root>" --run-id <run_id>
반환된 한 줄의 절대 경로를 그대로 사용한다. 기본 진입은 그 경로를 도구의 working-directory 옵션에 전달하거나 cd 한다. native attach(EnterWorktree 등)는 도구가 그 절대 경로에 attach하고 새 sibling을 만들지 않는다고 보장될 때만 쓴다. 기록값이 .worktrees/ 아래이면 Claude EnterWorktree를 생성 수단으로 호출하지 않는다. 이후 커널 명령도 descriptor-bound --project-root와 --run-id를 계속 명시한다.
Artifact 상세 교정 규칙은 deep-loop-workflow의 ## 핵심 불변식을 따른다.
max_parallel 환경에서 여러 active workstream이 있어도, 항상 action.workstream_id가 지정하는 workstream의 worktree만 진입한다 — 임의 active workstream이 아님.
route가 필요한 곳에서만 이 절차를 부른다.
| 소비자 | 언제 | 기록 명령(형태) |
|---|---|---|
legacy dispatch_maker | 신규 maker 에피소드 경계에서만 | episode record --id <episode_id> --status in_progress --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> |
legacy dispatch_checker | Route A/B/C/E 선택 후, spawn 전에 maker와 별도로 1회 | review dispatch --point <review_point> --workstream <workstream_id> --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> |
| v0.5 maker 새 primary attempt·새 retry | route를 쓸 때만 | execution prepare --episode <episode_id> --mode <mode> --stage primary --task <task> --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> |
각 소비자 절의 실제 명령(--project-root, --run-id 포함)이 정본이다. 이 표는 어느 명령에 --routing을 붙이는지만 보여 준다. legacy fix_episode와 v0.5 resumed attempt는 이 절차를 부르지 않고 기존 record를 그대로 쓴다. v0.5 새 retry는 새 attempt이므로 위 표대로 이 절차로 새로 route할 수 있다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" router probe --json --project-root "<canonical_project_root>" --run-id <run_id>
exit가 0이 아니면 degrade하지 않는다. 이 tick을 멈추고 커널 진단을 그대로 보고한다. exit 0이고 route_task가 null이면 라우터 부재다. reasons에 router-path-rejected가 있으면 "플러그인 캐시의 route_task.py symlink를 정리하거나 DEEP_MODEL_ROUTER_CLI를 지정하라"를 보고에 포함한다. python3 부재도 라우터 부재다. 개인 ~/.claude/skills/model-router 심링크와 ../deep-model-router checkout은 커널 locator가 거부한다.
{"route_schema_version": 1, "task_class": "<IMPLEMENTATION 등 대문자 class>", "complexity": 0, "uncertainty": 0, "blast_radius": 0, "reversibility": 0, "flags": [], "runtime": "claude_code|codex|grok"}
네 차원은 0–3 정수, route_schema_version은 정수 1이다. 필요하면 router 계약의 선택 키(reasoning_centric, availability_snapshot, local_policy 등)를 더할 수 있지만, 계약에 없는 키는 router가 exit 2로 거부한다. probe의 policy_pin이 문자열이면 요청 JSON에 "policy_pin": "<그 값>"을 그대로 넣고, null이면 키를 넣지 않는다. pin 값을 합성하거나 다른 곳에서 가져오지 않는다.
python3 <probe.route_task> --request-json <request.json> --format json
1이고 stdout의 terminal이 MODEL_STATE_UNAVAILABLE이며 model_overlay.state_reason이 아래 표의 값: 사유는 표의 토큰이다. HIGH/CRITICAL이면 in_progress로 올리지 않고 await_human, LOW/MEDIUM이면 --routing 없이 진행하고 tick 보고에 사유와 안내를 남긴다.state_reason | 사유 | 안내 |
|---|---|---|
pin_base_changed | router-policy-pin:pin_base_changed | router 플러그인이 업데이트되어 이 run의 고정 정책을 재현할 수 없다. 새 run을 시작한다. |
pin_generation_missing | router-policy-pin:pin_generation_missing | 고정 정책의 세대를 router 상태에서 찾을 수 없다(플러그인 업데이트 또는 상태 초기화). 새 run을 시작한다. |
pin_revoked | router-policy-pin:pin_revoked | 고정 정책이 쓰던 모델이 이후 철회되었다. 새 run을 시작한다. 계속 진행하면 session profile 모델로 실행되며, 그 모델이 철회 대상인지는 deep-loop가 판별할 수 없으니 사람이 확인한다. |
pin_suppressed_by_off | router-policy-pin:pin_suppressed_by_off | DEEP_MODEL_ROUTER_OVERLAY=off가 고정 정책에 필요한 overlay 항목을 뺐다. 해제 후 다시 시도하거나 새 run을 시작한다. |
0: 결정을 소비하고 아래 --routing JSON을 붙인다.4: 결정을 소비하고 사후 확인 의무를 남긴다. degrade 금지.3: human gate를 전파한다. in_progress로 올리지 않고 await_human.1/2/5, 비-JSON, 미지원 schema, digest 불일치, spawn/timeout/signal/빈 stdout/범위 밖 exit/TERMINATION_UNCONFIRMED, 라우터 부재:
await_human--routing 없이 진행(현행 session_profile 단일 전파)TERMINATION_UNCONFIRMED 뒤에는 라우터 write-capable retry 금지--routing 최소 키: request, decision(route_schema_version / router_plugin_version / policy_sha256), selected_model, selected_effort_native, effective_policy, provenance. request는 보낸 요청 JSON 그대로(policy_pin 포함)이고, 나머지는 router stdout에서 옮긴다:
{"request": <보낸 요청 JSON>, "decision": {"route_schema_version": 1, "router_plugin_version": "<stdout 값>", "policy_sha256": "<stdout 값>"}, "selected_model": "<stdout 값>", "selected_effort_native": "<stdout 값>", "effective_policy": <stdout 값 또는 {}>, "provenance": "router"}
라우터 JSON에 decision_fingerprint 또는 request_sha256가 있으면 decision 안에 그대로
포함하고, 없으면 생략한다. 둘 중 어느 값도 스킬이 합성하지 않는다. 관측 파일
observations/<subject_sha256>.json은 터미널 커밋 뒤 커널이 발행하며, 스킬은
읽거나 쓰지 않고 --artifacts에도 넣지 않는다.
action.type대로, 스스로 판단 추가 금지)node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" adapter resolve --protocol <protocol> --task "<brief>" --tier <gate.tier_after> --project-root "<canonical_project_root>" --run-id <run_id>
guard.ok === false이면 dispatch 중단 → await_human 안내.
신규 maker 에피소드 경계에서만 §1.75 라우터 절차를 수행한다. adapter resolve 이후, in_progress 기록 이전. durable episodes[].routing이 이미 있으면 재호출하지 않는다.
진행 시 episode in_progress로 기록(authorized 결정이 있을 때만 --routing을 붙인다):
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" episode record --id <episode_id> --status in_progress --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
HIGH/CRITICAL 라우터 실패나 human_gate에서는 이 in_progress 기록 명령을 실행하지 않는다. LOW/MEDIUM degrade면 --routing을 생략한 같은 명령을 쓴다.
dispatch.kind를 production routing authority로 소비한다. authorized
--routing이 있으면 selected_model / selected_effort_native를 이번
maker spawn에 적용한다. host가 새 세션을 띄우면 그 model/effort를 넘긴다.
inline owner 세션은 모델을 바꾸지 않고, freeze는 다음 handoff/respawn이
소비한다.
dispatch.kind === 'inline'이면 dispatch.explicit_fallback === true,
dispatch.role === 'maker', dispatch.skill === null을 모두 요구한다. 현재
owner LLM이 §1.5의 worktree 안에서 dispatch.args brief를 직접 도구로
수행한다. sibling skill, Orca, MCP, host executable을 찾지 않으며 null
dispatch.skill을 호출하지 않는다. 이 분기는 maker 실행만 허용하고 checker
독립성 규칙을 변경하지 않는다.dispatch.kind === 'skill'이면 dispatch.skill이 non-empty string인지
확인한 뒤 Claude는 Skill({ skill: dispatch.skill, args: dispatch.args }),
Codex는 qualified $<dispatch.skill>에 dispatch.args를 전달한다.needs-human:adapter-descriptor-invalid로
중단하고 maker 완료 proof를 기록하지 않는다.완료 후:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" episode record --id <episode_id> --status done --artifacts '[".worktrees/<ws-slug>/path/to/artifact"]' --proof '{}' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
먼저 references/adapters.md의 상호 배타 checker routing Route A–E 중 실제 가능한 경로를 선택하되 아직 dispatch하지 않는다. durable session_runtime이 grok이면 먼저 review bridge-probe --json과 Route E 전제(E-0–E-7)를 평가한다. 전부 충족하면 Route E(Read("DEEP_LOOP_ROOT/skills/deep-loop-workflow/references/checker-bridge.md"))로 dispatch한다 — bridge 자식이 유일한 checker이며, 이 대화의 inline 리뷰·deep-review:* Skill 호출·spawn_subagent checker는 여전히 금지다. 전제가 하나라도 실패하면 현행 그대로 Route D(needs-human)로 중단하며 계약 파일도 쓰지 않는다. grok에서 Route A/B/C는 선택하지 않는다. Route D이면 needs-human으로 중단하며 계약 파일도 쓰지 않는다. Route A/B/C/E일 때만 아래 계약 준비를 수행한 뒤 선택한 경로로 dispatch한다.
Route A/B/C/E 선택 후, 실제 spawn 전에 maker와 별도로 §1.75 라우터 절차를 한 번 수행한다. 성공한 결정은 아래 review dispatch의 --routing JSON으로 checker 생성 시 심는다. 생성 후 episode record로 routing을 추가하지 않는다. HIGH/CRITICAL 실패·human_gate면 review dispatch와 spawn을 하지 않고 await_human. 라우터 부재·LOW/MEDIUM degrade면 Claude/Codex에서는 --routing 없이 dispatch하고 session_profile을 쓴다. grok Route E는 degrade-진행이 없다 — routing이 없으면 Route D다.
먼저 recipe를 상태에서 읽는다(이전 대화 컨텍스트를 가정하지 말 것 — 이 값이 아래 분기의 유일한 근거다):
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" state get --field recipe.id --project-root "<canonical_project_root>" --run-id <run_id>
결과가 "harness-hill-climb"이면 dispatch 전에 checker 계약을 materialize한다 (P2 — 커널이 fail-closed로 강제; 전체 규약은 Read("DEEP_LOOP_ROOT/skills/deep-loop-workflow/references/hill-climbing.md") §3.4):
§1.5에서 확정한 absolute worktree에 대해 host의 native path/file API로 DEEP_LOOP_ROOT/skills/deep-loop-workflow/references/contracts/HILLCLIMB-001.yaml을 <absolute_worktree>/.deep-review/contracts/HILLCLIMB-001.yaml로 복사한다. mkdir/copy 전 canonical worktree containment를 확인하고, .deep-review, contracts, 대상 파일 중 존재하는 경로 성분이 symlink/reparse-point이면 중단한다. POSIX cp/mkdir 셸 문법을 가정하지 말고 현재 host에서 안전한 파일 API를 사용한다.
tracked 소스를 그대로 복사한다(byte-identical — 커널이 대조; 수정본은 REVIEW_CONTRACT_MISSING으로 거부). 커널도 realpath containment + contracts 디렉터리 유일성(HILLCLIMB-001.yaml 외 다른 계약 yaml 금지 — bare --contract는 모든 active 계약을 로드하므로)을 fail-closed로 재검증한다. 계약-비소비 reviewer나 --contract 플래그 부재/명시 selector(--contract SLICE-NNN 등 — deep-review 파서는 SLICE-NNN만 selector로 소비하므로 HILLCLIMB-001을 지정할 수 없다)는 REVIEW_CONTRACT_UNENFORCEABLE — run의 review 설정을 사람과 함께 재구성해야 한다.
Route A/B/C 모두 hill-climb dispatch 응답의 descriptor.evidence(커널-검증 insights 경로·emit ULID·sha256·후보)를 fresh checker의 리뷰 요청 본문에 그대로 포함하여 maker 인용과 대조하게 한다. checker episode의 request.md에도 같은 evidence 사본이 durable 기록되며, Codex measured host는 anchored claim의 evidence/contract를 immutable prompt contract로 전달한다.
code-reviewer를 만드는 cooperative tool이 실제로 있을 때만 다음 명령을 실행한다. configured reviewer가 agent인데 이 capability가 없으면 Route D로 가며 dispatch하지 않는다.node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" review dispatch --point <review_point> --workstream <workstream_id> --independent-subagent --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
반환된 agent descriptor로 host tool을 통해 fresh reviewer를 spawn한다.
descriptor.selected_model / descriptor.selected_effort_native가 있으면
그 값을 그대로 spawn에 넘긴다. inline 자기 리뷰는 proof가 아니다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" review dispatch --point <review_point> --workstream <workstream_id> --routing '<routing_json_compact>' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
host가 claim, isolated read-only 두 번째 codex exec, import, accounting을 소유한다.
dispatch 응답의 descriptor.selected_model / selected_effort_native를
measured host spawn에 그대로 전달한다. 이 execution skill은 Route B에서
아래 review record를 실행하지 않는다.
Skill({ skill: checker.skill, args: checker.args }), Codex fresh task는 $<checker.skill>에 args를 전달한다. Codex 자동 task 생성은 지원하지 않으므로 사람이 수동 task 생성을 완료해야 한다. 같은 task의 $<checker.skill> 실행은 proof가 아니다.review bridge-probe가 ready: true이며 전제 E-0–E-7이 충족될 때만 위 dispatch를 실행한다. 그 다음 references/checker-bridge.md의 spawn/finalize만 따른다. 자식 stdout이 report다. owner는 report 본문을 쓰지 않는다. live 실패는 record 없이 needs-human이다.needs-human으로 보고하고 dispatch/record/proof 생성을 모두 중단한다. pending checker를 만들지 않는다.Route A 또는 Route C의 fresh checker가 리뷰 대상 worktree 아래 실제 contained report를 반환한 경우에만, 그리고 Route E에서 bridge-finalize.mjs가 graded stdout 사본을 만든 경우에만, 원래 execution session이 다음 단계로 간다. 커널은 checker episode에서 workstream/point/target maker/source를 파생하므로 해당 caller flag를 전달하지 않는다. APPROVE/CONCERN(통과)은 checker가 실제로 작성한 리뷰 리포트 파일을 --report로 첨부해야 한다 — 리뷰 대상 workstream의 기록된 worktree(<recorded-worktree>/…, 신규 기본 .worktrees/<slug>) 하위 경로여야 하며(무관한 root 파일 재사용 차단), 없거나 밖이면 REVIEW_NO_EVIDENCE(exit 1). REQUEST_CHANGES도 fresh checker가 실제 반환한 verdict여야 한다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" review record --episode <checker_episode_id> --verdict <APPROVE|REQUEST_CHANGES|CONCERN> --report "<review-report-path>" --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
라우터를 다시 호출하지 않는다. action.episode_id는 거절된 checker다.
그 target_maker episode의 기존 routing을 읽어 새 fix maker의
in_progress 기록에 그대로 붙인다. maker routing이 없으면 --routing
없이 기록하고 session_profile로 degrade한다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" episode new --plugin <maker_plugin> --role maker --kind fix --point <point> --workstream <workstream_id> --artifacts '[".worktrees/<ws-slug>/path/to/fix-output"]' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
생성 직후, 거절된 maker의 freeze가 있으면:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" episode record --id <new_fix_episode_id> --status in_progress --routing '<prior_maker_routing_json_compact>' --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
/deep-loop-discover 안내 (또는 invoke).
adapter resolve의 await.path 폴링.
/deep-loop-finish 안내.
Interactive tick은 best-effort로 self-report:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" budget record --turns <n> --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
DEEP_LOOP_UNATTENDED set 시 자기보고를 생략 — drive-headless 드라이버가 측정 usage를 권위있게 기록하므로 이중계상 방지.
self-report는 best-effort 보정일 뿐이다. 커널이 각 business mutation마다 최소 floor를 계상하고 wallclock hard bound를 적용한다.
action.advice === 'compact'이면 handoff하지 않는다. durable
session_runtime이 grok이면 /deep-loop-compact를 호출하지 않고
needs-human으로 멈춘다. 그 외에는 현재 owner conversation에서
/deep-loop-compact prepare 또는 $deep-loop:deep-loop-compact prepare를
호출하고, 그 스킬이 출력한 host native /compact 명령을 사람에게 제시한다.
compact prepare/restore는 같은 conversation, 같은 lease, 같은 Workstream
affinity를 유지한다.
Exception: the already-consumed invocation-local prepared-fallback mode skips
this subsection exactly once as specified above. It still performs the
kernel-returned underlying action and cannot suppress compact advice on any
later tick.
continuation_policy === 'workstream-session',
action.type === 'handoff', action.reason === 'workstream-terminal'이며
action.boundary_event가 있을 때만 handoff한다. public
next-action --json은 boundary를 이미
<boundary_seq>:<boundary_checksum> 문자열로 렌더한다. 그
action.boundary_event 문자열을 검증된 한 값으로 그대로 전달하고,
재구성하거나 이전 action의 값을 재사용하지 않는다.
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" handoff emit --boundary-event <boundary_seq>:<boundary_checksum> --reason "workstream-terminal" --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
continuation_policy가 migrated compact-in-place 또는 rotate-per-unit이고,
fresh kernel action이 정확히 action.type === 'handoff',
action.reason === 'per_session_turn_cap'이며 action.boundary_event가 없을
때만 legacy public route를 사용한다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" handoff emit --reason "per_session_turn_cap" --owner <owner_run_id> --generation <n> --project-root "<canonical_project_root>" --run-id <run_id>
이 branch는 기존 run의 호환성만 보존한다. 새 run의 policy를 바꾸거나 turn count, launcher, tty, spawn style로 handoff를 추론하지 않는다.
unattended invocation이면 measured drive-headless host가 이후 gate와 spawn을
소유한다. 이 스킬은 respawn을 직접 호출하지 않고 즉시 yield한다.
attended invocation이면 커널의 현재 root/epoch/topology 검증을 거친 exact resume command를 얻어 그 출력을 바꾸지 않고 먼저 출력한다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" resume-command --project-root "<canonical_project_root>" --run-id <run_id>
그 다음 현재 parent fence로 preserve-pause하고 종료한다:
node "DEEP_LOOP_ROOT/scripts/deep-loop.mjs" pause --owner <owner_run_id> --generation <n> --mode preserve --reason "needs-human:workstream-terminal" --project-root "<canonical_project_root>" --run-id <run_id>
사람은 출력된 Claude /deep-loop-resume 또는 Codex
$deep-loop:deep-loop-resume 명령을 새 conversation에서 그대로 실행한다.
지원되지 않는 Codex 자동 transport는 codex-transport-not-activated,
승인 runtime 부재는 runtime-identity-unavailable로 남으며, native Windows,
macOS/Linux cmux, macOS iTerm2/Terminal.app 어느 경우도 이 스킬이
surface heuristic으로 attended respawn하지 않는다. Codex App 새 task는 수동이다.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
deep-loop@claude-deep-suite is listed by sungmin-cho/deep-suite — review the source before installing
npx claudepluginhub sungmin-cho/deep-suite --plugin deep-loop11 skills in this plugin
/deep-loopUse when starting a durable long-running goal or coordinating multiple workstreams. Triggers: '/deep-loop "<goal>"', 'start a loop', 'loop engineering', 'orchestrate this work', '루프 시작', '딥루프 시작', '장기 목표 실행', cross-platform Skill({ skill: "deep-loop:deep-loop", args: "<goal>" })./deep-loop-ackdeep-loop acknowledge — marks an episode/diff as human-reviewed, reducing comprehension debt so the loop can fan out new work. Triggered by '/deep-loop-ack', 'ack the review', 'mark reviewed', 'I reviewed it', '검토 완료', '리뷰 확인', '이해 표시', cross-platform Skill({ skill: "deep-loop:deep-loop-ack" })./deep-loop-compactPrepare or restore a deep-loop workstream-session checkpoint across Claude and Codex compaction. Use for '/deep-loop-compact prepare|restore', '$deep-loop:deep-loop-compact prepare|restore', compact preparation, compact restore, context compression, 압축 준비, or 압축 복원./deep-loop-discoverdeep-loop manual discovery heartbeat — surveys the repo, git state, sibling artifacts, and existing loop state to find candidate work items, then persists them. Triggered by '/deep-loop-discover', 'discover work', 'find next work', 'what should I do next', '할 일 발견', '작업 발견', '다음 할 일 찾기', cross-platform Skill({ skill: "deep-loop:deep-loop-discover" })./deep-loop-finishdeep-loop finish — end-of-work: writes the final report, then transitions the run to completed (proof-gated) or stopped, and delegates to deep-memory / deep-wiki when installed. Triggered by '/deep-loop-finish', 'finish the loop', 'wrap up', 'end the run', '루프 종료', '작업 마무리', '런 종료', cross-platform Skill({ skill: "deep-loop:deep-loop-finish" })./deep-loop-handoffdeep-loop boundary handoff — follows the kernel next-action and emits a fresh-owner handoff only for the exact first terminal Workstream boundary. Triggered by '/deep-loop-handoff', '$deep-loop:deep-loop-handoff', 'hand off at the boundary', 'emit handoff', '인수인계', '워크스트림 핸드오프', cross-platform Skill({ skill: "deep-loop:deep-loop-handoff" }).