Skip to content
tinAI
Go back

CC-Canary: phát hiện regression trong Claude Code, hoàn toàn offline

Bài gốc: CC-Canary — Drift detection for Claude Code

Tác giả: delta-hq

Ngày đăng: Dịch ngày:

TL;DR

Agent Skill quét session JSONL trong ~/.claude/projects/, tính metric như read:edit ratio và reasoning loops rồi cho verdict HOLDING / SUSPECTED / CONFIRMED REGRESSION. Hoàn toàn local, không telemetry.

Giới thiệu

CC-Canary là drift detection cho Claude Code, đóng gói thành hai Agent Skills có thể cài. Nó đọc session JSONL mà Claude Code đã tự ghi trong ~/.claude/projects/, phát hiện model có drift trên work của chính bạn hay không, và tạo ra forensic report có thể chia sẻ.

Không network, không account, không telemetry, không daemon chạy ngầm. Chạy trên dữ liệu đã có sẵn trên disk.

Status hiện tại: 0.x / pre-alpha — format output và metric set có thể thay đổi.

Tính năng chính

Hai skill

SkillInvocationOutput
cc-canary/cc-canary [window]markdown writeup (./cc-canary-<date>.md) — paste-ready cho GitHub issue hoặc gist
cc-canary-html/cc-canary-html [window]HTML dashboard dark theme (./cc-canary-<date>.html), tự mở trong browser

Window mặc định 60d. Accept 7d / 14d / 30d / 60d / 90d / 180d.

Nội dung mỗi report

Metrics đáng chú ý

Cách sử dụng

Install

npx skills add delta-hq/cc-canary

Cài một skill riêng:

npx skills add delta-hq/cc-canary --skill cc-canary
npx skills add delta-hq/cc-canary --skill cc-canary-html

Chạy

Trong Claude Code session bất kỳ:

/cc-canary 60d
/cc-canary-html 30d

Requirements

Cách hoạt động

  1. Scan: Python script (stdlib-only, không pip, không Node) walk ~/.claude/projects/**/*.jsonl, filter theo window, exclude subagent sessions mặc định.
  2. Dedupe: Assistant message dedupe trên (message.id, requestId) — cùng scheme với ccusage, vì Claude Code ghi cùng message vào nhiều JSONL khi session resume/branch.
  3. Aggregate: Per-session metrics — tool-mix, read:edit ratio, reasoning-loop phrases, self-admitted errors, premature stops, interrupts, token usage, cost (current Claude 4.x rates), hour-of-day thinking depth.
  4. Detect inflection: Composite health score per day; argmax của |before − after| over candidate dates với 0.75σ floor. Fallback median-timestamp split nếu không có break đạt ngưỡng.
  5. Pre-render report: script viết skeleton markdown/HTML với mọi table và bar chart đã fill sẵn. Chỉ ~20 slot narrative ngắn (marked <!-- C: ... -->) để Claude fill — verdict line, summary, per-finding reasoning, root-cause.
  6. Fill & save: Claude đọc skeleton, viết narrative, save file cuối.

Total runtime: ~2.5s cho script + 10–20s cho Claude fill narrative.

Privacy

Dev nên quan tâm vì

Cảm nhận “Claude Code dở dần” thường subjective và khó defend. Tool này cho bạn con số cụ thể trên dữ liệu của chính mình — đủ rigor để đưa vào bug report hoặc forum post. Hợp với ai dùng Claude Code hàng ngày và muốn track xem có drift thật hay chỉ là hôm xấu trời.


Read Original (EN) Quay lại Newsletter