evolve
Skill1 starsChanged 8 months agoMITView on GitHub
Evolve — Continuous Learning Pipeline. Manages automatic behavioral pattern extraction from Claude Code sessions. Use to install hooks, run analysis, and graduate instincts.
41 other projects use a version of this.
Adopted by
Most recently taken up by
- SethGammon/Citadeltheir own version, first seen Nov 4, 2026
- vidit19sharma/neogentstheir own version, first seen Nov 1, 2026
- cabernect/caberostheir own version, first seen Nov 1, 2026
- Snowflake-Labs/coco-skillstheir own version, first seen Nov 1, 2026
- NobiResearch/Ovenbirdtheir own version, first seen Nov 1, 2026
- ES-92/esctheir own version, first seen Oct 20, 2026
Used with
Projects with it also use instinct-export, instinct-import and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TheKREATORSSkillinstinct-export
Export instincts from project/global scope to a file
Also in 4 projects that use this
TheKREATORSSkillinstinct-import
Import instincts from file or URL into project/global scope
Also in 4 projects that use this
AWSSkillmap
Map verified service capabilities against customer-provided control framework and threat model. Produces mapping-results.json, controls-catalog.md, and framework-mapping.md. Supports pluggable frameworks: CCMv4, NIST 800-53, CIS Benchmarks, ISO 27001, etc. Split into 4 focused sub-skills for better accuracy; this skill orchestrates them.
Also in 5 projects that use this
diego-tobalinaSkillbuild-fix
Fix build and compilation errors systematically. Run when build fails.
Also in 3 projects that use this
launch52-aiSkillskill-create
Create and validate Claude Code skills with proper structure, checklists, and validation scripts. Use when creating a new skill, auditing existing skills, or ensuring skills meet quality standards. Generates complete skill scaffolds with SKILL.md, check scripts, guides, and templates.
Also in 3 projects that use this
qtzx06Skilleval
Evaluate trained YOLO model accuracy with mAP metrics and per-class error analysis. Identifies failure cases for targeted improvement. Use after training.
Also in 5 projects that use this
- +1 more from TheKREATORS
Other versions41 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 41
- revfactory/harness★ 9.1ksame name
- Q00/ouroboros★ 6.3ksame name
- yologdev/yoyo-evolve★ 1.9ksame name
- iovisor/ubpf★ 996same name
- SethGammon/Citadel★ 927same name
- GAIR-NLP/ASI-Evolve★ 867same name
- Kanevry/session-orchestrator★ 53same name
- mycelium-hq/ai-brain-starter★ 50same name
- Snowflake-Labs/coco-skills★ 49same name
- unclejobs-ai/second-claude-code★ 41same name
31 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- algorithmic-artSkill
- audit-componentsSkill
- canvas-designSkill
- cascade-orchestrationSkill
- consultSkill
- data-reconciliationSkill
- debug-collaborateSkill
- deep-root-causeSkill
- deploy-allSkill
- design-reverse-engineerSkill
- design-showcaseSkill
- docxSkill
- env-auditSkill
- frontend-designSkill
- full-stack-buildSkill
- full-stack-traceSkill
- gh-repo-reconSkill
- grill-meSkill
- handoffSkill
- html-slidesSkill
- insightSkill
- internal-commsSkill
- isolation-testSkill
- mcp-builderSkill
- model-selectionSkill
- pdfSkill
- persistent-issueSkill
- pre-merge-reviewSkill
- premise-auditSkill
- propagate-featureSkill
- regression-bisectSkill
- research-gateSkill
- review-implSkill
- schema-checkSkill
- session-notesSkill
- skill-auditSkill
- skill-creatorSkill
- slack-gif-creatorSkill
- start-daySkill
- temporal-forensicsSkill
- theme-factorySkill
- throwaway-scriptSkill
- triage-ideasSkill
- verify-completeSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- wisdomSkill
- worker-buildSkill
- worktree-guardSkill
- write-planSkill
- xlsxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 4 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 36 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Add to your project-level settings file (~/.claude/projects/<project-hash>/settings.json):
- Distinctive: line 82
When the user says "evolve", "check instincts", "learning status", "prune instincts", or "promote patterns".
- Very specific: line 107
Remove pending instincts older than 30 days (dry run by default).
- Distinctive: line 222
If 50+ new observations AND 30min cooldown elapsed:
- Very specific: line 248
Should work without shell: true but it's kept for consistency.
- Very specific: line 256
NOT in the repo's .claude/settings.json — that file is for permissions and project config, not hooks.
- Distinctive: line 262
Look for the directory matching your repo path (hyphens replace path separators).
- Very specific: line 267
Check hooks are in ~/.claude/projects/<hash>/settings.json (not .claude/settings.json)
- Very specific: line 268
Verify observe.js exists at .claude/scripts/observe.js
- Very specific: line 273
Check analysis log: tail .claude/homunculus/analysis-log.jsonl
- Very specific: line 274
Check the analysis prompt: verify the "write to" path is outside .claude/
- Very specific: line 278
Ensure shell: true is set in the fallback spawn options
- Distinctive: line 288
Automatic: When 50+ new observations accumulate and 30min cooldown passes, Opus analyzes and writes instincts
- Very specific: line 289
Manual: Run /evolve status to check observation counts and instinct generation
- Very specific: line 290
Manual: Run /evolve list to review generated instincts
- Very specific: line 291
Manual: Run /evolve to see evolution candidates (instinct clusters that could become skills)
- Very specific: line 292
Manual: Run /evolve generate to create skills from high-confidence clusters
- Very specific: line 293
Manual: Run /evolve prune to clean up stale pending instincts (30+ days old)
“Common” is measured: kept by at least 6 in 10 of the 36 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Evolve — Continuous Learning Pipeline
Automatic behavioral pattern extraction from Claude Code sessions. Observes tool usage, detects repeated patterns, and generates "instincts" (reusable behavioral rules) that improve future sessions.
Quick Start
1. Install the hooks
Add to your project-level settings file (~/.claude/projects/<project-hash>/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash|Edit|Write|Read|Glob|Grep|Agent",
"hooks": [
{
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/scripts/observe.js\" 2>/dev/null || true",
"timeout": 5,
"async": true
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash|Edit|Write|Read|Glob|Grep|Agent",
"hooks": [
{
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/scripts/observe.js\" 2>/dev/null || true",
"timeout": 5,
"async": true
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/scripts/observer-analyze.js\" 2>/dev/null || true",
"timeout": 10,
"async": true
}
]
}
]
}
}2. Add to .gitignore
# Observations (local session data, not shareable)
.claude/homunculus/projects/*/observations-structural.jsonl
.claude/homunculus/projects/*/observations-content.jsonl
.claude/homunculus/projects/*/observations.archive/
.claude/homunculus/projects/*/.last-analysis
.claude/homunculus/projects/*/.analysis-prompt.md
.claude/homunculus/analysis-log.jsonl
# Generated instincts (local learning data)
homunculus/3. Use it
Just work normally. Observations accumulate automatically. After 50+ new observations, the Stop hook triggers Opus analysis which writes instinct files. Run /evolve status to check progress.
Trigger
When the user says "evolve", "check instincts", "learning status", "prune instincts", or "promote patterns".
Commands
The CLI auto-detects the project root via git rev-parse --show-toplevel. Running from any subdir of the repo works:
node .claude/scripts/instinct-cli.js <command>CLAUDE_PROJECT_DIR still takes precedence if set (used inside Claude Code sessions).
/evolve status
Show observation counts, instinct counts, last analysis time, evolved skills.
/evolve list
List all instincts with confidence scores, grouped by project and scope.
/evolve
Analyze instinct clusters and show evolution candidates (skills, commands, agents).
/evolve generate
Actually generate skill/command/agent files from qualified instinct clusters.
/evolve prune
Remove pending instincts older than 30 days (dry run by default). Use --no-dry-run to execute.
Architecture
Data Flow
Tool calls ──→ observe.js (PreToolUse/PostToolUse hook)
│
├──→ observations-structural.jsonl (metadata only, injection-safe)
└──→ observations-content.jsonl (full I/O, secrets scrubbed)
│
observer-analyze.js (Stop hook)
checks: 50+ new obs AND 30min cooldown
│
Spawns: claude --print --model opus
Reads observations, writes instinct .md files
│
homunculus/instincts/<project-id>/*.md
│
/wisdom (primary, human-driven, Fridays)
──→ skill enhancements, new skills, CLAUDE.md edits
/evolve generate (fallback, mechanical)
──→ SKILL.md scaffolds in .claude/homunculus/evolved/skills/project-id is repo-stable: keyed off git remote get-url origin (normalized), not cwd. Worktrees, case-variant paths, and isolated subagents all share one project_id per repo.
Graduation path: /wisdom is the primary mechanism — it reads instincts + CLAUDE.md + all skill descriptions and proposes where each instinct should land. /evolve generate is a mechanical fallback that produces minimal SKILL.md scaffolds from clusters; its output dir (evolved/skills/) is expected to be empty in normal operation. See /observer-ops § Graduation path if available.
Directory Layout
<repo>/
├── .claude/
│ ├── scripts/
│ │ ├── observe.js # Hook: logs tool calls to JSONL
│ │ ├── observer-analyze.js # Hook: triggers analysis at threshold
│ │ └── instinct-cli.js # CLI: list/evolve/prune/status
│ └── homunculus/ # Observation data (gitignored)
│ ├── projects.json # Project registry
│ ├── analysis-log.jsonl # Analysis run history
│ └── projects/<hash>/
│ ├── observations-structural.jsonl
│ ├── observations-content.jsonl
│ ├── .last-analysis # Timestamp marker
│ └── .analysis-prompt.md # Last analysis prompt
└── homunculus/ # Generated instincts (gitignored)
└── instincts/<project-id>/
├── build-verify-after-edits.md
└── prefer-edit-over-write.mdWhy two directories?
Critical design constraint: Claude Code's Write tool blocks writes to .claude/ directories, even with --dangerously-skip-permissions. This is a hard security restriction.
.claude/homunculus/— Observations written by Node.js (fs.appendFileSync), no Claude CLI involvement. Works fine.homunculus/(repo root) — Instincts written by the spawnedclaude --printanalysis process using the Write tool. Must be outside.claude/.
Instinct Schema
---
id: kebab-case-unique-id
trigger: "when [specific condition]"
confidence: 0.7 # 0.3-0.9
domain: code-style|testing|git|debugging|workflow|file-patterns
source: session-observation
scope: project|global
project_id: 12-char-hash
project_name: project-name
created: YYYY-MM-DD
---
# Title
## Action
What to do when the trigger condition is met.
## Evidence
- Observed N instances of this pattern
- Specific examples from observationsConfidence Thresholds
| Score | Meaning | Based on |
| 0.3 | Tentative — noted but not enforced | 3 occurrences |
| 0.5 | Moderate — applied when relevant | 3-5 occurrences |
| 0.7 | Strong — auto-approved | 6-10 occurrences |
| 0.85+ | Core behavior | 11+ occurrences |
Confidence is boosted +0.05 for confirming evidence and decayed -0.1 for contradicting evidence on subsequent analyses.
Scripts Reference
observe.js — Observation Logger
Runs as async PreToolUse/PostToolUse hook. Reads tool call JSON from stdin, writes two JSONL streams:
- Structural (metadata only): tool name, file paths, command previews, patterns, exit codes. Safe for automated analysis — no user content.
- Content (full I/O): complete tool input/output with secrets scrubbed. For manual review only.
Features:
- Secret scrubbing (API keys, tokens, passwords, connection strings, DB URLs)
- Truncation (3KB per field)
- Auto-rotation at 10MB per file
- Project identification via git remote hash (normalized: SSH vs HTTPS collapse to same ID)
- Recursion guard (
ECC_SKIP_OBSERVE=1)
observer-analyze.js — Analysis Trigger
Runs as async Stop hook. Checks if enough new observations have accumulated:
- Finds the most recently active project
- Counts observations since last analysis
- If 50+ new observations AND 30min cooldown elapsed:
- Generates analysis prompt with recent observations + existing instincts
- Spawns
claude --print --model opusin background - The spawned process reads observations, identifies patterns, writes instinct files
Configuration constants:
| Constant | Default | Purpose |
OBSERVATION_THRESHOLD | 50 | Minimum new observations before analysis |
ANALYSIS_COOLDOWN_MS | 30 min | Minimum time between analyses |
MAX_OBSERVATIONS_TO_ANALYZE | 200 | Cap on observations per analysis (controls prompt size) |
instinct-cli.js — Management CLI
Commands: status, list, evolve, prune
Searches for instincts in both .claude/homunculus/ (legacy) and homunculus/instincts/ (current) directories. Displays sanitized output to prevent prompt injection from untrusted observation content.
Platform Notes
Windows
spawn('claude')fails with ENOENT because Node.js can't resolveclaude.cmdwithout a shell.observer-analyze.jsprefers directnode cli.jsinvocation overclaude.cmdto avoid console windows.- Path separators are normalized to forward slashes in the analysis prompt.
macOS / Linux
- Should work without
shell: truebut it's kept for consistency. - The
claudebinary is typically at~/.npm-global/bin/claudeor in/usr/local/bin/.
Settings File Location
Hooks MUST be in the project-level settings file:
~/.claude/projects/<project-hash>/settings.jsonNOT in the repo's .claude/settings.json — that file is for permissions and project config, not hooks. Claude Code reads hooks from the user-level project settings file.
To find your project hash:
ls ~/.claude/projects/Look for the directory matching your repo path (hyphens replace path separators).
Troubleshooting
No observations accumulating
- Check hooks are in
~/.claude/projects/<hash>/settings.json(not.claude/settings.json) - Verify
observe.jsexists at.claude/scripts/observe.js - Test manually:
echo '{}' | CLAUDE_PROJECT_DIR="$(pwd)" node .claude/scripts/observe.js
Analyses running but no instincts generated
- Most likely: Claude CLI can't write to
.claude/— instincts must go tohomunculus/at repo root - Check analysis log:
tail .claude/homunculus/analysis-log.jsonl - Check the analysis prompt: verify the "write to" path is outside
.claude/
spawn claude ENOENT (Windows)
- The script prefers direct
node path/to/cli.jsinvocation; falls back to shell invocation - Ensure
shell: trueis set in the fallback spawn options
Too many project hashes
- Worktree agents create unique git remotes, generating separate project IDs
- This is expected — each worktree's observations are independent
- The main project (matching your repo name) accumulates the most observations
Workflow
- Automatic: Observations accumulate from normal Claude Code usage (every tool call)
- Automatic: When 50+ new observations accumulate and 30min cooldown passes, Opus analyzes and writes instincts
- Manual: Run
/evolve statusto check observation counts and instinct generation - Manual: Run
/evolve listto review generated instincts - Manual: Run
/evolveto see evolution candidates (instinct clusters that could become skills) - Manual: Run
/evolve generateto create skills from high-confidence clusters - Manual: Run
/evolve pruneto clean up stale pending instincts (30+ days old)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

