Overview
What's New in v2.1
Project-scoped instincts — React patterns stay in React projects, Python conventions in Python projects. Universal patterns (like “always validate input”) are shared globally.
v2.1 Features
| Feature | v2.0 | v2.1 |
|---|---|---|
| Storage | Global only | Project-scoped + global |
| Scope | All instincts everywhere | Isolated by project |
| Detection | None | git remote URL / repo path |
| Promotion | N/A | Project → global (2+ projects) |
| Commands | 4 | 6 (+promote/projects) |
| Cross-project | Contamination risk | Isolated by default |
v2 vs v1 Comparison
| Feature | v1 | v2 | |---------|----|----|| | Observation | Stop hook (session end) | PreToolUse/PostToolUse hooks | | Reliability | ~50-80% | 100% reliable | | Analysis | Main context | Background agent (Haiku) | | Granularity | Full skills | Atomic instincts | | Confidence | None | 0.3-0.9 weighted | | Evolution | Direct to skill | Instincts → cluster → skill/command/agent | | Sharing | None | Export/import |The Instinct Model
An instinct is a small learned behavior:Instinct Properties
Atomic
One trigger, one action. Focused and reusable.
Confidence-Weighted
0.3 = tentative, 0.9 = near certain. Evolves over time.
Domain-Tagged
code-style, testing, git, debugging, workflow, etc.
Evidence-Backed
Tracks what observations created it. Transparent learning.
How It Works
Session Activity Captured
Hooks capture every prompt and tool use (100% reliable). Project context is auto-detected from git remote.Stored in:
~/.claude/homunculus/projects/<project-hash>/observations.jsonlPattern Detection
Observer agent (background, Haiku) reads observations and detects:
- User corrections → instinct
- Error resolutions → instinct
- Repeated workflows → instinct
- Scope decision: project or global?
Instinct Creation
Creates/updates instincts in:
projects/<hash>/instincts/personal/(project-scoped)instincts/personal/(global)
Project Detection
The system automatically detects your current project:
Each project gets a 12-character hash ID (e.g.,
a1b2c3d4e5f6). A registry at ~/.claude/homunculus/projects.json maps IDs to human-readable names.
Quick Start
1. Enable Observation Hooks
Add to~/.claude/settings.json:
2. Initialize Directory Structure
Directories are auto-created on first use. Manual creation is optional.
3. Use Instinct Commands
Commands Reference
/instinct-status
Show all instincts (project-scoped + global) with confidence scores.
/evolve
Cluster related instincts into skills/commands. Suggests promotions.
/instinct-export
Export instincts. Filter by scope (project/global) or domain.
/instinct-import <file>
Import instincts from others. Control scope on import.
/promote [id]
Promote project instincts to global scope.
/projects
List all known projects and their instinct counts.
Configuration
Edit~/.claude/skills/continuous-learning-v2/config.json:
| Key | Default | Description |
|---|---|---|
observer.enabled | false | Enable background observer agent |
observer.run_interval_minutes | 5 | How often observer analyzes observations |
observer.min_observations_to_analyze | 20 | Minimum observations before analysis |
Other behavior (observation capture, instinct thresholds, project scoping, promotion criteria) is configured in
instinct-cli.py and observe.sh.File Structure
Scope Decision Guide
| Pattern Type | Scope | Examples |
|---|---|---|
| Language/framework conventions | project | ”Use React hooks”, “Follow Django patterns” |
| File structure preferences | project | ”Tests in __tests__/”, “Components in src/“ |
| Code style | project | ”Use functional style”, “Prefer dataclasses” |
| Error handling strategies | project | ”Use Result type for errors” |
| Security practices | global | ”Validate user input”, “Sanitize SQL” |
| General best practices | global | ”Write tests first”, “Handle all errors” |
| Tool workflow | global | ”Grep before Edit”, “Read before Write” |
| Git practices | global | ”Conventional commits”, “Small commits” |
Instinct Promotion
When the same instinct appears in multiple projects with high confidence, promote to global scope.Auto-Promotion Criteria
- Same instinct ID in 2+ projects
- Average confidence >= 0.8
Promote Instincts
Confidence Scoring
| Score | Meaning | Behavior |
|---|---|---|
| 0.3 | Tentative | Suggested but not enforced |
| 0.5 | Moderate | Applied when relevant |
| 0.7 | Strong | Auto-approved for application |
| 0.9 | Near-certain | Core behavior |
Confidence Increases When:
- Pattern is repeatedly observed
- User doesn’t correct the suggested behavior
- Similar instincts from other sources agree
Confidence Decreases When:
- User explicitly corrects the behavior
- Pattern isn’t observed for extended periods
- Contradicting evidence appears
Why Hooks vs Skills?
Hooks fire 100% of the time, deterministically:- Every tool call is observed
- No patterns are missed
- Learning is comprehensive
Backward Compatibility
v2.1 is fully compatible with v2.0 and v1:- Existing global instincts in
~/.claude/homunculus/instincts/work as global instincts - Existing
~/.claude/skills/learned/skills from v1 still work - Stop hook still runs (but now also feeds into v2)
- Gradual migration: run both in parallel
Privacy
Local-First Learning
- Observations stay local on your machine
- Project-scoped instincts isolated per project
- Only patterns (instincts) can be exported — not raw observations
- No code or conversation content shared
- You control what gets exported and promoted
Related Tools
- Skill Creator — Generate instincts from repo history
- Homunculus — Community project that inspired the v2 architecture
- The Longform Guide — Continuous learning section
Example Workflow
Instinct-based learning: teaching Claude your patterns, one project at a time.