CCB Self Recover
Use this skill for runtime recovery after diagnosis. Mutations must go through
CCB control-plane commands. Raw tmux mutation and direct runtime-file writes are
forbidden.
Recovery Gates
Before any mutation:
- Confirm maintenance intent from the user, such as "fix", "recover",
"restart if safe", "apply this config", or "make CCB healthy".
- Read the current mounted daemon graph. The target must be a current
daemon-graph agent for clear or restart-like actions.
- Check busy/pending state:
ccb ps
ccb queue --detail <agent|all>
ccb pend --inbox --detail <agent>
ccb trace <id> when the issue involves active or pending lineage
- Check
ccb fault list. If active fault-injection rules affect the target,
treat them as diagnostic evidence. Clear them with
ccb fault clear <rule_id|all> only when the user intended maintenance and
the rules are known test residue. If a rule is recent, or its task/reason
fields could represent an active drill, ask before clearing unless the user
explicitly asked to clear fault-injection rules.
- "Recent" means created within the last 30 minutes by wall time. If no
creation timestamp is available, treat the rule as recent.
- Active-drill markers include task or reason text containing
test,
drill, fault-inject, fault injection, chaos, or ci.
- Safe test residue is an old rule whose task/reason clearly matches a
completed local test and no active queue/inbox/trace evidence depends on
it.
- Choose the least disruptive supported action.
- Report exact commands, gates, affected agents, blockers, and what remains
unchanged.
If the target is unknown, busy, has queued work, has pending reply delivery, or
has a pending chain continuation, stop and report blockers.
Provider/API Or Startup-Input Recovery
For provider/API failures or changes that affect provider process, model, base
URL, environment, provider profile, command template, role assets, or startup
context, use this exact flow:
- Gather evidence without reading secrets.
- Distinguish per-dimension Provider authority from conversation state. Do not
clear for an account/API/route change; preserve the stable CCB conversation
and use validated resume, safe fork/import, or linked continuation.
- Use built-in
ccb-config to edit .ccb/ccb.config only when the fallback
provider/model/base URL/profile/env-var reference is already configured or
explicitly supplied by the user as a safe reference.
- Run
ccb config validate.
- Complete
ccb config approve-commands when an exact protected command value
needs approval; never bypass the external receipt.
- Run
ccb reload --dry-run.
- If validation and dry-run pass, and the user intended materialization, run
ccb reload.
- Re-check the current daemon graph and affected agent status.
- Decide whether affected running agents still use stale provider process,
environment, model, base URL, role asset, or context state.
- If runtime refresh is still needed, restart only one affected current-graph
agent at a time with
ccb restart <agent>, and only when busy checks pass.
- If
ccb restart <agent> returns blocked or failed, report the blockers.
Do not emulate restart with tmux commands. The remaining user-level options
are to continue with unaffected agents or explicitly stop and restart the
project with ccb kill then ccb; do not run project shutdown
autonomously as a substitute for single-agent restart.
ccb reload is not the recovery finish line. It materializes config into the
daemon graph; running provider processes may still hold old startup inputs.
Reload Aftermath
Use this section after ccb-config reports that validation and reload either
completed or are ready to materialize.
- Presentation-only changes, sidebar/tips display, labels, or other UI-only
reloadable changes: re-check
ccb ps and do not restart unless independent
runtime evidence shows a stale or broken agent.
- Role asset, skill, prompt, tool, workspace, restore, permission, queue policy,
watch-path, or startup-context changes: inspect the dry-run affected-agent
list, re-check those current-graph agents, and restart only affected agents
whose running provider state still reflects old startup assets or context.
- Provider command, provider profile, model, base URL, environment, API route,
or command-template changes: after successful reload, expect affected running
agents to need guarded
ccb restart <agent> when busy checks pass.
Never restart an agent only because disk config changed. Restart decisions
must combine the reload plan, affected-agent list, current daemon graph, busy
checks, and provider/pane evidence.
Supported Actions
ccb clear <agent>: provider-native conversation/context clear. Run the
pre-mutation checks in the Recovery Gates section first; use only when
context clearing is the right fix and pending-work checks pass.
ccb reload --dry-run: no-mutation config reload plan. Always safe in
maintenance workflows.
ccb reload: config materialization after ccb config validate,
ccb reload --dry-run, supported plan, and explicit user materialization
intent.
ccb restart <agent>: one configured pane-backed current-graph agent after
busy checks pass. The command itself must report restart_status, blockers,
restartable agents, busy gate evidence, and old/new runtime evidence.
ccb roles update agentroles.ccb_self or ccb roles sync <path>: role asset
repair when the user is repairing ccb_self itself, there is no active
maintenance operation that depends on the current role assets, and the target
role/source version is clear.
Handoffs
- Use
ccb-self-chain first when trace evidence shows message/reply lineage is
the primary problem. Restart is not the first repair for a broken job chain.
- Use built-in
ccb-config for disk config edits and affected-agent reporting.
After reload, this skill owns guarded runtime refresh decisions.
- Return the original business work to the original target agent unless the
user explicitly retargets it.
Red Lines
- Never restart all agents or unrelated agents.
- Never use
tmux kill-pane, kill-window, kill-server, respawn-pane,
send-keys, manual pane creation, or other raw tmux mutation.
- Never write lifecycle, lease, runtime, mailbox, provider session, or tmux
authority files directly.
- Never read, print, store, search for, scrape, borrow, or use API keys or
credentials.
- Never treat
.ccb/agents/*, disk config, pid files, or tmux panes as live
restart target authority.
1---2name: ccb-self-recover3description: Recover CCB agents, panes, mounts, provider contexts, API/provider failures, config reload aftermath, clear operations, and guarded single-agent restarts. Use when the user asks to fix, recover, restart if safe, clear context, reload, remount, or keep work going after provider/API failure.4---56# CCB Self Recover78Use this skill for runtime recovery after diagnosis. Mutations must go through9CCB control-plane commands. Raw tmux mutation and direct runtime-file writes are10forbidden.1112## Recovery Gates1314Before any mutation:15161. Confirm maintenance intent from the user, such as "fix", "recover",17 "restart if safe", "apply this config", or "make CCB healthy".182. Read the current mounted daemon graph. The target must be a current19 daemon-graph agent for clear or restart-like actions.203. Check busy/pending state:21 - `ccb ps`22 - `ccb queue --detail <agent|all>`23 - `ccb pend --inbox --detail <agent>`24 - `ccb trace <id>` when the issue involves active or pending lineage254. Check `ccb fault list`. If active fault-injection rules affect the target,26 treat them as diagnostic evidence. Clear them with27 `ccb fault clear <rule_id|all>` only when the user intended maintenance and28 the rules are known test residue. If a rule is recent, or its task/reason29 fields could represent an active drill, ask before clearing unless the user30 explicitly asked to clear fault-injection rules.31 - "Recent" means created within the last 30 minutes by wall time. If no32 creation timestamp is available, treat the rule as recent.33 - Active-drill markers include task or reason text containing `test`,34 `drill`, `fault-inject`, `fault injection`, `chaos`, or `ci`.35 - Safe test residue is an old rule whose task/reason clearly matches a36 completed local test and no active queue/inbox/trace evidence depends on37 it.385. Choose the least disruptive supported action.396. Report exact commands, gates, affected agents, blockers, and what remains40 unchanged.4142If the target is unknown, busy, has queued work, has pending reply delivery, or43has a pending chain continuation, stop and report blockers.4445## Provider/API Or Startup-Input Recovery4647For provider/API failures or changes that affect provider process, model, base48URL, environment, provider profile, command template, role assets, or startup49context, use this exact flow:50511. Gather evidence without reading secrets.522. Distinguish per-dimension Provider authority from conversation state. Do not53 clear for an account/API/route change; preserve the stable CCB conversation54 and use validated resume, safe fork/import, or linked continuation.553. Use built-in `ccb-config` to edit `.ccb/ccb.config` only when the fallback56 provider/model/base URL/profile/env-var reference is already configured or57 explicitly supplied by the user as a safe reference.584. Run `ccb config validate`.595. Complete `ccb config approve-commands` when an exact protected command value60 needs approval; never bypass the external receipt.616. Run `ccb reload --dry-run`.627. If validation and dry-run pass, and the user intended materialization, run63 `ccb reload`.648. Re-check the current daemon graph and affected agent status.659. Decide whether affected running agents still use stale provider process,66 environment, model, base URL, role asset, or context state.6710. If runtime refresh is still needed, restart only one affected current-graph68 agent at a time with `ccb restart <agent>`, and only when busy checks pass.6911. If `ccb restart <agent>` returns `blocked` or `failed`, report the blockers.70 Do not emulate restart with tmux commands. The remaining user-level options71 are to continue with unaffected agents or explicitly stop and restart the72 project with `ccb kill` then `ccb`; do not run project shutdown73 autonomously as a substitute for single-agent restart.7475`ccb reload` is not the recovery finish line. It materializes config into the76daemon graph; running provider processes may still hold old startup inputs.7778## Reload Aftermath7980Use this section after `ccb-config` reports that validation and reload either81completed or are ready to materialize.8283- Presentation-only changes, sidebar/tips display, labels, or other UI-only84 reloadable changes: re-check `ccb ps` and do not restart unless independent85 runtime evidence shows a stale or broken agent.86- Role asset, skill, prompt, tool, workspace, restore, permission, queue policy,87 watch-path, or startup-context changes: inspect the dry-run affected-agent88 list, re-check those current-graph agents, and restart only affected agents89 whose running provider state still reflects old startup assets or context.90- Provider command, provider profile, model, base URL, environment, API route,91 or command-template changes: after successful reload, expect affected running92 agents to need guarded `ccb restart <agent>` when busy checks pass.9394Never restart an agent only because disk config changed. Restart decisions95must combine the reload plan, affected-agent list, current daemon graph, busy96checks, and provider/pane evidence.9798## Supported Actions99100- `ccb clear <agent>`: provider-native conversation/context clear. Run the101 pre-mutation checks in the Recovery Gates section first; use only when102 context clearing is the right fix and pending-work checks pass.103- `ccb reload --dry-run`: no-mutation config reload plan. Always safe in104 maintenance workflows.105- `ccb reload`: config materialization after `ccb config validate`,106 `ccb reload --dry-run`, supported plan, and explicit user materialization107 intent.108- `ccb restart <agent>`: one configured pane-backed current-graph agent after109 busy checks pass. The command itself must report `restart_status`, blockers,110 restartable agents, busy gate evidence, and old/new runtime evidence.111- `ccb roles update agentroles.ccb_self` or `ccb roles sync <path>`: role asset112 repair when the user is repairing `ccb_self` itself, there is no active113 maintenance operation that depends on the current role assets, and the target114 role/source version is clear.115116## Handoffs117118- Use `ccb-self-chain` first when trace evidence shows message/reply lineage is119 the primary problem. Restart is not the first repair for a broken job chain.120- Use built-in `ccb-config` for disk config edits and affected-agent reporting.121 After reload, this skill owns guarded runtime refresh decisions.122- Return the original business work to the original target agent unless the123 user explicitly retargets it.124125## Red Lines126127- Never restart all agents or unrelated agents.128- Never use `tmux kill-pane`, `kill-window`, `kill-server`, `respawn-pane`,129 `send-keys`, manual pane creation, or other raw tmux mutation.130- Never write lifecycle, lease, runtime, mailbox, provider session, or tmux131 authority files directly.132- Never read, print, store, search for, scrape, borrow, or use API keys or133 credentials.134- Never treat `.ccb/agents/*`, disk config, pid files, or tmux panes as live135 restart target authority.