<< All versions

Skill v1.0.0

currentAutomated scan100/100
tyfarrago-hub/compound/friction-audit
──Details
PublishedNovember 15, 2026 at 02:14 PM
Content Hashsha256:48dd9ac7dcc39b5f...
Git SHAcacef0cda877
──Files
Files (1 file, 5.7 KB)
SKILL.md5.7 KBactive
SKILL.md · 92 lines · 5.7 KB

name: friction-audit description: Mine your own Claude Code session transcripts for recurring failure patterns, cluster them by evidence, and turn the top clusters into concrete guardrails (skills, CLAUDE.md rules, hooks). Use when the user asks to audit recent sessions, find friction, figure out why sessions keep going wrong, or improve how Claude works for them. metadata: version: "1.0.0"


friction-audit

Your session transcripts are a goldmine almost nobody reads. Every interruption, every "still doesn't work", every rejected tool call is a labeled data point about where your setup fails. This skill turns three weeks of transcripts into a ranked list of recurring failures, then converts the top failures into guardrails that prevent them.

Run once, this found (on a real ~90-session corpus): completion claims without verification as the #1 issue by far, followed by browser-automation eval failures, dropped mid-session constraints, stale-file edit errors, and repeated same-theory fix attempts. Every one of those became a rule or skill, and the following weeks' sessions were measurably smoother.

Where the data lives

Claude Code stores full session transcripts as JSONL:

~/.claude/projects/<project-slug>/*.jsonl

Each line is a JSON event. The signals worth mining:

SignalHow to find it
User interrupted a turnlines containing "Request interrupted by user
Tool call erroredlines containing "is_error":true
User denied a permission"user doesn't want to proceed or "User rejected
User friction languageuser messages matching `still (doesn'tnotbroken), you didn't, stop telling me, once again, not what i, wrong`, profanity

Note: transcripts are cleaned up after a retention period (cleanupPeriodDays in ~/.claude/settings.json, default 30). If you want a longer audit window, raise it before you need it.

The audit procedure

  1. Mine. Script pass over the last N days of transcripts (skip files under ~50KB; they're rarely interesting). For each session collect: interrupt count, tool-error count, denial count, and up to ~6 verbatim user messages matching the friction regex. Emit a compact per-session block: date, first user message as the topic, stats, friction quotes.
  1. Cluster with sub-agents. Feed the mined blocks to parallel agents (cap concurrency around 8; back off if rate-limited) with a prompt like: "Cluster these friction signals into recurring themes. Rank by evidence count. For each theme: what happened, verbatim examples, and the smallest intervention that would have prevented it." Then one synthesis pass merges the clusters.
  1. Rank by evidence, not by vividness. One spectacular blow-up matters less than the same quiet failure appearing in nine sessions. Count sessions per theme.
  1. Convert the top 3-5 themes into guardrails. Match the intervention to the failure type:
  • A judgment failure (claiming done without proof) becomes a skill with a hard protocol, optionally enforced by a Stop hook.
  • A memory failure (dropped constraints) becomes a file-based discipline (write it down, re-read before delivering).
  • A knowledge failure (same browser gotcha every week) becomes a CLAUDE.md rule or a note in the relevant skill.
  • A process failure (50 parallel agents hitting rate limits) becomes a hard limit written into CLAUDE.md.
  1. Install and verify. Write the guardrails, then test each one: pipe a synthetic failing case through a hook, confirm a skill registers, confirm the CLAUDE.md block loads in a fresh session.
  1. Make it recurring. A weekly cron (launchd on macOS, cron elsewhere) that runs the mining script and has claude -p cluster the week's friction into a short report answers the question "are the guardrails working?" with data instead of vibes. Strip ANTHROPIC_API_KEY from the child environment when scripting claude -p, otherwise those runs bill your API key instead of your subscription.

The mining script, minimal version

python
import glob, json, os, re, time
HOME = os.path.expanduser("~")
cutoff = time.time() - 21 * 86400 # 3 weeks
files = [f for f in glob.glob(f"{HOME}/.claude/projects/*/*.jsonl")
if "/subagents/" not in f and os.path.getmtime(f) > cutoff
and os.path.getsize(f) > 50_000]
FRICTION = re.compile(
r"(still (doesn'?t|not|broken|getting)|not what i|you didn'?t|"
r"stop telling me|doesn'?t work|once again|why is|wrong)", re.I)
for path in sorted(files, key=os.path.getmtime, reverse=True):
interrupts = errors = denials = 0
frictions = []
with open(path) as fh:
for line in fh:
if '"Request interrupted by user' in line: interrupts += 1
if '"is_error":true' in line: errors += 1
if '"User rejected' in line: denials += 1
if '"type":"user"' not in line: continue
try: e = json.loads(line)
except Exception: continue
c = e.get("message", {}).get("content")
text = c if isinstance(c, str) else " ".join(
b.get("text", "") for b in (c or [])
if isinstance(b, dict) and b.get("type") == "text")
if text and not text.startswith("<") and FRICTION.search(text):
frictions.append(text.strip()[:220])
if frictions or interrupts > 2 or errors > 10 or denials:
print(f"### {os.path.basename(path)[:8]} "
f"interrupts={interrupts} errors={errors} denials={denials}")
for m in frictions[:6]: print(f"- USER: {m}")

The posture

The point is compounding: every audited failure becomes a rule, and every rule makes the next hundred sessions better. Treat your own transcript history as the highest-signal training data you own, because it is.

All versions