Failures that repeat, written down — then measured.
agent-blackbox tells you what went wrong. scar writes it down so it stops:
it mines the session logs Claude Code, Codex CLI and Gemini CLI already keep
on your disk for failures that recur across separate sessions, drafts the
rule, test brief or fix — and later measures whether the lesson held.
No network calls, and it never writes into your repo on its own.
Abridged from an actual run of --mine --days 90 on the machine this
site was built on. Rows that named private projects are left out and long error
lines are truncated; the counts are what the miner printed. Nothing in it ever
left that machine.
The ranking is by cost, not raw count — separate sessions × 3, projects
touched × 2, repeats capped, +4 when more than one agent hit the same wall.
One bad afternoon of retries counts as a single episode. The 16 families that
classify each scar are
a pattern list you can open,
and the next step is printed under the table.
02 Install
One marketplace. Then one command.
claude code
# once> /plugin marketplace add hailneed/plugins
# the closed loop> /plugin install scar@hailneed
# and try it> /scar:mine
Claude Code and Node.js 18 or newer.
No dependencies, no API key, no quota spent.
Standalone works too — node scripts/scar.mjs --mine --md --lang en
CI-ready — --verify --out verify.json has a stable output format; gate on written[].verdict.
Recurring failures, ranked by what they cost: which error came back in how many
separate sessions and projects, the commands that failed, and what worked right
after. When most episodes end with a different tool succeeding, the report says
so — the lesson is a tool choice, not a better command.
02
/scar:write <id>
The durable lesson: a rule, a regression-test brief, an environment fix or a
decision record — each carrying an evidence line and a scar marker so the
result can be measured later. It shows you the draft and asks; it never writes
into your repo on its own.
03
/scar:verify
Did the lesson hold? For every marked artifact, the failure's recurrence count
before and after it was written. Four verdicts: held, recurred, too recent,
no evidence. A rule that recurred is a finding about the rule.
04 Trust
Claims you can check in the source.
No network calls, no repo writes. Drafts go to stdout —
scar.mjs contains no fetch, no sockets, and you decide what lands in the repo.
16 families, no model judgement —
scars.mjs is a pattern list you can read, and --selftest proves it without touching your data.
Retry loops do not inflate the ranking. An episode is one run of consecutive failures plus the first success after — twenty attempts in one session is one lesson.
The loop only closes with evidence.verify counts recurrences before and after the marker's date; without a marker, whether a rule works stays a matter of opinion.
Failure stays visible. Unreadable sessions and dropped low-confidence signatures are counted in the source note, never silently hidden.
MIT.LICENSE — no account, no signup, no telemetry.
05 Cloud
scar Cloud is in design.
The plugin stays free and local — that is a promise, not a phase. Cloud is the
optional layer for teams that hit the same walls separately:
Team-wide scar pool — the wall one person hit becomes everyone's rule.
Rule-effectiveness time series — which lessons hold across the team, and which quietly stopped working.
Onboarding summary — "known traps in this repo", ready for whoever joins next.