An advanced learning system that turns your Claude Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring. Feature v1
--- id: prefer-functional-style trigger: "when writing new functions" confidence: 0.7 domain: "code-style" source: "session-observation" --- # Prefer Functional Style ## Action Use functional patterns over classes when appropriate. ## Evidence - Observed 5 instances of functional pattern preference - User corrected class-based approach to functional on 2025-01-15
Session Activity │ │ Hooks capture prompts + tool use (100% reliable) ▼ ┌─────────────────────────────────────────┐ │ observations.jsonl │ │ (prompts, tool calls, outcomes) │ └─────────────────────────────────────────┘ │ │ Observer agent reads (background, Haiku) ▼ ┌─────────────────────────────────────────┐ │ PATTERN DETECTION │ │ • User corrections → instinct │ │ • Error resolutions → instinct │ │ • Repeated workflows → instinct │ └─────────────────────────────────────────┘ │ │ Creates/updates ▼ ┌─────────────────────────────────────────┐ │ instincts/personal/ │ │ • prefer-functional.md (0.7) │ │ • always-test-first.md (0.9) │ │ • use-zod-validation.md (0.6) │ └─────────────────────────────────────────┘ │ │ /evolve clusters ▼ ┌─────────────────────────────────────────┐ │ evolved/ │ │ • commands/new-feature.md │ │ • skills/testing-workflow.md │ │ • agents/refactor-specialist.md │ └─────────────────────────────────────────┘
~/.claude/settings.json.{ "hooks": { "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh pre" }] }], "PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh post" }] }] } } `**If installed manually** to `~/.claude/skills`:` { "hooks": { "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh pre" }] }], "PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh post" }] }] } }
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}} touch ~/.claude/homunculus/observations.jsonl `### 3\. Use the Instinct Commands` /instinct-status # Show learned instincts with confidence scores /evolve # Cluster related instincts into skills/commands /instinct-export # Export instincts for sharing /instinct-import # Import instincts from others
/instinct-status/evolve/instinct-export/instinct-import <file>config.json:{ "version": "2.0", "observation": { "enabled": true, "store_path": "~/.claude/homunculus/observations.jsonl", "max_file_size_mb": 10, "archive_after_days": 7 }, "instincts": { "personal_path": "~/.claude/homunculus/instincts/personal/", "inherited_path": "~/.claude/homunculus/instincts/inherited/", "min_confidence": 0.3, "auto_approve_threshold": 0.7, "confidence_decay_rate": 0.05 }, "observer": { "enabled": true, "model": "haiku", "run_interval_minutes": 5, "patterns_to_detect": [ "user_corrections", "error_resolutions", "repeated_workflows", "tool_preferences" ] }, "evolution": { "cluster_threshold": 3, "evolved_path": "~/.claude/homunculus/evolved/" } } `## File Structure` ~/.claude/homunculus/ ├── identity.json # Your profile, technical level ├── observations.jsonl # Current session observations ├── observations.archive/ # Processed observations ├── instincts/ │ ├── personal/ # Auto-learned instincts │ └── inherited/ # Imported from others └── evolved/ ├── agents/ # Generated specialist agents ├── skills/ # Generated skills └── commands/ # Generated commands
source: "repo-analysis" and include the source repository URL."v1 relied on skills to observe. Skills are probabilistic—they fire ~50-80% of the time based on Claude's judgment."
~/.claude/skills/learned/ skills still work