/evolve — Instinct Evolution Dashboard
Purpose: Review, promote, and prune behavioral instincts captured during sessions.
Trigger: User types /evolve (user-invoked only, never auto-run)
Invocation Forms
/evolve → Show instinct dashboard + cluster candidates
/evolve --promote → Promote a cluster to CLAUDE.md rule or skill
/evolve --prune → Review low-value instincts for manual archival
/evolve --stats → Instinct metrics (count, confidence distribution, age)
Workflow
/evolve (Dashboard)
- Load active instincts from
MEMORY/LEARNING/INSTINCTS/instincts.jsonl
- Display summary table grouped by confidence tier:
- 🔥 High (0.8+): eligible for promotion
- ✅ Active (0.5–0.79): surfacing at session start
- 💤 Building (0.3–0.49): accumulating confidence
- Identify cluster candidates using
getClusteredInstincts() from hooks/lib/instinct-store.ts:
- Embedding-based clustering (cosine similarity >0.7, max 8 per cluster)
- Falls back to tag-based clustering if no embeddings cached
- Only clusters where ALL instincts have confidence ≥0.8 AND trigger_count ≥3 are promotable
- Display: "Found N cluster(s) eligible for promotion. Run
/evolve --promote to review."
Output format:
## Instinct Dashboard
Active: N | Eligible (surfacing): N | Archive-eligible (decayed): N
### High Confidence (ready for promotion)
• [95%] [kai, hooks, bun] Use bun test --bail for faster feedback ×7
• [82%] [kai, hooks] Never modify hook input schema directly ×4
### Active
• [65%] [testing] Always run tests before reporting done ×3
### Building
• [35%] [git] Check remote before push ×2
### Cluster Candidates
Cluster A: [bun, testing, hooks] — 2 instincts with 85%+ confidence
→ Run /evolve --promote to convert to CLAUDE.md rule
/evolve --promote
- Show cluster candidates with their instincts
- Ask user: "Which cluster to promote?" (AskUserQuestion)
- Ask user: "Promote as: CLAUDE.md rule | skill file | global rule" (AskUserQuestion)
- Draft the rule/skill based on cluster instincts:
- CLAUDE.md rule: one-line behavioral rule added to project or global CLAUDE.md
- Skill: new skill file scaffolded in
skills/ directory
- Show drafted content and ask: "Approve as-is, edit, or skip?" (AskUserQuestion)
- On approval: write to target file, archive source instincts
- Confirm: "Promoted to [target]. N instincts archived."
Target resolution:
- Default: project-level
.claude/CLAUDE.md or nearest CLAUDE.md
--target global → ~/.claude/CLAUDE.md
--target skill → new file in ~/.claude/skills/[ClusterName]/SKILL.md
- Always confirm target before writing — no silent promotions
/evolve --prune
- Show instincts below 0.5 confidence (building tier)
- For each, show: text, confidence, trigger_count, age, tags
- Ask user to select which to archive manually
- Archive selected instincts →
instincts-archived.jsonl
- Confirm: "N instincts archived."
/evolve --stats
Display metrics:
## Instinct Statistics
Active instincts: N
Eligible for surfacing (≥0.5): N
Eligible for promotion (≥0.8): N
Average confidence: X.XX
Oldest active instinct: X days ago
Sources: correction: N | repetition: N | rating: N
Archived total: N
Decay schedule: -0.1 per 30 days | Archive at 0.0
Cap: 100 active (auto-archive lowest on overflow)
Implementation Notes
- Uses
hooks/lib/instinct-store.ts for all read/write operations
- Clustering via
getClusteredInstincts(paiDir) — returns InstinctCluster[] with
instincts, centroidScore, and promotable fields
- Embedding vectors cached at
MEMORY/STATE/embeddings/instinct-vectors.jsonl
- All file writes require explicit user confirmation via AskUserQuestion
- Source instincts are archived (not deleted) after successful promotion
Related Files
MEMORY/LEARNING/INSTINCTS/instincts.jsonl — active instincts
MEMORY/LEARNING/INSTINCTS/instincts-archived.jsonl — archived instincts
hooks/InstinctCapture.hook.ts — captures new instincts (patterns 1-4)
hooks/WriteTracker.hook.ts — tracks PAI writes for revert detection
hooks/lib/instinct-store.ts — CRUD, decay, clustering, dedup
hooks/lib/instinct-dedup.ts — semantic dedup via embeddings
hooks/lib/instinct-cluster.ts — embedding-based clustering algorithm
config/settings.json → instincts block — feature flags
1---2name: evolve3description: Instinct Evolution Dashboard. USE WHEN /evolve, instinct dashboard, review instincts, promote instinct, prune instincts, instinct stats, evolve instincts.4---56# /evolve — Instinct Evolution Dashboard78**Purpose:** Review, promote, and prune behavioral instincts captured during sessions.9**Trigger:** User types `/evolve` (user-invoked only, never auto-run)1011---1213## Invocation Forms1415```16/evolve → Show instinct dashboard + cluster candidates17/evolve --promote → Promote a cluster to CLAUDE.md rule or skill18/evolve --prune → Review low-value instincts for manual archival19/evolve --stats → Instinct metrics (count, confidence distribution, age)20```2122---2324## Workflow2526### /evolve (Dashboard)27281. Load active instincts from `MEMORY/LEARNING/INSTINCTS/instincts.jsonl`292. Display summary table grouped by confidence tier:30 - 🔥 High (0.8+): eligible for promotion31 - ✅ Active (0.5–0.79): surfacing at session start32 - 💤 Building (0.3–0.49): accumulating confidence333. Identify cluster candidates using `getClusteredInstincts()` from `hooks/lib/instinct-store.ts`:34 - Embedding-based clustering (cosine similarity >0.7, max 8 per cluster)35 - Falls back to tag-based clustering if no embeddings cached36 - Only clusters where ALL instincts have confidence ≥0.8 AND trigger_count ≥3 are promotable374. Display: "Found N cluster(s) eligible for promotion. Run `/evolve --promote` to review."3839**Output format:**40```41## Instinct Dashboard4243Active: N | Eligible (surfacing): N | Archive-eligible (decayed): N4445### High Confidence (ready for promotion)46• [95%] [kai, hooks, bun] Use bun test --bail for faster feedback ×747• [82%] [kai, hooks] Never modify hook input schema directly ×44849### Active50• [65%] [testing] Always run tests before reporting done ×35152### Building53• [35%] [git] Check remote before push ×25455### Cluster Candidates56Cluster A: [bun, testing, hooks] — 2 instincts with 85%+ confidence57 → Run /evolve --promote to convert to CLAUDE.md rule58```5960---6162### /evolve --promote63641. Show cluster candidates with their instincts652. Ask user: "Which cluster to promote?" (AskUserQuestion)663. Ask user: "Promote as: CLAUDE.md rule | skill file | global rule" (AskUserQuestion)674. Draft the rule/skill based on cluster instincts:68 - CLAUDE.md rule: one-line behavioral rule added to project or global CLAUDE.md69 - Skill: new skill file scaffolded in `skills/` directory705. Show drafted content and ask: "Approve as-is, edit, or skip?" (AskUserQuestion)716. On approval: write to target file, archive source instincts727. Confirm: "Promoted to [target]. N instincts archived."7374**Target resolution:**75- Default: project-level `.claude/CLAUDE.md` or nearest CLAUDE.md76- `--target global` → `~/.claude/CLAUDE.md`77- `--target skill` → new file in `~/.claude/skills/[ClusterName]/SKILL.md`78- **Always confirm target before writing** — no silent promotions7980---8182### /evolve --prune83841. Show instincts below 0.5 confidence (building tier)852. For each, show: text, confidence, trigger_count, age, tags863. Ask user to select which to archive manually874. Archive selected instincts → `instincts-archived.jsonl`885. Confirm: "N instincts archived."8990---9192### /evolve --stats9394Display metrics:95```96## Instinct Statistics9798Active instincts: N99 Eligible for surfacing (≥0.5): N100 Eligible for promotion (≥0.8): N101Average confidence: X.XX102Oldest active instinct: X days ago103Sources: correction: N | repetition: N | rating: N104Archived total: N105106Decay schedule: -0.1 per 30 days | Archive at 0.0107Cap: 100 active (auto-archive lowest on overflow)108```109110---111112## Implementation Notes113114- Uses `hooks/lib/instinct-store.ts` for all read/write operations115- Clustering via `getClusteredInstincts(paiDir)` — returns `InstinctCluster[]` with116 `instincts`, `centroidScore`, and `promotable` fields117- Embedding vectors cached at `MEMORY/STATE/embeddings/instinct-vectors.jsonl`118- All file writes require explicit user confirmation via AskUserQuestion119- Source instincts are archived (not deleted) after successful promotion120121## Related Files122123- `MEMORY/LEARNING/INSTINCTS/instincts.jsonl` — active instincts124- `MEMORY/LEARNING/INSTINCTS/instincts-archived.jsonl` — archived instincts125- `hooks/InstinctCapture.hook.ts` — captures new instincts (patterns 1-4)126- `hooks/WriteTracker.hook.ts` — tracks PAI writes for revert detection127- `hooks/lib/instinct-store.ts` — CRUD, decay, clustering, dedup128- `hooks/lib/instinct-dedup.ts` — semantic dedup via embeddings129- `hooks/lib/instinct-cluster.ts` — embedding-based clustering algorithm130- `config/settings.json` → `instincts` block — feature flags