# CCD Start — Extended Details

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

## Runtime Adapters

Choose the startup path based on the current runtime:

- **Codex** → `codex`: launcher is Tier 1 `launcher_wrapper` convenience; `/ccd-start` / `ccd start --activate` is the Tier 0 baseline
- **Claude Code** → `claude` (alias `claude-code`): Tier 2 `native_hook` — runtime calls CCD automatically after install
- **OpenClaw** → `openclaw`: Tier 3 `reference_adapter` — runtime lifecycle calls CCD after `ccd init` + `ccd host apply --host openclaw --path .`
- **Hermes** → `hermes`: Tier 3 `reference_adapter` — same as OpenClaw with `--host hermes`
- **Gemini CLI** → `gemini`: shipped adapter, no repo-local install path yet
- **OpenCode** → `opencode`: shipped adapter, no repo-local install path yet

If the runtime is unclear or has no shipped adapter, skip to the raw CLI fallback.

### Preferred lifecycle bootstrap (host-hook)

```bash
ccd --output json host-hook --path . --host <adapter> --hook on-session-start
```

Parse the host-hook report. Treat `session_boundary` as control-plane recommendation, `compact_summary` / `recovery` / `escalation` / `alerts` as operator-summary source, `context` as prompt-build injection, `telemetry` as measurement only, and `session_start` as bootstrap confirmation.

If the host-hook report omits `compact_summary` (older CLI), run:
```bash
ccd --output json start --refresh --memory-depth metadata \
  --fields command,ok,disposition,compact_summary,session_boundary,alerts,recovery,escalation \
  --path .
```

### 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 (pod identity retained as legacy anchor under RFC 0006 compat window).
- `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 with `ccd runtime-state child-bootstrap --path .`.
- Shared-workspace children should consume `child-bootstrap` 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.
