Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
affaan-m avatar

Continuous Learning V2

  • 8.2k installs
  • 238k repo stars
  • Updated August 5, 2026
  • affaan-m/everything-claude-code

continuous-learning-v2 is an agent skill that learns atomic instincts from Claude Code sessions via hooks and evolves them into skills or agents.

About

The continuous-learning-v2 skill implements an instinct-based learning system that observes Claude Code sessions through hooks and converts patterns into atomic instincts with confidence scores. Version 2.1 adds project-scoped instincts stored under ecc-homunculus project hashes to prevent cross-project contamination, detecting scope via git remote URL or repo path. Instincts can promote from project to global scope when seen in two or more projects. Commands expanded from four to six with promote and projects management alongside status, evolve, export, and import. The system evolves high-confidence instincts into full skills, commands, or agents over time. Activation covers configuring hooks, tuning confidence thresholds, reviewing instinct libraries, and managing project versus global scope. Universal patterns like input validation can remain global while framework-specific conventions stay project-local. Use when setting up automatic session learning, instinct extraction, or promoting learned behaviors into reusable agent assets.

  • Instinct-based atomic learned behaviors with confidence scoring.
  • v2.1 project-scoped storage prevents cross-project contamination.
  • Promotion from project to global when pattern seen in 2+ projects.
  • Six commands: status, evolve, export, import, promote, projects.
  • Evolves instincts into skills, commands, or agents over time.

Continuous Learning V2 by the numbers

  • 8,198 all-time installs (skills.sh)
  • +249 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #108 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

continuous-learning-v2 capabilities & compatibility

Capabilities
session hook observation · atomic instinct creation with confidence · project scoped instinct isolation · instinct promotion to global scope · evolution into skills commands agents
Use cases
orchestration · memory
From the docs

What continuous-learning-v2 says it does

Instinct-based learning system that observes sessions via hooks
SKILL.md
v2.1 adds project-scoped instincts to prevent cross-project contamination.
SKILL.md
npx skills add https://github.com/affaan-m/everything-claude-code --skill continuous-learning-v2

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs8.2k
repo stars238k
Security audit2 / 3 scanners passed
Last updatedAugust 5, 2026
Repositoryaffaan-m/everything-claude-code

How do I automatically capture reusable patterns from agent sessions without cross-project contamination?

Observe Claude Code sessions via hooks, create project-scoped instincts with confidence scoring, and evolve them into skills or agents.

Who is it for?

Developers setting up automatic learning from Claude Code sessions with scoped instinct storage.

Skip if: Skip when you need one-off manual skill authoring without session hook observation.

When should I use this skill?

User sets up continuous learning hooks, reviews instincts, or promotes learned patterns to skills.

What you get

Project-scoped instinct library with confidence scores and optional promotion to global skills.

  • observer session files
  • automated analysis triggers

By the numbers

  • Default analysis cooldown of 60 seconds via `ECC_OBSERVER_ANALYSIS_COOLDOWN`
  • Default idle timeout of 1800 seconds via `ECC_OBSERVER_IDLE_TIMEOUT_SECONDS`

Files

SKILL.mdMarkdownGitHub ↗

Continuous Learning v2.1 - Instinct

-Based Architecture

An advanced learning system that turns your Claude Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring.

v2.1 adds project-scoped instincts — React patterns stay in your React project, Python conventions stay in your Python project, and universal patterns (like "always validate input") are shared globally.

When to Activate

  • Setting up automatic learning from Claude Code sessions
  • Configuring instinct-based behavior extraction via hooks
  • Tuning confidence thresholds for learned behaviors
  • Reviewing, exporting, or importing instinct libraries
  • Evolving instincts into full skills, commands, or agents
  • Managing project-scoped vs global instincts
  • Promoting instincts from project to global scope

What's New in v2.1

