← ClaudeAtlas

coord-respawn-selflisted

Coord context-aware self-respawn. Invoked by a Coord agent when context window reaches 80% threshold mid-L3. Saves mid-L3 state, writes a continuation manifest, notifies the spawner (PD or Dept Head depending on caller role), and stops. The spawner then resumes the L3 with a fresh Coord. Enforces max 3 respawns per Coord per 24h. Use at clean task boundaries only — never mid-Executor-spawn or mid-ACK/NACK cycle.
Tekkiiiii/the-agency · ★ 1 · AI & Automation · score 62
Install: claude install-skill Tekkiiiii/the-agency
# /coord-respawn-self — Coord Context-Aware Self-Respawn ## When to Invoke - **Mandatory:** when context window reaches 80% (CONTEXT_PCT_ALERT fires) - **Proactive:** at a clean sub-task boundary within L3 when context > 70% - **Never mid-Exec:** do not invoke while an Executor is awaiting APPROACH or CHECKPOINT response — finish that exchange first, then respawn ## Respawn Counter Enforcement Max 3 respawns per Coord per 24h. Uses the same counter mechanism as /respawn-self: `~/.claude/state/respawn-counters/coord-{l3-name}-{pun}.txt` ```bash COORD_ID="coord-{l3-name}-{pun}" COUNTER_FILE="$HOME/.claude/state/respawn-counters/$COORD_ID.txt" NOW=$(date +%s) DAY=86400 mkdir -p "$HOME/.claude/state/respawn-counters" if [ -f "$COUNTER_FILE" ]; then COUNT=$(awk '{print $1}' "$COUNTER_FILE") RESET_AT=$(awk '{print $2}' "$COUNTER_FILE") AGE=$(( NOW - RESET_AT )) if [ "$AGE" -ge "$DAY" ]; then COUNT=0 RESET_AT=$NOW fi else COUNT=0 RESET_AT=$NOW fi if [ "$COUNT" -ge 3 ]; then echo "RESPAWN_BLOCKED: max 3 respawns reached for $COORD_ID in 24h." exit 1 fi NEW_COUNT=$(( COUNT + 1 )) echo "$NEW_COUNT $RESET_AT" > "$COUNTER_FILE" echo "RESPAWN_OK: respawn $NEW_COUNT/3 for $COORD_ID" ``` If RESPAWN_BLOCKED: escalate to PD with current state — do not continue. ## Step 1 — Complete Current Work Unit - Finish any pending APPROACH or CHECKPOINT gate exchange - Do NOT start a new Exec spawn - Reach a clean "N Execs ACKed, M pending" boundary ## Step 2 — W