Continuous Learning V2 logo

Continuous Learning V2

CommunityPopular
xu-xiang
continuous-learning-v2

基于本能的学习系统,通过钩子观察会话,创建具有置信度评分的原子本能,并将其进化为技能/命令/代理。

Overview

Publisherxu-xiang
Repositoryeverything-claude-code-zh
Skill namecontinuous-learning-v2
Stars
1.9K
Forks
318
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xu-xiang on GitHub. Read the source before you install it.

Installation

Install the Continuous Learning V2 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh.git /tmp/everything-claude-code-zh
mkdir -p .claude/skills
cp -r /tmp/everything-claude-code-zh/docs/zh-CN/skills/continuous-learning-v2 .claude/skills/continuous-learning-v2
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Continuous Learning V2 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Continuous Learning V2 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Continuous Learning V2 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

持续学习 v2 - 基于本能的架构

一个高级学习系统,通过原子化的“本能”——带有置信度评分的小型习得行为——将你的 Claude Code 会话转化为可重用的知识。

部分灵感来源于 humanplane (credit: @humanplane) 的 Homunculus 项目。

何时激活

  • 设置从 Claude Code 会话中自动学习时
  • 通过钩子配置基于本能的行为提取时
  • 调整学习行为的置信度阈值时
  • 审查、导出或导入本能库时
  • 将本能进化为完整技能、命令或代理时

v2 的新特性

特性v1v2
观察停止钩子(会话结束)工具使用前/后(100% 可靠)
分析主上下文后台代理(Haiku)
粒度完整技能原子化的“本能”
置信度0.3-0.9 加权
演进直接到技能本能 → 聚类 → 技能/命令/代理
共享导出/导入本能

本能模型

一个本能是一个小型习得行为:

yaml
---
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

属性:

  • 原子性 — 一个触发条件,一个动作
  • 置信度加权 — 0.3 = 尝试性的,0.9 = 近乎确定
  • 领域标记 — 代码风格、测试、git、调试、工作流等
  • 证据支持 — 追踪是哪些观察创建了它

工作原理

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       │
└─────────────────────────────────────────┘

快速开始

1. 启用观察钩子

添加到你的 ~/.claude/settings.json 中。

如果作为插件安装(推荐):

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"
      }]
    }]
  }
}

如果手动安装~/.claude/skills

json
{
  "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"
      }]
    }]
  }
}

2. 初始化目录结构

Python CLI 会自动创建这些目录,但你也可以手动创建:

bash
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}}
touch ~/.claude/homunculus/observations.jsonl

3. 使用本能命令

bash
/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

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/"
  }
}

文件结构

~/.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

与技能创建器的集成

当你使用 技能创建器 GitHub 应用 时,它现在会生成两者

  • 传统的 SKILL.md 文件(用于向后兼容)
  • 本能集合(用于 v2 学习系统)

来自仓库分析的本能带有 source: "repo-analysis" 标记,并包含源仓库 URL。

置信度评分

置信度随时间演变:

分数含义行为
0.3尝试性的建议但不强制执行
0.5中等的相关时应用
0.7强烈的自动批准应用
0.9近乎确定的核心行为

置信度增加当:

  • 模式被反复观察到
  • 用户未纠正建议的行为
  • 来自其他来源的相似本能一致

置信度降低当:

  • 用户明确纠正该行为
  • 长时间未观察到该模式
  • 出现矛盾证据

为什么用钩子而非技能进行观察?

“v1 依赖技能进行观察。技能是概率性的——它们基于 Claude 的判断,大约有 50-80% 的概率触发。”

钩子100% 触发,是确定性的。这意味着:

  • 每次工具调用都被观察到
  • 不会错过任何模式
  • 学习是全面的

向后兼容性

v2 与 v1 完全兼容:

  • 现有的 ~/.claude/skills/learned/ 技能仍然有效
  • 停止钩子仍然运行(但现在也输入到 v2)
  • 渐进式迁移路径:并行运行两者

隐私

  • 观察数据保留在你的本地机器上
  • 只有本能(模式)可以被导出
  • 不会共享实际的代码或对话内容
  • 你控制导出的内容

相关链接

  • 技能创建器 - 从仓库历史生成本能
  • Homunculus - 启发了 v2 基于本能的架构的社区项目(原子观察、置信度评分、本能进化管道)
  • 长篇指南 - 持续学习部分

基于本能的学习:一次一个观察,教会 Claude 你的模式。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Continuous Learning V2 AI skill do?

基于本能的学习系统,通过钩子观察会话,创建具有置信度评分的原子本能,并将其进化为技能/命令/代理。

Why use Continuous Learning V2 on TypingMind?

Because you install it once and use it with any model. Continuous Learning V2 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Continuous Learning V2 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xu-xiang/everything-claude-code-zh/tree/main/docs/zh-CN/skills/continuous-learning-v2. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Continuous Learning V2?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Continuous Learning V2?

As many as you like. As long as a model supports skills, you can use Continuous Learning V2 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Continuous Learning V2 AI skill free?

Yes. It is published on GitHub by xu-xiang under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