Featurev2.0v2.1
StorageGlobal (~/.claude/homunculus/)Project-scoped (${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/projects/<hash>/)
ScopeAll instincts apply everywhereProject-scoped + global
DetectionNonegit remote URL / repo path
PromotionN/AProject → global when seen in 2+ projects
Commands4 (status/evolve/export/import)6 (+promote/projects)
Cross-projectContamination riskIsolated by default

What's New in v2 (vs v1)

Featurev1v2
ObservationStop hook (session end)PreToolUse/PostToolUse (100% reliable)
AnalysisMain contextBackground agent (Haiku)
GranularityFull skillsAtomic "instincts"
ConfidenceNone0.3-0.9 weighted
EvolutionDirect to skillInstincts -> cluster -> skill/command/agent
SharingNoneExport/import instincts

The Instinct Model

An instinct is a small learned behavior:

---
id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.7
domain: "code-style"
source: "session-observation"
scope: project
project_id: "a1b2c3d4e5f6"
project_name: "my-react-app"
---

# 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

Properties:

  • Atomic -- one trigger, one action
  • Confidence-weighted -- 0.3 = tentative, 0.9 = near certain
  • Domain-tagged -- code-style, testing, git, debugging, workflow, etc.
  • Evidence-backed -- tracks what observations created it
  • Scope-aware -- project (default) or global

How It Works

Session Activity (in a git repo)
      |
      | Hooks capture prompts + tool use (100% reliable)
      | + detect project context (git remote / repo path)
      v
+---------------------------------------------+
|  projects/<project-hash>/observations.jsonl  |
|   (prompts, tool calls, outcomes, project)   |
+---------------------------------------------+
      |
      | Observer agent reads (background, Haiku)
      v
+---------------------------------------------+
|          PATTERN DETECTION                   |
|   * User corrections -> instinct             |
|   * Error resolutions -> instinct            |
|   * Repeated workflows -> instinct           |
|   * Scope decision: project or global?       |
+---------------------------------------------+
      |
      | Creates/updates
      v
+---------------------------------------------+
|  projects/<project-hash>/instincts/personal/ |
|   * prefer-functional.yaml (0.7) [project]   |
|   * use-react-hooks.yaml (0.9) [project]     |
+---------------------------------------------+
|  instincts/personal/  (GLOBAL)               |
|   * always-validate-input.yaml (0.85) [global]|
|   * grep-before-edit.yaml (0.6) [global]     |
+---------------------------------------------+
      |
      | /evolve clusters + /promote
      v
+---------------------------------------------+
|  projects/<hash>/evolved/ (project-scoped)   |
|  evolved/ (global)                           |
|   * commands/new-feature.md                  |
|   * skills/testing-workflow.md               |
|   * agents/refactor-specialist.md            |
+---------------------------------------------+

Project Detection

The system automatically detects your current project:

1. `CLAUDE_PROJECT_DIR` env var (highest priority) 2. `git remote get-url origin` -- hashed to create a portable project ID (same repo on different machines gets the same ID) 3. `git rev-parse --show-toplevel` -- fallback using repo path (machine-specific) 4. Global fallback -- if no project is detected, instincts go to global scope

Each project gets a 12-character hash ID (e.g., a1b2c3d4e5f6). A registry file at ${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/projects.json maps IDs to human-readable names.

Data Directory

Continuous-learning-v2 stores observer data outside ~/.claude so Claude Code's sensitive-path guard does not block background instinct writes:

1. CLV2_HOMUNCULUS_DIR when set to an absolute path 2. $XDG_DATA_HOME/ecc-homunculus 3. $HOME/.local/share/ecc-homunculus

Existing users with data at ~/.claude/homunculus can migrate once:

bash skills/continuous-learning-v2/scripts/migrate-homunculus.sh

Quick Start

1. Enable Observation Hooks

If installed as a plugin (recommended):

No extra settings.json hook block is required. Claude Code v2.1+ auto-loads the plugin hooks/hooks.json, and observe.sh is already registered there.

If you previously copied observe.sh into ~/.claude/settings.json, remove that duplicate PreToolUse / PostToolUse block. Duplicating the plugin hook causes double execution and ${CLAUDE_PLUGIN_ROOT} resolution errors because that variable is only available inside plugin-managed hooks/hooks.json entries.

If installed manually to ~/.claude/skills, add this to your ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh"
      }]
    }]
  }
}

2. Initialize Directory Structure

The system creates directories automatically on first use, but you can also create them manually:

# Global directories
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/ecc-homunculus"/{instincts/{personal,inherited},evolved/{agents,skills,commands},projects}

# Project directories are auto-created when the hook first runs in a git repo

3. Use the Instinct Commands

/instinct-status     # Show learned instincts (project + global)
/evolve              # Cluster related instincts into skills/commands
/instinct-export     # Export instincts to file
/instinct-import     # Import instincts from others
/promote             # Promote project instincts to global scope
/projects            # List all known projects and their instinct counts

Commands

CommandDescription
/instinct-statusShow all instincts (project-scoped + global) with confidence
/evolveCluster related instincts into skills/commands, suggest promotions
/instinct-exportExport instincts (filterable by scope/domain)
/instinct-import <file>Import instincts with scope control
/promote [id]Promote project instincts to global scope
/projectsList all known projects and their instinct counts

