SCAR — Version Control for Negative Knowledge
Git records what your codebase is. Nothing records what it refused to be.
SCAR is a git-native system for capturing, anchoring, and enforcing the negative knowledge of a codebase — the dead ends, the load-bearing weirdness, the invisible tripwires — and surfacing it at the exact moment someone (human or AI agent) is about to step on it.
The one-liner
Every codebase is a battlefield where the bodies have been removed. SCAR puts the markers back.
The three primitives
| Type | Meaning | Example |
|---|
deadend | We tried X. It failed because Y. Don't retry unless Z changes. | "We tried Redis for session storage in 2024-03. Eviction under memory pressure logged users out mid-checkout. Don't retry unless sessions become re-derivable." |
fence | This code looks wrong. It is intentional. Here's why. | "Yes, this retry loop sleeps 7 seconds, not 5. The upstream vendor's rate limiter has a 6-second window they don't document." |
landmine | Changing A breaks B in a way nothing in the code tells you. | "The CSV export in reports/ depends on the column order of this SELECT. Reorder it and Finance's reconciliation pipeline silently corrupts." |
Why now
AI agents write an increasing share of all code. Agents have zero hallway memory. They see a weird retry loop and "clean it up." They see a missing cache layer and re-add the library that was removed after a data-corruption incident. They retry, across thousands of sessions, the exact approaches that already failed — because the repository only records positive space.
Humans at least had tribal knowledge. Agents have none. And as agents author more of the code, the negative knowledge stops even entering human memory — it evaporates entirely.
The flip side: agents also solve the historically fatal flaw of every knowledge-capture system — authorship cost. Nobody writes documentation after a failure. But an agent that just tried an approach and abandoned it can write a deadend scar in milliseconds, for free, at the moment of maximum context.
Agents created the urgency. Agents remove the adoption barrier. That's the wedge.
Documentation
Docs site: https://daily-nerd.github.io/Scar/ — quickstart, concepts, measurement methodology, agent integration, changelog.
AI agents: a machine-readable index lives at llms.txt.
In one paragraph: scars are small YAML+Markdown files in .scars/, tracked in git and reviewed in PRs, anchored to code via paths, tree-sitter symbols, and diff-scoped patterns — not line numbers. A pre-edit hook injects relevant scars into an agent's context at the moment of action; an optional violation: regex is a post-edit tripwire that makes compliance measurable. Advisory, never blocking, by default; agents and scar harvest write only candidates, a human promotes.
Install
uv tool install scar-cli # or: pipx install scar-cli
Symbol anchors (function/class names that survive file moves) need the
tree-sitter extra; without it they silently don't resolve and only scar lint
warns:
uv tool install "scar-cli[symbols]"
The parser and agent hook hot-path are stdlib-only; the human-facing CLI adds
rich + rich-argparse for formatted output. Python ≥3.10.
Quickstart
cd your-repo
scar init # creates .scars/ with template + seeded example
cp .scars/template.md .scars/candidates/redis-sessions.md
$EDITOR .scars/candidates/redis-sessions.md
scar lint # validate format
scar promote redis-sessions.md # human review gate: candidate -> active
scar hook install # detects installed hosts, asks which to wire (--all, --runtime X)
scar skill install # same detection for the scar-authoring skill
scar hook status # every host with the channel that serves it (settings, plugin, none)
scar skill install writes the scar-authoring skill to a native path for Claude Code, Codex, Cursor, opencode, or Windsurf. Claude Code is the one confirmed to load it, and the rest are written per vendor documentation but unverified: see the per-host table for which is which.
Claude Code users: the marketplace plugin ships the hooks and the scar-authoring skill together. scar hook install and scar skill install see the plugin and skip Claude unless you pass --runtime claude --force. Re-run scar skill install after upgrading a manual install; the installed skill is a static copy.