Trace & Benchmark
How MeowKit measures itself: the trace log, the mewkit trace commands, scatter-gather analysis, the benchmark canary suite and the dead-weight audit.
Every harness component assumes something about what the model cannot do, and those assumptions age. The trace log and the benchmark suite give evidence from real runs, so a maintainer decides what to keep from measurements. Nothing in this loop changes the harness on its own. Trace content is data (see injection-rules.md), and every suggestion goes to you for a decision.
hooks append records → .meowkit/telemetry/trace-log.jsonl
→ mewkit trace score | audit | propose (deterministic, no subagents)
→ /mk:trace-analyze (scatter-gather, asks you per suggestion)
→ /mk:benchmark run | compare (maintainers, source repository)
→ dead-weight audit (maintainers)The trace log
.meowkit/telemetry/trace-log.jsonl is an append-only JSONL file. Every record has the same envelope:
{
"schema_version": "1.0",
"ts": "2026-04-08T14:30:00Z",
"event": "session_end",
"run_id": "260408-1430-myapp",
"harness_version": "3.1.0",
"model": "claude-sonnet-4-5",
"density": "FULL",
"data": {}
}Hooks and harness steps write records through append-trace.cjs. Event types written today:
| Event | Writer | When |
|---|---|---|
file_edited | learning-observer.cjs | A file is edited, with its edit count in the session |
delegation_brief_check | delegation-brief-check.cjs | A subagent is delegated to; the data holds two booleans, whether the brief has a Goal: and a Return: label, and never the brief itself |
ship_check | the ship check (lib/core/pre-ship.cjs) | A ship command is checked; the data holds outcome (passed, failed or could_not_run), cause and action (commit, push, merge, pr-create, pr-merge), and never the command text |
session_end | post-session.cjs | A session closes |
dead_weight_audit_needed | post-session.cjs | The session's model differs from the previous session's |
task_transition | mewkit task | A durable task changes status |
friction | mewkit trace --friction | A friction note is recorded |
orient_run | mewkit orient | An orientation run, unless --no-record is passed |
benchmark_result | mk:benchmark | A canary suite run |
Three optional keys may sit before data, and each is left out when unknown. session_id is the host session (HOOK_SESSION_ID, else the session marker). skill is written only when the writer names the skill for certain, such as mewkit trace --friction --skill <name>; it is never inferred. signal is one token from a closed set. Strong signals are denied_tool_call, user_interruption, task_failure, explicit_report and ship_check_result; weak ones are tool_error, retry and advisory_hook. Today ship_check records carry ship_check_result, and a friction note recorded with --skill carries explicit_report. A record without a skill key never counts toward a skill's signals. Readers ignore keys they do not know, so older binaries read these records unchanged.
Writes happen under a file lock, and a record is dropped rather than blocking a hook. Payloads pass through lib/secret-scrub.cjs before they are written, so keys, tokens and credential strings are stripped. Records are never edited after they are appended.
When the file passes 50 MB, the next append rotates it to trace-log.{YYMMDD-HHMMSS}.jsonl.gz and starts a fresh log.
Commands
| Command | What it does |
|---|---|
mewkit trace score [--id RUN] | Trace-quality tier per run lane |
mewkit trace audit | Entropy, and counts of orphaned, stale, unverified-run and repeated-friction records |
mewkit trace propose [--commit] | Groups repeated friction (2 or more) and drift into advisory backlog items. Without --commit it only prints them |
mewkit trace --friction "<note>" [--responsibility R] [--id RUN] [--skill NAME] | Records a friction note |
Record friction when you correct the agent by hand. A note about a skill is best encoded in that skill's Gotchas section.
Scatter-gather analysis
/mk:trace-analyze [--runs N] (default 20) is for patterns that need cross-run synthesis:
- Ingest the last N records.
- Partition them by run into at most 3 batches.
- Scatter: three
researchersubagents analyze one batch each. - Gather: the main agent merges the cross-batch patterns.
- Draft structured suggestions.
- Ask you about each suggestion, one at a time. There is no bulk approve.
A pattern needs 3 or more occurrences to become a suggestion, so one bad run does not drive a change. The skill is skipped when there are fewer than 3 records, or when the last analysis ran within 24 hours with no new records. Output goes to plans/{date}-trace-analysis/: findings.md, suggestions-draft.md, suggestions.md (approved only), rejected.md and analysis.md.
Measuring a change with evals
mewkit eval measures whether a skill or rule change helps. Record a report before the change and one after, on the same pinned model, then compare them:
mewkit eval run --suite baseline --model <pinned-model> --max-cost-usd 5 --max-runs 40 --kit-archive meowkit-release.zip
mewkit eval compare .meowkit/telemetry/eval/<before>.json .meowkit/telemetry/eval/<after>.jsonA difference counts only when it is larger than the report's margin: the measured run-to-run spread, and never less than 10 percentage points. Flags and the sandbox are described on the Cost and Telemetry page.
Benchmark canary suite
/mk:benchmark is a maintainer-only procedure. The published kit does not carry the skill or its specs, so it runs from the source repository, not from an installed project.
| Command | Tasks | Cost cap | Purpose |
|---|---|---|---|
/mk:benchmark run | 5 quick tasks | $5 | Regression check after a harness change |
/mk:benchmark run --full | 5 quick tasks and 1 heavy task | $30 | Full dead-weight audit cycle |
/mk:benchmark compare A B | none | none | Delta table between two earlier runs |
The quick specs in .claude/benchmarks/canary/quick/ are a React component, an API endpoint, a bug fix, a refactor and a TDD feature, each a one-sprint task run through mk:cook. The full tier adds 06-small-app-build-spec.md, a product build through mk:autobuild, and runs only with --full.
Results go to .claude/benchmarks/results/{run-id}.json and to the trace log as benchmark_result events, so mk:trace-analyze can correlate scores with run patterns.
Dead-weight audit
The audit decides whether a harness component still earns its place. The rules are in .claude/skills/benchmark/references/dead-weight-audit-rules.md.
- List the components to test.
- Run
/mk:benchmark run --fullwith the component on and record the run id. - Disable the component, by environment flag or by commenting out a hook registration or a rule import.
- Run
/mk:benchmark run --fullagain. - Run
/mk:benchmark compare {baseline} {disabled}and readmeasured_delta, which is the baseline average minus the disabled average. - Decide, then re-enable the component.
| Delta | Decision |
|---|---|
| 0 or below | Prune candidate |
| Above 0 and below 0.02 | Watch, revisit next cycle |
| 0.02 or above | Keep, with the delta recorded |
A component is pruned only after a delta under 1 point across two consecutive model versions. Security rules, the evaluator's active verification and the ship check are never pruned.
Run the audit on each model release, quarterly, when mk:trace-analyze surfaces a recurring no-value pattern, and when the harness feels heavy. post-session.cjs tries to flag model changes through MEOWKIT_MODEL_HINT, so without that variable the audit has to be triggered by hand.
Related
- Skill: trace-analyze and skill: benchmark
- Hooks for the handlers that write records
- Autonomous build for the pipeline being measured
- Adaptive density for the matrix the audit updates
Skill Audit
Every shipped skill scored on the rubric criteria a program can check: description shape, entry size, dead references, emphasis, harness tool names and duplicated passages.
Using MeowKit Productively
Hand off checks, stop conditions and triggers to the workflow, and keep the memory store current so each session starts with what the last one learned.