Skip to main content
The Continuous Learning v2 system automatically learns from your Claude Code sessions through atomic “instincts” — small learned behaviors with confidence scoring.

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

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

1

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.jsonl
2

Pattern Detection

Observer agent (background, Haiku) reads observations and detects:
  • User corrections → instinct
  • Error resolutions → instinct
  • Repeated workflows → instinct
  • Scope decision: project or global?
3

Instinct Creation

Creates/updates instincts in:
  • projects/<hash>/instincts/personal/ (project-scoped)
  • instincts/personal/ (global)
Each with confidence score (0.3-0.9).
4

Evolution

/evolve clusters related instincts into:
  • commands/ — new slash commands
  • skills/ — reusable workflows
  • agents/ — specialized subagents

Project Detection

The system automatically detects your current project:
1

Environment Variable (Highest Priority)

2

Git Remote URL

Hashed to create portable project ID. Same repo on different machines gets same ID.
3

Git Repo Path (Fallback)

Machine-specific fallback.
4

Global Fallback

If no project detected, instincts go to global scope.
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:
Other behavior (observation capture, instinct thresholds, project scoping, promotion criteria) is configured in instinct-cli.py and observe.sh.

File Structure

Scope Decision Guide

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

The /evolve command also suggests promotion candidates.

Confidence Scoring

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?

v1 used skills for observation. Skills fire ~50-80% of the time based on Claude’s judgment.
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
  • Skill Creator — Generate instincts from repo history
  • Homunculus — Community project that inspired the v2 architecture
  • The Longform Guide — Continuous learning section

Example Workflow

1

Work Normally

Use Claude Code as usual. Hooks capture all activity automatically.
2

Check Learned Patterns

Review instincts learned from your sessions.
3

Evolve Into Skills

Cluster related instincts into reusable skills, commands, or agents.
4

Promote Universal Patterns

Move patterns that apply across projects to global scope.
5

Share With Team

Export instincts for team members to import.

Instinct-based learning: teaching Claude your patterns, one project at a time.