CO

continuous-learning-v2

Observes coding sessions to create reusable instincts and behaviors, scoped to specific projects or globally.

Install

mkdir -p .claude/skills/continuous-learning-v2 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/712" && unzip -o skill.zip -d .claude/skills/continuous-learning-v2 && rm skill.zip

Installs to .claude/skills/continuous-learning-v2

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
235 charsno explicit “when” trigger
Advanced

Key capabilities

  • Hooks into CLI sessions for behavior extraction
  • Calculates confidence scores for learned instincts
  • Isolates instincts via project-scoped directories
  • Promotes repeated behaviors to global skills

How it works

Analyzes session activity through hook captures to identify recurring patterns, which are then stored as versioned, weighted instincts.

Inputs & outputs

You give it
Execution patterns and session hooks
You get back
Atomic instinct files with confidence ratings

When to use continuous-learning-v2

  • Automating knowledge capture from sessions
  • Sharing coding patterns across projects
  • Evolving behaviors into custom CLI commands

About this skill

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) -- honored as an explicit override even when the directory is not a git repo (hashed by its absolute path)
  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.

Observer platform support

The background observer requires WSL2, Linux, or macOS. On native Windows (Git Bash / MSYS2) it starts and reports success, but the process is killed when the spawning hook exits and its Job Object closes, so no analysis ever runs — setting observer.enabled: true there is effectively a no-op (see issue #2489).

observe.sh detects this on the following hook invocation and writes an explanatory warning to observer-start.log once the observer has failed to survive several times in a row.

Env varDefaultDescription
ECC_OBSERVER_NOSURVIVE_WARN_AFTER3Consecutive non-survivals before the warning is logged

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

---

*Content truncated.*

When not to use it

  • Managing permanent static configuration files
  • Executing long-running automated tasks unrelated to coding

Prerequisites

PreToolUse/PostToolUse hook availability

Limitations

  • Requires active session observation
  • Confidence scoring may fluctuate based on noise
  • Cross-project promotion requires multiple occurrences

How it compares

Dynamically learns from user behavior over time to automate recurring workflows rather than relying on static scripts.

Compared to similar skills

continuous-learning-v2 side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
continuous-learning-v2 (this skill)102moReviewAdvanced
agent-factory89moReviewAdvanced
subagent-driven-development147moNo flagsAdvanced
agent-skill-creator42moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

agent-factory

alirezarezvani

Claude Code agent generation system that creates custom agents and sub-agents with enhanced YAML frontmatter, tool access patterns, and MCP integration support following proven production patterns

8109

subagent-driven-development

davila7

Use when executing implementation plans with independent tasks in the current session

1493

agent-skill-creator

FrancyJGLisboa

This enhanced skill should be used when the user asks to create an agent, automate a repetitive workflow, create a custom skill, or needs advanced agent creation capabilities. Activates with phrases like every day, daily I have to, I need to repeat, create agent for, automate workflow, create skill for, need to automate, turn process into agent. Supports single agents, multi-agent suites, transcript processing, template-based creation, and interactive configuration. Claude will use the enhanced protocol to research APIs, define analyses, structure everything, implement functional code, and create complete skills autonomously with optional user guidance.

441

vibe-build

KhazP

Build your MVP following the AGENTS.md plan. Use when the user wants to start building, implement features, or says "build my MVP", "start coding", or "implement the project".

45

swarm-coordination

joelhooks

Multi-agent coordination patterns for OpenCode swarm workflows. Use when work benefits from parallelization or coordination.

04

open-prose

openprose

OpenProse is a programming language for AI sessions. Activate on ANY `prose` command (prose boot, prose run, prose compile, prose update, etc.), running .prose files, mentioning OpenProse/Prose, or orchestrating multi-agent workflows. The skill intelligently interprets what the user wants.

12

Search skills

Search the agent skills registry