hailneed MIT · local-first

00 hailneed suite · module 03 · closed loop

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.

01 Evidence

This machine's own scars,
ranked by cost.

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.

scar mine — markdown out
# scar — recurring failures

Source note: 156 sessions scanned (all, 90d) · 305 failure episodes
             · 6 low-confidence signatures dropped · 16 scars

| Id             | cost | sessions | projects | family            | artifact | error                        |
|----------------|------|----------|----------|-------------------|----------|------------------------------|
| `scar-0eqc684` |   68 |       14 |        5 | shell-quoting     | rule     | unexpected EOF while looki…  |
| `scar-0qkezmw` |   42 |        8 |        4 | edit-precondition | rule     | <tool_use_error>String to…  |
| `scar-12srzqa` |   36 |        6 |        5 | not-a-git-repo    | rule     | fatal: not a git repositor…  |
| `scar-08kw0mp` |   12 |        2 |        2 | timeout           | rule     | Command timed out after 2m…  |
| `scar-0w2b7dp` |   12 |        2 |        2 | compile-error     | test     | Build failed. Use dotnet b…  |

## What to do

`node scar.mjs --draft scar-0eqc684` → rule

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 toonode scripts/scar.mjs --mine --md --lang en
  • CI-ready--verify --out verify.json has a stable output format; gate on written[].verdict.
Marketplace manifest

03 Commands

Three commands.
One closed loop.

01

/scar:mine

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 judgementscars.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.

06 Family

One suite.
Five more modules.