# CCD Start — Extended Details

Load this reference on failures, adapter-specific paths, delegation, or when the compact skill instructions are insufficient.

## Runtime Integration Boundary

Per-harness host integration left CCD in the Phase 3 + 5 slimdown. CCD no
longer ships `host`, `host-hook`, `hooks`, or `init`. Runtime integrations feed
lifecycle facts through their native adapter mechanism, or through an external
Lifeloop adapter when one is available; CCD then reacts as the continuity
client through its runtime-neutral surfaces.

Choose the startup path based on the current runtime:

- If the runtime already invokes CCD at session start, ensure it calls
  `ccd start --activate --path .` or the lower-level `ccd session-state`
  primitives described in `docs/reference/session-liveness-contract.md`.
- If the runtime has no integration, use `/ccd-start` or raw
  `ccd start --activate --path .`.
- If a future Lifeloop adapter supplies hook installation for the runtime,
  treat that adapter as the owner of hook placement and receipts. Do not
  recreate CCD-side host scaffolding.

### Runtime-neutral startup

```bash
ccd --output json start --refresh --activate \
  --fields command,ok,disposition,thread,compact_summary,session_boundary,lifeloop_renewal,alerts,recovery,escalation,activation \
  --path .
```

Treat `session_boundary` as the control-plane recommendation, and
`thread` as the channel binding identity. Treat `compact_summary` /
`lifeloop_renewal` / `recovery` / `escalation` / `alerts` as the
operator-summary source. The optional `prompt_injection` CCD1 block is a compact
CCD payload; JSON remains authoritative.

If `lifeloop_renewal.state` is `pending_continuation`, restart through the
runtime's Lifeloop renewal profile rather than running an unqualified start. If
it is `failed` or `expired`, surface `failure_class`, `retry_class`, and
`message`; do not infer recovery from token files.

If the startup command fails on a pending renewal lease, use the continuation
command printed by `ccd session renew prepare`; an unqualified start must not
claim the channel while renewal is pending.

### Substrate-neutral and runtime-driven delegation

- Keep this skill substrate-neutral except for `session-state start`.
- Keep machine identity, machine presence, and `coordination_scope` separate.
- `docs/reference/cross-runtime-continuity-walkthrough.md` is the authoritative Codex → Hermes continuity walkthrough.

## Delegation

If the developer wants sub-agents:

- Keep the parent session authoritative for workspace-local continuity.
- Prepare bounded child context from the parent's current `ccd start` /
  `ccd state export` output.
- Shared-workspace children should consume the parent-provided context instead
  of rerunning `ccd start` / `ccd checkpoint`.
- Route delegated repo writes to `ccd session open` or `ccd-git-workflow`.

## Error Recovery

- If the command exits non-zero or produces no valid JSON → report error, suggest `ccd doctor --path .`.
- If any alert has severity `error` → run `ccd doctor --path .` and surface output before summary.
- If start fails because workspace is not attached (`.ccd.toml` missing):
  1. Display: "⚠️ This project workspace is not attached to a CCD profile."
  2. Ask: "Run `ccd attach --path .` to connect it?"
  3. If confirmed, run attach and retry from Preflight step 3.
- If start fails because profile does not exist → suggest `ccd attach --path . --profile <name>`.

## Session Bootstrap Ownership

After the developer confirms:

1. Do not rerun bootstrap — the startup command already recorded `session_start` / activated telemetry.
2. If `activation` field is missing (older CLI), fall back once to `session-state start --path .`.
3. If session should be tagged as research/implementation intent, pass it through the initial bootstrap call.
4. Report fallback bootstrap failures briefly and continue — treat as best-effort.