Configuration

Edit config.json to control the background observer:

{
  "version": "2.1",
  "observer": {
    "enabled": false,
    "run_interval_minutes": 5,
    "min_observations_to_analyze": 20
  }
}
KeyDefaultDescription
observer.enabledfalseEnable the background observer agent
observer.run_interval_minutes5How often the observer analyzes observations
observer.min_observations_to_analyze20Minimum observations before analysis runs

Other behavior (observation capture, instinct thresholds, project scoping, promotion criteria) is configured via code defaults in instinct-cli.py and observe.sh.

File Structure

${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/
+-- identity.json           # Your profile, technical level
+-- projects.json           # Registry: project hash -> name/path/remote
+-- observations.jsonl      # Global observations (fallback)
+-- instincts/
|   +-- personal/           # Global auto-learned instincts
|   +-- inherited/          # Global imported instincts
+-- evolved/
|   +-- agents/             # Global generated agents
|   +-- skills/             # Global generated skills
|   +-- commands/           # Global generated commands
+-- projects/
    +-- a1b2c3d4e5f6/       # Project hash (from git remote URL)
    |   +-- project.json    # Per-project metadata mirror (id/name/root/remote)
    |   +-- observations.jsonl
    |   +-- observations.archive/
    |   +-- instincts/
    |   |   +-- personal/   # Project-specific auto-learned
    |   |   +-- inherited/  # Project-specific imported
    |   +-- evolved/
    |       +-- skills/
    |       +-- commands/
    |       +-- agents/
    +-- f6e5d4c3b2a1/       # Another project
        +-- ...

Scope Decision Guide

Pattern TypeScopeExamples
Language/framework conventionsproject"Use React hooks", "Follow Django REST patterns"
File structure preferencesproject"Tests in __tests__/", "Components in src/components/"
Code styleproject"Use functional style", "Prefer dataclasses"
Error handling strategiesproject"Use Result type for errors"
Security practicesglobal"Validate user input", "Sanitize SQL"
General best practicesglobal"Write tests first", "Always handle errors"
Tool workflow preferencesglobal"Grep before Edit", "Read before Write"
Git practicesglobal"Conventional commits", "Small focused commits"

Instinct Promotion (Project -> Global)

When the same instinct appears in multiple projects with high confidence, it's a candidate for promotion to global scope.

Auto-promotion criteria:

  • Same instinct ID in 2+ projects
  • Average confidence >= 0.8

How to promote:

# Promote a specific instinct
python3 instinct-cli.py promote prefer-explicit-errors

# Auto-promote all qualifying instincts
python3 instinct-cli.py promote

# Preview without changes
python3 instinct-cli.py promote --dry-run

The /evolve command also suggests promotion candidates.

Confidence Scoring

Confidence evolves over time:

ScoreMeaningBehavior
0.3TentativeSuggested but not enforced
0.5ModerateApplied when relevant
0.7StrongAuto-approved for application
0.9Near-certainCore 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 for Observation?

"v1 relied on skills to observe. Skills are probabilistic -- they fire ~50-80% of the time based on Claude's judgment."

Hooks fire 100% of the time, deterministically. This means:

  • 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 can be migrated from ~/.claude/homunculus/instincts/ with scripts/migrate-homunculus.sh
  • 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

  • Observations stay local on your machine
  • Project-scoped instincts are isolated per project
  • Only instincts (patterns) can be exported — not raw observations
  • No actual code or conversation content is shared
  • You control what gets exported and promoted

Related

  • ECC-Tools GitHub App - Generate instincts from repo history
  • Homunculus - Community project that inspired the v2 instinct-based architecture (atomic observations, confidence scoring, instinct evolution pipeline)
  • The Longform Guide - Continuous learning section

---

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

Related skills

Forks & variants (1)

Continuous Learning V2 has 1 known copy in the catalog totaling 1.5k installs. They canonicalize to this original listing.

FAQ

What cooldown does Continuous Learning v2 use between analyses?

Continuous Learning v2 defaults to a 60-second minimum between analyses through `ECC_OBSERVER_ANALYSIS_COOLDOWN`. The observer skips rapid re-triggers so parallel Claude analysis processes do not pile up.

How does Continuous Learning v2 track project activity?

Continuous Learning v2 writes activity timestamps to `.observer-last-activity` and manages session leases under `.observer-sessions` in the project directory. The bash observer loop reads these files before firing analysis.

Is Continuous Learning V2 safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.