lidge-jun/codexclaw / plugins/codexclaw/skills/loop
cxc-loop
VerifiedUse for PABCD completion loops. Triggers: cxc-loop, continue until done, HOTL, repeated PABCD, 루프 돌려, 끝까지 해줘, docs-first.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.3 KB |
| agents/openai.yaml | config | 127 B |
| references/divergence-tiers.md | markdown | 4.6 KB |
| references/durable-goalplan.md | markdown | 10.6 KB |
| references/lane-dispatch.md | markdown | 9.3 KB |
| references/runtime-lifecycle.md | markdown | 6.3 KB |
| references/waiting.md | markdown | 6.7 KB |
references/runtime-lifecycle.md
View on GitHub# Loop runtime lifecycle
Read only for authorized HOTL entry/resume or continuation/completion diagnosis.
Mode selection belongs to [cxc-loop](../SKILL.md); follow the live host tool contract.
## Entry and resume
Before claiming loop progress, apply ORCH-MANDATE-01 in
[cxc-loop](../SKILL.md#execution-invariants) and the binding, status and artifact procedure in
[phase control](../../pabcd/references/phase-control.md)
(SESSION-IDENTITY-01, ORCH-ARTIFACT-01, ATTEST-SHAPE-01).
A phase without a persisted transition and real artifact did not happen.
If PATH resolves an older development `cxc`, run session, orchestrate and loop
commands through the installed plugin, `node "<pluginRoot>/bin/cxc.mjs"`, and
leave the development checkout untouched.
For a new authorized HOTL goal, create the host goal, initialize and register its
[durable plan](durable-goalplan.md), then enter P. On resume, inspect and reuse
the matching active goal and plan; resolve scope mismatches instead of overwriting
them. HITL enters only within its requested scope and without a host goal.
After D closes to IDLE, read goalplan and ledger, then apply the
[next-work-phase rule](../SKILL.md) before another P.
Work outside the FSM must be reconciled and genuinely attested before it counts
as loop progress. Prompt-time arming and GOAL-IDLE-CONTINUE-01 can name the needed
command; neither moves a phase for the agent.
## Completion gate (GOAL-COMPLETE-GATE-01, shipped)
The shipped guard in
[goal-gate.ts](../../../components/pabcd-state/src/goal-gate.ts)
owns the completion predicate, including cycle closure, resolved child evidence,
source integrity and complete bound-plan validation. Never weaken criteria or
shrink a plan to pass (LOOP-CONTINUE-01).
On denial, inspect the reason: restore verified unreadable state or a missing/
malformed bound plan; re-verify unresolved child work with
`cxc evidence resolve --session <id> --agent <agent-id> --receipt <path>`;
validate the same source-bound plan with `cxc loop validate --session <id>`.
Clear an unrecordable-evidence marker only after re-verification. Close an active
cycle through real D evidence; reset is a separately authorized control action.
The guard leaves blocked status available, subject to the host's own conditions.
Unexpected guard errors fail open; absent delivery or an allowed call proves
neither completion nor fresh verification.
When the work already shipped as a pull request that merged, or that is open with
every check passing, record it: `cxc loop pr-record --session <id> --pr <url>`.
The command checks the PR once with `gh` and stores it as this session's
completion record. The gate then accepts completion with a cycle still open or a
plan not fully ticked, and B>C accepts an unchanged source when the record was
made during that B (SOURCE-DELTA-01). The record never covers unverified
subagent work or a structurally broken plan. A PR that is closed, still running
checks, or failing any check is refused and nothing is written.
Run it from the session's checkout (or pass `--cwd`): in repo and local state mode
the gate reads the record there, so pr-record refuses a directory that holds no
state for the session. External mode shares the record across the origin's checkouts.
`pr-record` needs cxc 0.2.43+. If `cxc loop --help` does not list it, the installed
plugin is older than these skills (`cxc --version`). If the gate still denies after a
record was written, read the denial first: unverified subagent work, unreadable state,
a source binding or a broken plan still deny by design, and a denial that names a
newer record means version skew. For skew, `codex plugin marketplace upgrade codexclaw`,
re-approve the hooks Codex marks Modified, and open a new thread. Do not record the
PR with a newer clone's CLI: the installed hooks still cannot read it.
A docs-only roadmap cycle in a repository that forbids committing plans keeps
its plan units outside the commit (`CODEXCLAW_PLANS_DIR` or `state.plansDir`;
`cxc devlog path` shows where). B>C accepts a change to the plan unit bound at
P>A, recorded on entry to B by path and digest, the same way it accepts a
source change.
Before waiting on dispatched work or long external processes, read
[Waiting on work](waiting.md), the mode-neutral owner of wait and retirement rules.
It also owns the cross-turn preflight: the Stop-continuation bounds below mean a
dispatch expected to outlive this turn needs a verified wake arranged BEFORE the turn
yields, not an assumption that something will resume the coordinator.
## Stop-continuation (shipped, L6)
The active Stop hook (`handleStop`) returns `{"decision":"block","reason":...}` under
an ACTIVE goal, including at IDLE when GOAL-IDLE-CONTINUE-01 names the next arming
command and remaining work. Termination remains bounded by:
- **Goal/phase guard** — no active goal → release (a plain interactive session never enters
the loop; it pauses for the human at P/A/B, and IDLE without a goal stays silent).
Phase `I` always releases (the Interview is HITL-only).
- **Context-pressure bail** — don't pile on during compaction recovery.
- **Stagnation cap** — a bounded `stopBlockCount` per phase; after `MAX_STOP_BLOCKS`
consecutive blocks at the same phase with no transition, the loop releases so it can
never trap a session. A real transition (chat or CLI) resets the counter, so each
phase of a healthy P→A→B→C→D gets a fresh budget. This is the runtime companion to
LOOP-DOOM-01, not a success signal; after release, apply the no-progress discipline
before retrying the same phase.
- **Objective plateau block** — for active maximize goals with session-scoped metrics,
two non-improving same-metric rows switch the block reason from plain continuation
to "step back and re-plan with divergence." This still uses the same bounded
`MAX_STOP_BLOCKS` release path and never asks the user inside goal mode.
### Stop decision matrix
| Condition | Decision |
|-----------|----------|
| No active goal, or phase I | Release |
| Active goal + in-flight cycle | Bounded block (continue phase) |
| Active goal + IDLE with an executable remaining phase | Block with arming command |
| IDLE with a missing plan or all remaining work awaiting user decisions | Release; goal remains active and completion is still gated |
| Context pressure or stagnation cap exhausted | Release (not a success signal) |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 196k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |