Skip to main content

Distill your Claude Code session history into reusable Workflow scripts.

A 3-tier session miner that turns Claude Code JSONL history into Subagents, Skills, and Workflows — classified by rubric, not by guess.

Sublimate is a Claude Code plugin that mines ~/.claude/projects/ JSONL files, clusters sessions by tool-call similarity (k=3 shingles + Jaccard), mines frequent subsequences with PrefixSpan, and classifies each candidate against a 3-tier rubric — Subagent, Skill, or Workflow — before emitting polished plugin artifacts.

Pipeline composes a deterministic miner with an LLM prompt-distiller per cluster. The miner surfaces the shape (which tools, which order, how often); the distiller reads the original session content for the cluster and writes the agent prompt, skill SKILL.md, or workflow phases that ride on top.

Validated by a live /sublimate:distill dogfood run against the blog-series corpus (500 sessions sampled from 2,067, 17 clusters) — 8 candidates emitted (6 Skill, 1 Subagent, 1 Workflow), 4 hand-polished into examples/. Cross-corpus reproducibility confirmed on yt-transition-shorts-detector (13 clusters) and ils-ios (9 clusters).

3-tier classification (Subagent / Skill / Workflow)

Each cluster is rated against a rubric: single-context lookup → Subagent, repeatable rubric → Skill, multi-phase orchestration → Workflow. Output is tier-shaped, not one-size-fits-all.

k=3 shingle Jaccard cluster

Tool n-gram shingles compared with Jaccard ≥ 0.35. Union-find collapses near-duplicates. Same corpus, same clusters, every run.

PrefixSpan subsequence mining

Per-cluster frequent subsequence mining with min support 0.4. Surfaces the ordered tool-call backbone that distinguishes one workflow from the next.

LLM prompt distillation per cluster

v0.2 reads the cluster's original session content and writes the agent prompt, skill rubric, or workflow phases — so emitted artifacts ship with real content, not placeholders.

  1. 01pip install -e git+https://github.com/krzemienski/sublimate
  2. 02python3 -m sublimate.cli ~/.claude/projects/<project-dir> --out ./out --emit-all
  3. 03Inspect out/clusters.json and out/*.workflow.js, hand-polish a candidate
  4. 04Drop the polished .workflow.js into .claude/workflows/ and run /workflows
3-tier classification (Subagent / Skill / Workflow)
Rubric-driven per cluster
k=3 shingle Jaccard cluster
≥ 0.35 threshold
PrefixSpan subsequence mining
min support 0.4
LLM prompt distillation per cluster
Reads original session content
Walks ~/.claude/projects/*.jsonl
Recursive rglob
Emit Subagent .md / Skill SKILL.md / .workflow.js
Tier-shaped artifacts
Banned-API lint on Workflow output
Runtime-safe meta block
Documentation
Read the Sublimate docs
workflows.withagents.dev
  1. Pivoted from Python-CLI surface to Claude Code plugin: skills, commands, agents added on top of existing miner. Replaced 3 fake examples with 4 specimens mined from real corpora (blog-series, ils-ios, yt-detector, claude-mem). 3-tier rubric (Subagent / Skill / Workflow) classifies each emitted candidate.
  2. Initial release paired with Anthropic Dynamic Workflows launch. Parser + shingle + cluster + PrefixSpan + emitter. Heuristic-only candidate Workflow scripts ready for the v2.1.154+ runtime.