About the project

Built because I kept losing the same argument with myself

Claude Code lets you write a skill so you never re-explain a thing again. The catch is that you have to notice you’re re-explaining it. I never did — I just retyped it and got on with my day.

Meanwhile the evidence was sitting on my disk. Every session I’d ever run was in ~/.claude/projects as JSONL: months of me typing the same context, asking for the same procedure, hitting the same wall. The pattern I couldn’t see in the moment was trivially visible in aggregate.

So DistiLL does the noticing. Read the history, embed the messages, cluster them by how often they recur across sessions, and ask a model what each cluster actually is. Out comes a draft skill, a draft slash command, or a note saying “this keeps failing the same way, here’s why”.

It drafts. It doesn’t install. Everything lands in ./output/ and waits for you to read it — because a tool with read access to everything you’ve typed to an AI should be the most boring, most predictable thing on your machine.

Build log

How it actually went

  1. February 2026

    The itch

    I catch myself pasting the same four paragraphs of project context into a fresh Claude Code session for the third time in a week. Claude Code has skills for exactly this. I had not written one, because writing one means noticing the pattern, and I was too busy repeating it to notice it.

  2. March 2026

    Scoping, and one deliberate cut

    Wrote the spec before the code. Mine human-typed messages only — no assistant turns, no tool_use sequences. Narrower, but it makes the whole thing tractable, and everything I actually wanted was in what I typed. The wider version is still sitting in the README as a v2 idea, unbuilt on purpose.

  3. April 2026

    Phase 1 — the parser that ate the month

    The transcript format is undocumented and drifts between Claude Code versions. Real data turned up six line types, and most lines aren't human messages: tool results, sidechains, meta lines, slash-command noise. I rewrote the extractor three times. The rule that stuck: never raise, always count. Every drop has a named reason and distill scan prints the tally.

  4. May 2026

    Phase 2 — embeddings, cache, and clusters

    MiniLM embeddings behind a per-text-hash cache, then HDBSCAN over the vectors. Repetition weighting went in here too: one point per message per distinct session, so cross-session habits outweigh a single frantic afternoon. First real run on my own history produced clusters that were recognisably my own bad habits, which was the moment it stopped being a toy.

  5. June 2026

    The week it broke

    The cleanest pattern in my history kept splitting into two clusters and I could not tune it away. Cause: text pasted verbatim across sessions expands to identical vectors, and a zero-distance blob is denser than any real neighbourhood, so HDBSCAN carves it out on its own — divorced from its own paraphrases. Not a parameter problem, a geometry problem. Fixed with a session-weighted centroid merge after labelling, plus a synthetic-vector test that reproduces the split exactly.

  6. July 2026

    Phase 3 — synthesis, and refusing to trust it

    One API call per cluster returning strict JSON. Then the unglamorous half: fence stripping, one retry on malformed JSON, a confidence floor, kebab-case name validation, frontmatter validation, a placeholder-text check, and a body-length cap. A bad response writes nothing and the run keeps going. The model drafts; the validator decides what reaches disk.

  7. July 2026

    Polish and ship

    Findings regenerated per run instead of appended across runs, --local-only hardened so the embedding-model download can't quietly reach the network, a model-aware cost estimate, CI on three Python versions, and this site.

Engineering

Decisions worth defending

The interesting parts, and what each one is trading away.

clustering

HDBSCAN over k-means

k-means demands a k and assigns every point to something. Most of what you type is noise, and I don't know how many habits I have. HDBSCAN answers both: density-based, no k, and it's allowed to say “that's noise” — which is the honest answer for most clusters.

clustering

Weight by distinct sessions

Each unique text expands to one point per session it appeared in. A note used across eight sessions carries real mass; the same note repeated eight times in one sitting doesn't. Ranking by session count first is what makes the top cluster actually worth automating.

the hard one

Merging clusters HDBSCAN shouldn't have split

Verbatim pastes become identical vectors, whose zero mutual distance makes them look like their own ultra-dense cluster, split off from the paraphrases they belong with. After labelling, groups whose session-weighted centroids sit above a cosine threshold are unioned back together. Covered by a test built on hand-placed unit vectors, so the regression is reproducible without a model in the loop.

cost

Cache embeddings per text hash

Vectors are keyed by a hash of whitespace-collapsed text, so the second run only embeds genuinely new messages. It also makes re-runs during development free, which is the real reason it exists.

privacy

Make the boundary structural, not documented

The representative cap is enforced when clusters are built, not trusted at call time. Under --dry-run and --local-only the synthesis module is never imported at all, and --local-only sets the HuggingFace offline flags before the embedding import so an uncached model fails loudly instead of quietly downloading. The guarantee is in the control flow.

reliability

Assume the model will hand you garbage

Fences get stripped, malformed JSON gets one retry with a nudge, and anything still broken is recorded as a failed cluster and skipped. Transport errors are caught per cluster. Nineteen good clusters shouldn't die because the twentieth came back as prose.

Stack

What’s underneath, and why

Python 3.11+
tomllib in the standard library, and modern typing without a compatibility shim.
sentence-transformers · all-MiniLM-L6-v2
Runs on a laptop CPU in seconds and is more than good enough to tell “same idea” from “different idea”. A bigger model would cost more and change nothing here.
scikit-learn HDBSCAN
Density clustering with no k to guess and an explicit noise label. Vendored in scikit-learn ≥ 1.3, so it isn't an extra dependency.
NumPy
Cosine similarity on L2-normalised vectors is a dot product. That's the whole maths layer.
Anthropic Messages API
One call per cluster, strict JSON out. The classification step needs judgement, not another heuristic.
pytest
The encoder is injectable and the API client is mocked, so the entire suite runs offline in about a second.
Next.js on Vercel
This site. Static App Router pages, no client-side data fetching, no webfonts — it should load before you notice it loading.

Links

The repository has the full write-up: architecture, data flow, and the tradeoffs behind each decision above.

A write-up post is coming; this will link straight to it once it’s up.

Contact

Have an idea? Let’s talk.

Want to build something — or break something interesting? I read everything that lands, and I answer the ones with a real problem in them.

Fastest route is the call link — 30 minutes, no pitch deck. Everything else reaches the same inbox.

This opens your mail client with the message ready to send — no form data touches a server.