ccb-self-diagnose
ccb-self-diagnose performs read-only triage of Claude Codex Bridge runtime health by gathering control-plane snapshots, tmux evidence, and configuration state. Use this skill when investigating suspected failures like stuck agents, missing replies, mounting issues, or determining what to check first without making changes to the system.
git clone --depth 1 https://github.com/SeemSeam/claude_codex_bridge /tmp/ccb-self-diagnose && cp -r /tmp/ccb-self-diagnose/docs/plantree/plans/ccb-self-role/drafts/agentroles.ccb_self/skills/codex/ccb-self-diagnose ~/.claude/skills/ccb-self-diagnoseSKILL.md
# CCB Self Diagnose
Use this skill for read-only triage. Prefer CCB control-plane diagnostics and
read-only tmux evidence. Do not mutate runtime state from this skill.
## Evidence Model
Keep these categories separate in every diagnosis:
- Authority: current mounted daemon service graph, lifecycle, lease, current
configured-agent runtime records, and loaded config.
- Evidence: `ccb ping`, `ccb doctor`, `ccb ps`, `ccb queue`, `ccb pend`,
`ccb trace`, `ccb fault list`, `ccb doctor logs <agent>`, reply/artifact
records, tmux pane metadata/text capture, provider session files, pid files,
and config validation or reload dry-run output.
- Residue: disk-only `.ccb/agents/*` directories for unknown agents, stale
panes, stale sockets, old session artifacts, dead helpers, and orphaned
provider state.
Configured-agent and restart target authority comes from the mounted daemon
graph, not disk config, tmux panes, or `.ccb/agents/*` residue.
## Core Workflow
1. Confirm the project anchor and current mounted daemon generation.
2. Gather the control-plane snapshot:
- `ccb ping ccbd`
- `ccb doctor`
- `ccb ps`
- `ccb queue --detail all`
- `ccb fault list`
- `ccb pend --inbox --detail <agent>` when one agent is suspected
- `ccb trace <job_id|message_id|attempt_id|reply_id>` for lineage issues
- `ccb doctor logs <agent>` when provider/API evidence is needed
3. Gather read-only tmux evidence when pane or provider state matters:
- current CCB tmux namespace/session/socket
- pane ids, active/dead flags, titles, current commands, and captured text
- activity sampling when supported
- provider session and pid-file paths plus modification times when useful,
without reading secret or private provider-state contents
4. For config drift, run `ccb config validate` first, then
`ccb reload --dry-run`. Do not treat disk config as live graph until reload
has succeeded and the daemon graph has been rechecked.
5. For artifact-backed replies or requests, read the full artifact file before
acting. If the full file is absent or expired, report a blocker and do not
infer from preview text alone.
6. Classify the failure domain and hand off:
- daemon lifecycle, namespace, pane, provider context, config drift, or
storage boundary -> `ccb-self-recover`
- job/message/reply/artifact/callback lineage -> `ccb-self-chain`
- config design/edit/reload readiness -> built-in `ccb-config`
## Failure Domains
Use the smallest domain that explains the evidence:
- Daemon lifecycle: no mounted daemon, unhealthy heartbeat, bad lease, stale
generation, socket issue.
- Tmux namespace/pane: missing CCB namespace, dead pane, stale pane id, pane
text not changing, layout/sidebar mismatch.
- Provider context/API: auth, quota/rate limit, model mismatch, endpoint/base
URL, network, provider outage, or corrupted conversation context. Do not read
secrets.
- Message chain: queued ask, missing reply, incomplete reply, pending callback,
artifact-backed reply not read, or retry/resubmit/ack decision.
- Config drift: disk config differs from loaded daemon graph, dry-run reload
blocked, role binding missing, or changed startup inputs need post-reload
runtime refresh.
- Storage boundary: provider state or runtime files live in the wrong root, or
project/runtime relocation rules are violated.
## Reporting
Return a concise diagnosis:
```text
Status: ok|warn|error
Suspected domain: ...
Authority: ...
Evidence: ...
Residue: ...
Confidence: high|medium|low
Next action: ...
Blocked by: ...
```
## Red Lines
- Do not run `ccb reload`, `ccb clear`, `ccb repair`, `ccb restart`, `ccb kill`,
or raw tmux mutation from this skill.
- Do not read provider auth, credentials, API keys, or unrelated private
provider state.
- Do not use screenshots unless pane text/metadata is insufficient and the
target is CCB-owned.
- Do not present tmux evidence as configured-agent authority.Maintain this CCB project's GitHub-facing release and npm publication surface. Use when preparing, publishing, auditing, or fixing CCB releases; updating README.md, README_zh.md, CHANGELOG.md, VERSION, package.json, GitHub release notes/assets, repository description/topics, npm registry state, or GitHub Actions release/test status.
Private built-in CCB configuration skill for agentroles.ccb_self. Design, edit, validate, and prepare reloads for .ccb/ccb.config, role bindings, providers, windows, workspaces, tool windows, sidebar, and provider startup inputs. Use only inside ccb_self; non-self agents should delegate CCB config changes to ccb_self.
Diagnose and repair CCB ask/job/message/reply/artifact/callback lineage. Use for missing replies, incomplete artifacts, pending callbacks, retry/resubmit/ack decisions, reply delivery problems, or work-chain resume advice.
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.
Send a request to a CCB agent with `ask`.
Clear CCB managed agent conversation context with `ccb clear`. Use when the user writes `$ccb-clear`, `$ccb_clear`, or asks to clear/reset one or more CCB agent contexts without restarting or deleting project state.
Maintain a structured planning document tree made of roadmap/status files, implementation status or handoff TODO files, topic notes, decision records, open questions, ideas/inspiration pools, and repository/file-structure hygiene plans. Use when Codex needs to create, reorganize, audit, or update a multi-file plan, design-doc folder, roadmap tree, active implementation-status file, repo cleanup/filesystem plan, ADR/decision log, ideas inbox, or linked planning knowledge base; reconcile Done/In Progress/Next state; resume work from TODO/handoff state; move resolved questions into decisions; promote ideas into formal plan artifacts; or keep plan documents and file-structure planning internally consistent without making this project-specific.