---
name: ccd-radar
description: This skill should be used when wrapping up a session, at natural checkpoints, or when context pressure is high — evaluates session delta against the CCD state model and updates the workspace-local handoff
---
# CCD Radar Gate
Machine-centric handoff. Evaluate the session delta against the landed CCD state model, update the workspace-local handoff when needed, and wrap up cleanly only after the developer approves.
## Gotchas
- **Shared safety contract:** evaluate read-only state first, honor preview/apply metadata, stop short of Git follow-through or destructive repair until developer approves.
- **Human-facing default is outcome-first:** keep brief short, calm, action-oriented. Use CCD internals to decide, not to dump onto the developer.
- **Native handoff is CLI-owned:** update through `ccd handoff write` (stdin JSON). Never hand-edit `state.db`.
- **Handoff write validates:** rejects neutral titles, empty `immediate_actions`, empty `definition_of_done`.
- **Recovery is CLI-owned:** persist via `ccd recovery write` (stdin JSON).
- **Memory has a token cost:** only propose an entry when a pattern repeats twice or a hard rule changes.
- **CLI unavailable = blocked close-out:** do not clear session state or present as fully handed off.
- **Git workflow split:** branch/worktree/commit/push/merge belongs in `ccd-git-workflow`; queue, assignment, and extension-owned context belongs behind explicit extension surfaces.
- **Stale worktree binaries:** never fall back to `./target/debug/ccd`.
## Human-facing brief contract
- Start with the outcome, not the diagnosis.
- Never enumerate empty categories ("Blockers: none").
- Keep CCD internals (`behavioral_drift`, `session_boundary`, `candidate_updates`) out of default brief.
- Translate continuity problems into operator-safe language.
- Ask at most one direct question. If no input is needed, finish and say it is handled.
## Gather session state
1. Resolve CLI: `CCD_BIN` → `which ccd` → `$HOME/.ccd/bin/ccd` → `$HOME/.cargo/bin/ccd`. Do **not** fall back to `./target/debug/ccd`.

2. Run:
   ```bash
   ccd --output json handover \
     --since-session current \
     --memory-depth metadata \
     --fields command,mode,session_delta,handoff,git,session_state,recovery,projection_telemetry,work_stream_decay,session_boundary,evaluation,candidate_updates,approval_steps,context_health,behavioral_drift,escalation \
     --path .
   ```
   Load `references/handover-schema.json` for field-level descriptions.
   Clean close-out: prefer `ccd --output json handover --close-clean --path .` when handover reports no material findings; it clears the session only when there are no candidates, unfinished gates, or human-choice surfaces. If `close_clean.outcome` is `refused`, preserve the reason and use manual `--commit` only after deciding the candidate writes explicitly.
   Write coalescing fallback: append `--commit` and pipe JSON with optional `handoff`, `recovery`, `clear_session` fields to reduce 3-5 tool calls to 1.

3. If CLI is unavailable, see `references/radar-details.md` for fallback path.

## Evaluate session
Evaluate accomplishment, blockers, policy drift, behavioral drift, context health, and session boundary. Use `session_boundary` as primary recommendation, then `evaluation` buckets and `candidate_updates`.

**Classify findings:**
- **Clean:** no blockers, no drift, every `behavioral_drift.signals` entry `aligned`/`no_signal`. Common case.
- **Material findings:** blocker, retargeting needed, policy drift, or any `drift` signal. Requires human decision.

On clean evaluation → fast-path: do not rewrite handoff if only live checkout context changed.
On material findings → present findings, ask one question, draft correction. See `references/radar-details.md` for detailed evaluation rules.

## Execute handoff
Run in order without per-step confirmation.

1. **Uncommitted check:** use `git.*` fields from handover output (do not issue separate `git status`).
2. **Draft:** update handoff via `ccd handoff write --path .` with stdin JSON: `{"title": "...", "immediate_actions": [...], "completed_state": [...], "operational_guardrails": [...], "key_files": [...], "definition_of_done": [...]}`.
3. **Validate:** if AGENTS.md was modified, run `ccd sync --path .`. Run `ccd doctor --path .` only if radar wrote to policy/memory files.
4. **Clear session:** run `ccd session-state clear --path .`.
5. **Git hand-off:** route to `ccd-git-workflow` if the developer wants branch/PR workflow.

For extended evaluation rules, material findings prompt, fallback paths, and recovery handling, load `references/radar-details.md`.
