| name | ccdebug |
| description | List live Claude Code sessions on this machine with pid, name, status, sid, cwd, and current tweet-length summary. Invoked only via /ccdebug:ccdebug. |
| disable-model-invocation | true |
/ccdebug:ccdebug
Print a one-row-per-session table summarizing every live Claude Code CLI session
on this machine, by reading the ccwatch data layer under ~/.claude/.
When to invoke
Only when the user explicitly runs /ccdebug:ccdebug. Not proactive.
Do not invoke from other tasks.
Output
A markdown table with these columns, in this order:
| pid | name | status | sid | cwd | tweet |
- pid -- filename stem of
~/.claude/sessions/<pid>.json.
- name --
name field from ~/.claude/state/launch/<pid>.json; - if missing.
- status --
status field from sessions/<pid>.json (idle / busy / waiting).
- sid -- last 8 chars of
sessionId from sessions/<pid>.json.
- cwd -- basename of
cwd from sessions/<pid>.json.
- tweet -- contents of
~/.claude/state/summaries/<sid>.txt if present and
non-empty; else (no summary yet).
Sort rows by status: waiting first, then busy, then idle. Things needing
attention go on top.
How to gather the data
ls ~/.claude/sessions/*.json to enumerate candidates.
- For each file:
- Parse the JSON. The pid is the filename stem.
- Skip if
entrypoint != "cli" (print-mode sdk-cli rows have status: null).
- Run
kill -0 <pid> (silently). Skip if it fails -- stale file from a
SIGKILL'd process.
- Record
sessionId (camelCase in this file), status, cwd.
- Read
~/.claude/state/launch/<pid>.json -- pull name. If the file is
missing, use -.
- For the tweet:
- Read
~/.claude/state/summaries/<sessionId>.txt (use the camelCase
sessionId from the sessions file, not snake_case).
- If the file is absent or empty, use
(no summary yet).
- Render the table, sorted as above.
Use a small Python one-liner (python3 -c '...') for the JSON reads. ccwatch
deliberately avoids a jq dependency.
Edge cases
- No live sessions: print
No live Claude Code sessions. -- no table.
~/.claude/state/ missing: print one line:
ccwatch state directory not found; hooks have not run yet. Do not error out.
- Missing
launch/<pid>.json: use - in the name column, do not warn.
- Missing or empty summary:
(no summary yet) in tweet column.
Don'ts
- Do not try to detect or summarize Agent-tool subagents. They are invisible by
design (CLAUDE.md architecture invariant 5); only CLI subagents
(
claude -p, filtered out above as sdk-cli anyway) get pid files.
- Do not modify any file under
~/.claude/. This skill is read-only.
- Do not shell out to
claude or invoke the harness.
- Do not read
~/.claude/tasks/ -- ccwatch no longer reads task shards
(CLAUDE.md architecture invariant 1). The tweet comes only from summaries/.