Skip to main content

Turn successful AI agent sessions into reusable agent skills. Distill Claude Code transcripts into SKILL.md playbooks with evals-ready drafts.

Project description

skilldistill

Your agents solve the same problems every week — and remember nothing.

PyPI CI Python License: MIT

Agent skills (SKILL.md playbooks) are how you teach agents procedures — but everyone writes them by hand, from memory, after the fact. Meanwhile your ~/.claude/projects/ folder is full of transcripts where the agent already figured it out: the exact commands, the wrong turns, the fix that finally worked. Research shows distilling skills from execution traces works (Trace2Skill, MUSE-Autoskill) — skilldistill makes it a pip install instead of a paper.

pip install skilldistill

How it works

transcripts ──▶ scan ──▶ rank by success signals ──▶ distill ──▶ SKILL.md draft
                                                        │
                                     dedup vs skills you already have

1. Scan your Claude Code sessions and rank the ones worth keeping:

$ skilldistill scan ~/.claude/projects
[0.90] ~/.claude/projects/my-api/7f3a...jsonl
       goal: Fix the flaky retry logic in the payment client
       why:  substantial workflow (14 tool calls); low tool error ratio (7%);
             success signals in transcript (tests passed / PASS verdict); clean final summary
[0.70] ~/.claude/projects/my-api/22c1...jsonl
       goal: Add rate limiting to the public endpoints
       why:  substantial workflow (9 tool calls); clean final summary

Every score comes with reasons — no black-box filtering.

2. Distill a session into a reusable skill draft:

$ export ANTHROPIC_API_KEY=...        # or OPENAI_API_KEY; optional
$ pip install "skilldistill[anthropic]"
$ skilldistill distill ~/.claude/projects/my-api/7f3a...jsonl --skills-dir .claude/skills
wrote .claude/skills/fix-flaky-retry-logic/SKILL.md  (origin: llm)
review the draft before installing it — treat generated skills like third-party code

The LLM generalizes the transcript into a procedure: trigger-focused description, numbered steps with the key commands, and a Pitfalls section mined from the mistakes the agent made and corrected mid-session.

No API key? Still works. --offline (or no key configured) emits an honest outline draft from the recorded tool sequence, clearly marked for manual polish.

3. Dedup. Before writing, skilldistill compares the draft against your existing skills directory and warns on overlap:

warning: similar existing skill: retry-patterns (78%)

CLI reference

skilldistill scan [ROOT] [--min-score 0.5] [--limit 20] [--json]
skilldistill distill SESSION.jsonl [--skills-dir skills] [--offline] [--force]

scan defaults to ~/.claude/projects. --json emits machine-readable rankings for pipelines.

Python API

from skilldistill import parse_session, score_session, distill, write_skill

session = parse_session("session.jsonl")
if score_session(session).score >= 0.5:
    draft = distill(session, llm=my_llm_fn)   # llm: Callable[[str], str], or None
    write_skill(draft, "skills/")

Bring any LLM: llm is just a Callable[[str], str]. Built-in resolvers use the anthropic or openai SDKs when installed (SKILLDISTILL_ANTHROPIC_MODEL / SKILLDISTILL_OPENAI_MODEL to override models).

The flywheel

Pair with dunnit: dunnit verdicts in a transcript ("verdict: PASS") are a strong success signal, so verified sessions rank highest — you distill skills only from work that was proven done, not just claimed done.

Security note

Generated skills are instructions your agents will follow. Review drafts like you'd review third-party code, and consider scanning them (e.g. Snyk Agent Scan or mcp-scan) before installing — skill supply-chain attacks are real and studied.

Roadmap

Cursor/Codex transcript parsers · per-skill eval stubs · cross-session clustering (one skill from N similar sessions) · skilldistill watch daemon · skill update mode (refresh an existing skill from newer sessions).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skilldistill-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skilldistill-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file skilldistill-0.1.0.tar.gz.

File metadata

  • Download URL: skilldistill-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for skilldistill-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36ac5bc5f5f39664f5363c6151b08e62c98b958ffc2676bad2d85942ec6dbc50
MD5 3908c88c7750fb88e6944a7979ac19fa
BLAKE2b-256 2a00e9ae38364c8ffaf313db81ae5405ac7d1d56d9b1df6c297191e940318be7

See more details on using hashes here.

Provenance

The following attestation bundles were made for skilldistill-0.1.0.tar.gz:

Publisher: publish.yml on palasht75/skilldistill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file skilldistill-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skilldistill-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for skilldistill-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ba6b2be87188f3c28368b3aa9f5bc23344a929d21dd3406ad48644bff6c31eb
MD5 26305b4197ce97c9dee27175d235df46
BLAKE2b-256 b2b9a30c91d09a26172beaef75d0aaaf045531e12e61cf6a1a662bbb16972a4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for skilldistill-0.1.0-py3-none-any.whl:

Publisher: publish.yml on palasht75/skilldistill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page