Skip to main content
skill CX Codex

crystallize — Claude Code skill: what it does, how to install

crystallize mines session logs and lessons for recurring patterns, then drafts reusable skills. Run it when you want to turn project knowledge into agent instructions.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add avelikiy/great_cto --skill crystallize -a claude-code
Open on GitHub

What crystallize does

The skill reads .great_cto/logs/, .great_cto/lessons.md, and ~/.great_cto/decisions.md, then checks recent Git history for context. It groups recurring patterns, and the knowledge-extractor agent writes a draft to skills/{domain}/SKILL.md for any cluster with at least three occurrences. If that domain already has a skill file, the agent adds a section instead of replacing it.

Once analysis finishes, crystallize prints a report and writes the .great_cto/.last-crystallize marker. No session logs means it exits; with fewer than ten sessions, it asks whether to continue. The analysis depends on the Opus knowledge-extractor agent, so the required project logs need to be present before you run it.

What it helps with

  • spot recurring lessons across session logs
  • group similar observations into patterns
  • draft skills from patterns that recur
  • identify patterns already covered by existing skills
  • produce a report of drafts and analysed sessions

Example prompts for the agent

  • Find recurring lessons in the session logs and draft reusable skills.
  • Run /crystallize and summarise what the recent sessions taught us.
  • Turn repeated notes in .great_cto/lessons.md into skill drafts.

How to install crystallize

1Skills CLI (Vercel)

npx skills add avelikiy/great_cto --skill crystallize -a claude-code

2Manually: put the files in place

~/.claude/skills/crystallize/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/crystallize/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about crystallize

How do I install crystallize in Claude Code?

Run npx skills add avelikiy/great_cto --skill crystallize -a claude-code. The skill file is available at ~/.claude/skills/crystallize/SKILL.md.

What does crystallize do?

It searches session logs and lessons for recurring patterns, asks an agent to draft skills for those patterns, and prints a report.

How many sessions should I have before running crystallize?

The skill recommends running it after ten sessions. With fewer, it asks for confirmation; with no session logs, it exits.

Source text

SKILL.md · MIT
---
name: crystallize
description: "Distils repeating patterns from session logs and lessons.md into draft skill files. Run after ≥10 sessions to extract durable knowledge. Output: draft skills/ files + promotion report."
when_to_use: |
  Apply when:
  - CTO says /crystallize, "crystallize", or "extract knowledge"
  - Session count in .great_cto/logs/ reaches a multiple of 10 (auto-suggest)
  - User asks "what have we learned?" or "turn lessons into skills"
effort: high
allowed-tools: Read, Write, Glob, Grep, Bash, Agent
paths:
  - ".great_cto/logs/**"
  - ".great_cto/lessons.md"
  - "~/.great_cto/decisions.md"
  - "skills/**"
---

# Crystallize — distil session patterns into reusable skills

Invoke when the CTO says `/crystallize`, "crystallize", "extract knowledge", or
"what have we learned?". Also auto-suggested when session count is a multiple
of 10 (the session-end hook checks `.great_cto/.last-crystallize`).

The `knowledge-extractor` agent (Opus) does the heavy lifting. This skill
orchestrates the workflow and emits the final report.

**Session-end hint integration:** The session-end hook checks
`.great_cto/.last-crystallize` and suggests running `/crystallize` when the
session count exceeds `last_sessions + 10`. Run this skill after ≥10 sessions
to keep extracted skills current.

---

## Step 1 — Gather raw material

```bash
# Count sessions
SESSION_COUNT=$(ls .great_cto/logs/session-*-end.md 2>/dev/null | wc -l | tr -d ' ')
echo "Sessions: $SESSION_COUNT"

# Read lessons
cat .great_cto/lessons.md 2>/dev/null || echo "(no lessons yet)"

# Read cross-project decisions
cat ~/.great_cto/decisions.md 2>/dev/null | head -200 || echo "(none)"

# Find patterns that appear in ≥3 sessions
grep -h "^## pattern:" .great_cto/logs/session-*-end.md 2>/dev/null | sort | uniq -c | sort -rn | head -20

# Recent git log for context
git log --oneline --since="30 days ago" | head -30
```

