Debrief Coding
Read .cache/codemap/logs/ JSONL, analyse use, and write a diagnostic report. Include recursive claude/, codex/, and direct/ shards; keep legacy flat records unattributed. Codex records runtime-scoped CLI/tool shards but no skill starts, so missing skill telemetry and cross-layer joins are evidence gaps.
NOT for: installation/integration health (use $codemap-py:integration audit); index build or structural query (use $codemap-py:scan-codebase or $codemap-py:query-code).
Runtime note
Codex has no bin/ PATH entry or plugin-root variable. Resolve the installed root once, substitute it for PLUGIN_ROOT, and retain it in reasoning; shell state does not persist. Telemetry otherwise matches Claude: local JSONL under .cache/codemap/logs/.
Flags
--since <YYYY-MM-DD>: records on/after date; default all.--session <id>: one session UUID.--anonymize: runanonymize.py; pseudonymize qualified names and shard stems, preserve topology, store salt only at.cache/codemap/logs/.salt.--output <path>: report path; default.reports/codemap/debrief-<YYYY-MM-DD>.md.
Workflow
1. Verify logs
find .cache/codemap/logs -type f -name '*.jsonl' -print 2>/dev/null
No files: stop: "No codemap telemetry found. Run any $codemap-py:* skill or codemap-py query/index command to start collecting logs." Collect every matching shard recursively; cli_<session>.jsonl, skills_<session>.jsonl, and tools_<session>.jsonl live below each runtime directory. Flat shards remain unattributed; never infer Claude from tool names. token_measurement is unavailable because host hooks expose no token usage.
2. Anonymize when requested
python PLUGIN_ROOT/bin/anonymize.py --input .cache/codemap/logs --out-dir .cache/codemap/export
Use only anonymized copies after this step; never mix with raw data. They are separated from .salt; never target the log directory. With no shard, stop: "no CLI or skill logs found — cannot produce an anonymized report." With one layer, anonymize it and report the gap.
3. Read and filter records
Read every CLI, skill, and tool shard recursively; one file is incomplete. Each line is JSON. Filter ts by --since and session by --session; an empty filter in one layer is expected because a UUID can be absent there.
- CLI:
ts,layer,runtime,v,session,cmd,argv,result(count,query_complete,completeness_reason,stale,method,not_covered,error; index alsotrigger,changed_count,incremental,stale_before,result_currency),timing_ms, optionalstderr/exit_code. - Skill:
ts,layer,runtime,v,session,skill,event,intent,hook_session. - Tool:
ts,layer,runtime,v,session,skill,event,tool,target.
4. Analyse
Exclude source: "bench" and CLI records with empty cmd from organic stats; report their count as "scripted/polluted records excluded: N". When present, group headline statistics by distinct v, overall, runtime, and unattributed legacy records.
- CLI: invocations; success/error (
exit_code: 0success; non-zero error; absent success unlessresult.error); completeness reasons; subcommands; median/p95/maxtiming_ms; non-emptynot_coveredfraction; top five error prefixes; stale fraction. - Skill: starts by name, sessions, first/last timestamp.
- Cross-layer: linked skill→N CLI chains, average calls per skill session, refresh triggers, changed-count distribution, index-only sessions, incomplete/degraded fractions; legacy provenance unknown.
Join tool searches/reads to a complete (query_complete: true) CLI answer for the same module within the window: a match is an avoidance event, not an incorrect answer.
python PLUGIN_ROOT/bin/join_avoidance.py --logs .cache/codemap/logs --window-min 10 --json
High avoidance means guard/context/model dead-chain risk. Preserve per_runtime and unattributed; report count/rate in Overview and flagged modules when non-zero. Do not claim measured token savings or live fresh-session activation.
5. Write report
Default output is .reports/codemap/debrief-<YYYY-MM-DD>.md; use --output if supplied.
mkdir -p .reports/codemap
Include Overview (2–3 sentences), subcommand distribution, performance (median/p95/max), coverage gaps, top-five error patterns (none when clean), skill invocations, and session timeline (first/last, sessions; full chronology for --session). Print the path.
Security
Logs and salt are local. Never share .cache/codemap/logs/.salt; anonymized files are shareable without it.