mk:trace-analyze
Mines the harness trace log for recurring failures with parallel analysis and a human review of every suggestion.
| Source | .claude/skills/trace-analyze/SKILL.md |
| Owner | observability |
| Runtime | claude-code |
| Risk | medium |
What it does
mk:trace-analyze reads .meowkit/telemetry/trace-log.jsonl, splits the records into batches, has up to three researcher subagents analyse them in parallel, and combines the results into patterns. Every suggested harness change is reviewed by you one at a time, and nothing is applied automatically.
Use it after three or more harness failures on the same task, or on a quarterly audit. Skip it when the log has fewer than 3 records or nothing new has been recorded in the last 24 hours.
When not to use it
For a sprint retrospective from git history, use mk:retro. For a quick answer without subagents, use the mewkit trace command:
| Command | Effect |
|---|---|
mewkit trace score [--id <run>] | Trace-quality tier per run |
mewkit trace audit | Entropy, plus counts of orphaned, stale, unverified and repeated-friction items |
mewkit trace propose [--commit] | Groups repeated friction (two or more) and drift into advisory backlog items. Dry run unless --commit. |
mewkit trace --friction "<note>" [--responsibility <r>] | Records a friction note |
Use the command for fast recall and this skill when patterns need synthesis across runs.
Usage
/mk:trace-analyze [--runs N] [--pattern <type>]--runs counts distinct runs and defaults to 20. The procedure is in references/run-procedure.md; script paths are relative to ${CLAUDE_SKILL_DIR}.
Steps
- Ingest the last N runs with
scripts/trace-records.cjs, which needs nojq. - Detect: the script applies the taxonomy signals that the trace still carries; the others are judged by reading (with up to 3 read-only subagents only for a large log).
- Keep patterns with at least 3 occurrences.
- Draft one structured suggestion per pattern from
references/error-taxonomy.md. - Human review: ask you about each suggestion and write the approved ones to the analysis folder.
A pattern needs at least 3 occurrences before it becomes a suggestion. Trace records are append-only data, and the analyser never changes them.
Outputs
All under tasks/reports/{date}-trace-analysis/:
| File | Content |
|---|---|
findings.md | Patterns above the threshold |
suggestions-draft.md | Suggestions before review |
suggestions.md | Approved suggestions |
rejected.md | Rejected suggestions with reasons |
analysis.md | Final summary |
An optional follow-up plan from the approved items can feed mk:plan-creator --hard, or --deep when findings span five or more module areas.
Gotchas
- Approve suggestions one by one. Bulk approval is automated overfitting.
- One failed run is not a pattern.
- Cite records by
ts,eventandrun_idinstead of pasting them into the plan. - A log under 3 records gives no signal, and 20 or more is better.