WAYS OF WORKING · DEMO 04 NINO CHAVEZ
Your sessions
are a corpus.
Every agent session leaves a transcript. Mine it for reusable lessons, promote the project truth, then let the raw record expire. A useful corpus should make your next session better without becoming permanent storage.
$ python3 artifact-miner.py --out artifact-mine.json $ jq '.corpus' artifact-mine.json { "files": 2747, "lines": 527394 }
→ or scroll to advance · ← to go back
02 THE EXHAUST
The dataset you already have
Coding agents log everything: every command, every file read, every correction you typed at them. Across one machine's history that's a real dataset — and it accumulates whether or not you ever look at it.
The survival ledger inside it is the honest part: of the workspace artifacts agents created, 2,013 are gone and 961 still exist. Most of what an agent builds is scaffolding — knowing which parts survived is where the signal is.
03 THE CONFESSION
The miner was rebuilt at least 12 times first
The mining tool's own docstring tells the origin story better than any slide could — quoted verbatim:
Before this script existed, one-off variants of it were rebuilt in throwaway
sessions at least 12 times (mine_sessions.py, mine_failures_v3.py,
friction_mining_v2.py, ...) — hence the durable home.
The evidence, from its own output
A fresh mining run finds its own ancestors in the ephemeral graveyard: mine_sessions.py, mine_transcripts.py, mine_corrections.py, mine_failures.py, _v2, _v3, friction_mining.py, _v2, deep_friction_scan.py, detailed_analysis.py — all written once, used once, gone.
Across all sessions: 313 ephemeral scripts gone, 12 kept.
The promotion
The twelfth rebuild became the durable one — with the rule written into the tool itself: if you're about to write a new session miner, extend this one instead.
The method: notice the throwaway you keep re-forking. Promote it once. Encode "extend, don't re-fork" where the next session will read it.
04 YIELD 1 · AUDITS
Every guard started as a query
The mechanical guards in demo 03 weren't designed from intuition. Each one's origin audit was a mining pass over this corpus:
122 pkills
Mined from Bash-call signatures across 16 projects → the preview and q helpers.
50% re-reads
A 60-day Read-pattern audit (worst case: one file read 184×) → the read-guard hook.
553 hesitations
Ask-then-told-"go" exchanges mined from user turns → the three-layer anti-hesitation fold.
You can't build guards from vibes. The corpus turns "I feel like the agent wastes context" into a number you can act on — and a baseline you can re-measure against.
05 YIELD 2 · PRIORS
Your corrections become standing context
User turns get mined into a character stack — 1,411 signals across 74 projects, regenerated after each ingest — and injected as priors when a new prompt matches an old pattern. Two priors that fired in the session that built this very deck:
correction / over-engineered · injected as prior
"the playbook and deck have too much fluff. consider what are appropriate comms approach"
Effect: this deck shipped without a stat-card scoreboard — the correction resurfaced before the mistake recurred.
preference / i-prefer · injected as prior
"no. i want interactive html demos, not mp4s, for all use cases."
Effect: the series' whole format — interactive HTML decks, not videos — matches a preference stated months earlier in a different project.
The stack also carries a quantitative voice card — median sentence length 12 words, hedge rate 11.9%, cheerleading rate 1.4% — so "write it the way I would" is a measured target, not a vibe. The standing rule: priors, never commands. The live conversation always wins.
06 YIELD 3 · GRADES
838 sessions, graded like anything else you'd improve
Each ingested session gets scored — instruction compliance, thrash ratio, session shape, commits produced. The distribution, straight from the database:
What the shapes say
The most common productive shape is research-then-build (382 sessions, 5.4 commits on average). But the data resists a tidy story: extended-discussion sessions average more commits (6.1) — long conversations aren't waste when they're converging on something.
Where the lessons live
The 126 D and F sessions are the valuable ones — high-thrash transcripts are where corrections, tool misuse, and abandoned work concentrate. Grading isn't a report card; it's an index into which transcripts to mine next.
07 THE LOOP
The corpus improves the sessions that feed it
This isn't hypothetical — the loop produced the thing you're reading. This demo series' roadmap was selected by mining this corpus. Demo 03's numbers were re-derived by a fresh mining run during authoring. The voice stack regenerated the same day. The corpus is upstream of everything on this site.
08 HONEST LIMITS
Transcripts remember everything — that cuts both ways
The scrub gate is mandatory
Sessions contain everything ever typed: client names, private paths, the occasional secret pasted in error. Nothing mined goes public without a sanitization pass. This deck went through one — some of the corpus's best stories stayed behind because of it.
Mined signals are hypotheses
Regex over transcripts is crude. During this series' research, one suggested pattern — a supposedly recurring creative workflow — turned out to be mostly false positives on closer verification. Mined claims get re-derived before they're repeated. Same discipline as any other source.
The stack is frozen in time
A prior distilled from last month can contradict what you want today. The rule baked into the stack's own preamble: if the live conversation contradicts a stored signal, trust the conversation. Preferences evolve; the corpus lags.
09 THE STORAGE BILL
The corpus became the storage problem
One Codex home directory reached roughly 24 GB. The useful lesson was not “delete old chats.” Measurement found two stores with different risk:
Build output is mechanical
Compiled dependencies can be recreated. Reclaim them from an idle linked worktree after proving the path is ignored, untracked, and unused by a live session.
Transcripts need judgment
The compact store retained 553 user signals and 11,773 completed response examples. Deletion still stayed blocked because a miner cannot prove that every project-specific decision moved into its owning repository.
10 THE CLOSEOUT LOOP
The hook is transport. The closeout is judgment.
What survives
Canonical decisions, verified evidence, unresolved questions, the next action, and a small reusable recipe. Each retained record keeps its source client, task identity, project path, and timestamp.
What does not get claimed
Archive-safe: no is a valid result. It means raw context still carries something important. A current database watermark proves ingestion, not semantic completeness.
11 THE FAILED SAFETY PROOF
The cleanup hook proved its own warning
A live test removed 594 MB of installed JavaScript dependencies from a real idle worktree outside the requested scope. The source and branch survived. The test still crossed the authority boundary — and exposed four missing gates:
Liveness was incomplete
The reaper recognized Claude session locks, not active Codex tasks. A multi-client cleanup tool needs one liveness contract or an adapter for every client it claims to protect.
Ignored did not mean disposable
git check-ignore proves an ignore rule matches. It does not prove there are no tracked descendants. Pair it with git ls-files.
Root mtime was a weak clock
Editing an existing file may leave the worktree directory timestamp unchanged. Use a real activity signal, then recheck it immediately before deletion.
Turn-ending hooks are the wrong worker
A recursive delete inside a short Stop hook can be interrupted. The safe shape is report first, enqueue, recheck, then clean out of band.
12 YOUR VERSION OF THIS
Close the session. Keep the lesson.
If you never touch code
Before archiving, write down what changed, what proved it, what remains uncertain, and the next action. Put project truth with the project. Keep the raw chat until that closeout feels complete.
If you're technical
Make lifecycle hooks append one queue record and return. Mine in a background worker. Bind the watermark to the transcript path and modification time so a changed file gets processed again.
If you build systems
Separate policy for raw transcripts, compact recall, canonical docs, and reproducible build artifacts. Deletion needs a grace window, current ingestion, and an explicit answer to “did the important context move?”