If `SESSION_COUNT` is 0, tell the CTO: "No session logs found in
`.great_cto/logs/`. Run at least 10 sessions before crystallizing." Exit.

If `SESSION_COUNT` < 10, tell the CTO: "Only `{N}` sessions found. Patterns
are more reliable after ≥10 sessions. Proceed anyway? [yes/no]" Wait for
confirmation before continuing.

---

## Step 2 — Cluster patterns (via knowledge-extractor agent)

Spawn the `knowledge-extractor` agent with the gathered data as context:

```
Agent: knowledge-extractor
Task: |
  Read .great_cto/lessons.md and all files in .great_cto/logs/.
  Cluster lesson entries by pattern slug.
  For each cluster with ≥3 occurrences, write a draft skill file to
  skills/{domain}/SKILL.md (status: draft in frontmatter).
  If a skill for that domain already exists, append a new ## section instead
  of replacing the file.
  Infer domain from the pattern slug and its archetype tags.
  Return a structured summary: clusters found, drafts written, already-covered.
```

Wait for the agent to complete before proceeding to Step 3.

---

## Step 3 — Emit promotion report

After the agent completes, print:

```
CRYSTALLIZE REPORT
════════════════════════════════════════
Sessions analysed: {SESSION_COUNT}
Lessons found:     {LESSON_COUNT}
Clusters:          {CLUSTER_COUNT}
Draft skills:      {DRAFT_COUNT}  (in skills/{domain}/SKILL.md)
Already covered:   {COVERED_COUNT}  (pattern already in existing skill)
════════════════════════════════════════
Draft files:
  {list of paths and brief description per draft}

Next: review drafts, remove `status: draft` when satisfied.
Run /crystallize again after 10 more sessions.
════════════════════════════════════════
```

---

## Step 4 — Write .last-crystallize marker

After emitting the report, write the marker file:

```bash
SESSION_COUNT=$(ls .great_cto/logs/session-*-end.md 2>/dev/null | wc -l | tr -d ' ')
DRAFT_COUNT={P}   # from agent output
mkdir -p .great_cto
node -e "
const fs = require('fs');
fs.writeFileSync('.great_cto/.last-crystallize', JSON.stringify({
  ts: new Date().toISOString(),
  sessions: parseInt('$SESSION_COUNT') || 0,
  drafts: parseInt('$DRAFT_COUNT') || 0
}) + '\n');
"
```

---

## Step 5 — Auto-run cadence suggestion

If `SESSION_COUNT` is a multiple of 10 (and > 0), append to the report:

```
Auto-suggestion: you've completed {SESSION_COUNT} sessions. Consider running
`/crystallize` every 10 sessions to keep skills current.
```

© avelikiy · MIT · avelikiy/great_cto

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set34

done-blocked Enforces a strict terminal reporting contract for agents: exactly DONE or BLOCKED with structured evidence. Stops vague handoffs in multi-agent pipelines. CX Codex +1 ★ 107repo stars discovery This skill prompts an agent to check project context and constraints before making architecture, audit, or security-plan recommendations. Use it when the request leaves key details open. CX Codex +1 ★ 107repo stars deploy-landed The skill checks that the revision being served is the commit you meant, that its env reached the running process, and that the product actually works. Useful after any deploy or restart. CX Codex +1 ★ 107repo stars decision-eval Runs a scoring agent on architectural alternatives in ADRs and outputs ranked evaluations to docs/decisions/. Helpful when choosing between competing designs. CX Codex +1 ★ 107repo stars cost-model Pins down one format for the cost section in plans and architecture docs. Useful when a report claims savings and someone will ask how you got the number. CX Codex +1 ★ 107repo stars committed-aesthetic Replaces vague design catalogues with testable rules for coding agents. Helps build distinct interfaces from scratch without falling into generic AI layouts. CX Codex +1 ★ 107repo stars codex-host Runs the full great_cto pipeline through a controller that owns writes and approval gates. Use it when you need the whole workflow, not a single skill. CX Codex +1 ★ 107repo stars brainstorming Takes a raw product idea through three steps: divergent bets, a two-round argument between four personas on four models, and a synthesised call. CX Codex +1 ★ 107repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor