
Sublimate: Three Tiers for Distilling Workflows From Your Own Sessions
Anthropic shipped Dynamic Workflows in Claude Code this week. The harder question is which of your hand-rolled patterns belongs as a Workflow, which belongs as a Skill, and which belongs as a Subagent.
View companion repoThe rubric, before the runtime
Anthropic shipped Dynamic Workflows in Claude Code on 2026-05-28. You declare phases in a literal meta block, then call phase(), agent(), parallel(), pipeline(). The runtime executes in the background. Your session stays responsive. v2.1.154, 16 concurrent agents, 1,000 per run, structured output schema-validated, /deep-research as the bundled example.
Workflows are not the only primitive. The docs say so under "When to use a workflow." The interesting question is no longer "can I orchestrate." It is "what already lives in my session history, and which of three primitives should it become."
- 01Subagent. One isolated investigation. Claude spawns it, gets a focused report, integrates the result. "Find every file that imports X." One-off. Lightweight.
- 02Skill. A reusable procedure Claude orchestrates turn by turn, intermediate state in Claude's context. lint-then-format-then-commit. Three to six agents, runs inline.
- 03Workflow. A script the runtime executes. Holds the loop, branching, and intermediate state itself, so Claude's context only sees the final answer. Reach for it when you need dozens of agents, parallel concurrency, or resume across context interrupts.
The same procedure can be all three at different scales. Generating one blog cover is a Skill. Generating twenty in parallel with retry-on-fail is a Workflow. Looking up which Stitch prompt your last cover used is a Subagent. Most posts about Workflows are pitching Workflows. This one is about choosing among three.
What sublimate does
Sublimate is a Claude Code plugin that walks your session corpus, clusters by tool-call similarity, classifies each cluster by the rubric above, dispatches a per-cluster prompt-distiller subagent, and emits polished .workflow.js / SKILL.md / AGENT.md candidates.
The name is the move. Sublimation is the solid-to-gas phase transition that skips liquid. The miner does the same. Noisy session traces sublime into ordered candidates with no whiteboard step between. The pattern was already there. The miner crystallizes it.
- 01Walk. Every JSONL under ~/.claude/projects/<corpus>/. Extract per-turn (role, tool_name, tool_input_hash) tuples.
- 02Shingle and cluster. Each session becomes a set of k=3 tool-name n-grams. Cluster sessions pairwise via Jaccard at threshold 0.35.
- 03PrefixSpan. Mine each cluster for frequent subsequences at min-support 0.4. Shape emerges here.
- 04Distill. A prompt-distiller agent reads two or three sample sessions per cluster and writes coherent agent() prompts. The Python is upstream of the LLM, not a replacement for it.
End-to-end on the blog-series corpus (500 sessions sampled from 2,067): the Python miner runs in 1.36 seconds. The full skill chain — mine, curate, fan out per-cluster distillers, lint, report — runs in about ten and a half minutes. The Python is deterministic. The LLM steps cost wall-clock and tokens but produce real prompts.
The slash command is the user surface. The Python is the engine. Skills, commands, and specialist agents (cluster-curator, prompt-distiller) sit between. The two-layer split is deliberate. The Python is fast and stays out of the LLM budget, so it can sweep every JSONL in the corpus. The LLM runs only after clustering reduces the input to a handful of sample sessions per cluster. Coarse work cheap, fine work expensive.
Four specimens, distilled from a real dogfood run
Honesty interlude. The v0.1 of this post (git history at commit 15ff750) cited three example workflows I wrote by hand. They were guesses dressed as evidence. I deleted them. Then I ran the plugin against my own blog-series corpus — /sublimate:distill in a fresh tmux session as a third-party user, full skill chain, no shortcuts. Every specimen below traces to that transcript and to an emitted artifact.
dream-memory-consolidation — SKILL, 361 sessions
The pattern: a Bash + Read + Grep + Write loop, repeating across 361 sessions, that reads MEMORY.md, scans logs/YYYY/MM/, drift-checks code state, then updates topic files and re-indexes. This is what /dream does — memory consolidation. The Python miner saw the procedure-shape without knowing what /dream was. The cluster-curator agent classified it SKILL because it is a coherent multi-phase procedure that Claude orchestrates turn-by-turn (not background-script work).
“Reflective pass over project memory — orient on existing memories, gather new signal from logs, consolidate into topic files, prune the index. (Written by the distiller agent, not by me.)”
parallel-file-write-with-verify — WORKFLOW, 6 sessions
This one is the only Workflow-tier specimen the miner emitted from blog-series. The reason: WORKFLOW requires multi-phase shape with fan-out, repeated five-plus times. Cluster 9 has exactly that — parent workflows that scatter N writer-subagent spawns in parallel, followed by a verify pass. Six occurrences in the corpus.
The verify pass is one agent that Reads each written file, counts placeholders / AI-tells / cited specimens, and emits a markdown audit table. That second phase is the load-bearing part — fan-out without verify is just speed.
file-writer-worker — SUBAGENT, 12 sessions
The Subagent specimen is the cleanest illustration of why "Workflow" is not the answer to everything. Cluster 8 is twelve siblings — twelve workers spawned by a parent workflow, each writing exactly one file. Single repeated role. No orchestration. No phase boundary. Tools needed: Write.
If this had been classified WORKFLOW the runtime would have wrapped a single-task pattern in a deterministic checkpoint scaffold for nothing. The rubric pulls patterns toward the lighter tier where they belong, not toward the heaviest tier because Workflows are the shiny new thing. The curator's rationale for cluster 8 was explicit: "workflow-subagent given one Write directive — 12 sibling spawns from parent workflow each writing one file. Single repeated role."
audit-e2e — SKILL, 6 sessions
This is the chrome-devtools e2e-audit pattern that ran on every recent ds-fix-vN team trial. Five user journeys (J1..J5) per teammate, mandatory skill receipts (e2e-validate, agent-browser, functional-validation), per-journey new_page → take_screenshot → click via uid → close_page. The distiller extracted the allowed-tools list, the new_page → list_pages → select_page → snapshot pitfall, five common journey shapes, and a FAIL-handling protocol — from two real audit-e2e team-trial transcripts.
Cluster 11 has three parallel siblings the miner also surfaced — cluster 12 (a11y), cluster 13 (perf), cluster 14 (responsive). Same fan-out shape, four different dimensions of audit. All four KEEP. All four polished.
What the miner gets right, and wrong
- −Refuses to invent shape — PrefixSpan only emits subsequences that actually repeat
- −Separates discovery (Python, 500 files in 1.36s) from authorship (LLM per cluster)
- −Surfaces shape regardless of tier — Subagent + Skill come out alongside Workflow
- +Tool-name granularity is coarse — Read → Edit → Bash is a thousand procedures
- +Phase boundaries are heuristic — they cut at user-prompt edges, sometimes wrongly
- +The first attempt blew up — the dogfood run surfaced four shippable bugs the static plan never would
Cross-corpus signal
Same /sublimate:distill, two more corpora. The yt-transition-shorts-detector corpus (500 sessions sampled from 754) emitted thirteen clusters; the richest was cluster 5 (size 18, Read → StructuredOutput) — the canonical Subagent shape. The first time I tried to mine this corpus I named that pattern by hand and called it vfr-code-classify. The second time I let the miner find it. The miner found it. The ils-ios corpus (124 sessions) was thinner: nine clusters, only one big enough to emit. iOS sessions are more idiosyncratic. Not every project distills.
The cross-corpus signal is the most important thing. Three runs, three different cluster shapes, the same algorithm, the same artifact format. No special-casing per project. The miner walks JSONL and clusters by shape. The curator agent and prompt-distiller agent do the rest.
Why this matters now
Patterns that took serious agent-builders six months to converge on are now first-class primitives in the runtime. That is the story of every developer-tools generation. A few people build something by hand. The platform watches what they do. The platform primitivizes it. The capability becomes available to everyone. Today is one of those days for orchestration.
The patterns the miner found in my own corpus are not clever. They are obvious in hindsight. The reason I never wrote them down as Workflows or Skills before today is that I did not have a runtime that read them as code, and I did not have a rubric that told me which tier each one belonged to. Now I have both. You probably have your own three or four. Go find them.
Continue the series
- 36SeriesShannon v1.2.0: Multi-Stage Agentic Work as a Sequence of Provable StepsA Claude Code plugin that refuses to say 'done' until the evidence is on disk. 36 skills, 11 agents, 22 commands, 7 hooks — and a doctor that reads its own contract.
- 37SeriesLinkedIn Has No Pulse API: Designing a Pipeline Around a Manual GateThe publisher fires LinkedIn feed posts on its own. It cannot create a Pulse article. So I built the whole content OS around one irreducible human paste.
- 38SeriesAuditing the Agent: Mining My Own Sessions to Catch 27 MistakesThe agent's session transcripts are a labeled record of every time it diverged from what I asked. So I mined them — and made it grade its own work.
- 39SeriesThe Machine That Writes These PostsA content pipeline of 24 commands and 11 skills mines my sessions, drafts the post, and refuses to let any machine click Publish. This one was made by it.