continuous-learning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContinuous Learning Skill - DEPRECATED
持续学习技能 - 已废弃
DEPRECATED 2026-04-28. Useinstead. v2 is a strict superset: stop-hook observation becomes PreToolUse/PostToolUse observation, full skills become atomic instincts with confidence scoring, and global-only storage becomes project-scoped plus global promotion.continuous-learning-v2This file is kept for archival reference and backward compatibility with existing installs.
已废弃 2026-04-28。 请改用。v2是严格的超集:停止钩子观测变为PreToolUse/PostToolUse观测,完整技能变为带有置信度评分的原子本能,仅全局存储变为项目范围存储加全局推广。continuous-learning-v2保留此文件仅用于存档参考和与现有安装的向后兼容。
Original v1 Documentation (archival)
原始v1文档(存档)
Automatically evaluates Claude Code sessions on end to extract reusable patterns that can be saved as learned skills.
自动评估Claude Code会话结束时的内容,提取可复用的模式并保存为已学习技能。
When to Activate
激活场景
- Setting up automatic pattern extraction from Claude Code sessions
- Configuring the Stop hook for session evaluation
- Reviewing or curating learned skills in
~/.claude/skills/learned/ - Adjusting extraction thresholds or pattern categories
- Comparing v1 (this) vs v2 (instinct-based) approaches
- 从Claude Code会话中设置自动模式提取
- 配置用于会话评估的Stop钩子
- 查看或管理中的已学习技能
~/.claude/skills/learned/ - 调整提取阈值或模式类别
- 对比v1(本版本)与v2(基于本能)的实现方式
Status
状态
This v1 skill is still supported, but is the preferred path for new installs. Keep v1 when you explicitly want the simpler Stop-hook extraction flow or need compatibility with older learned-skill workflows.
continuous-learning-v2此v1技能仍受支持,但是新安装的首选方案。当您明确需要更简单的停止钩子提取流程,或需要与旧版已学习技能工作流兼容时,可保留v1。
continuous-learning-v2How It Works
工作原理
This skill runs as a Stop hook at the end of each session:
- Session Evaluation: Checks if session has enough messages (default: 10+)
- Pattern Detection: Identifies extractable patterns from the session
- Skill Extraction: Saves useful patterns to
~/.claude/skills/learned/
该技能作为Stop钩子在每个会话结束时运行:
- 会话评估:检查会话是否包含足够数量的消息(默认:10条以上)
- 模式检测:从会话中识别可提取的模式
- 技能提取:将有用的模式保存到
~/.claude/skills/learned/
Configuration
配置
Edit to customize:
config.jsonjson
{
"min_session_length": 10,
"extraction_threshold": "medium",
"auto_approve": false,
"learned_skills_path": "~/.claude/skills/learned/",
"patterns_to_detect": [
"error_resolution",
"user_corrections",
"workarounds",
"debugging_techniques",
"project_specific"
],
"ignore_patterns": [
"simple_typos",
"one_time_fixes",
"external_api_issues"
]
}编辑进行自定义:
config.jsonjson
{
"min_session_length": 10,
"extraction_threshold": "medium",
"auto_approve": false,
"learned_skills_path": "~/.claude/skills/learned/",
"patterns_to_detect": [
"error_resolution",
"user_corrections",
"workarounds",
"debugging_techniques",
"project_specific"
],
"ignore_patterns": [
"simple_typos",
"one_time_fixes",
"external_api_issues"
]
}Pattern Types
模式类型
| Pattern | Description |
|---|---|
| How specific errors were resolved |
| Patterns from user corrections |
| Solutions to framework/library quirks |
| Effective debugging approaches |
| Project-specific conventions |
| 模式 | 描述 |
|---|---|
| 特定错误的解决方法 |
| 来自用户修正的模式 |
| 框架/库特性问题的解决方案 |
| 有效的调试方法 |
| 项目特定的约定 |
Hook Setup
钩子设置
Add to your :
~/.claude/settings.jsonjson
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
}]
}]
}
}添加到您的:
~/.claude/settings.jsonjson
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
}]
}]
}
}Why Stop Hook?
为何选择Stop钩子?
- Lightweight: Runs once at session end
- Non-blocking: Doesn't add latency to every message
- Complete context: Has access to full session transcript
- 轻量:仅在会话结束时运行一次
- 非阻塞:不会增加每条消息的延迟
- 完整上下文:可访问完整的会话记录
Related
相关资源
- The Longform Guide - Section on continuous learning
- command - Manual pattern extraction mid-session
/learn
- 长篇指南 - 持续学习章节
- 命令 - 会话中途手动提取模式
/learn
Comparison Notes (Research: Jan 2025)
对比说明(研究:2025年1月)
vs Homunculus
与Homunculus对比
Homunculus v2 takes a more sophisticated approach:
| Feature | Our Approach | Homunculus v2 |
|---|---|---|
| Observation | Stop hook (end of session) | PreToolUse/PostToolUse hooks (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 instincts |
Key insight from homunculus:
"v1 relied on skills to observe. Skills are probabilistic—they fire ~50-80% of the time. v2 uses hooks for observation (100% reliable) and instincts as the atomic unit of learned behavior."
Homunculus v2采用更复杂的方法:
| 特性 | 我们的方案 | Homunculus v2 |
|---|---|---|
| 观测方式 | Stop钩子(会话结束时) | PreToolUse/PostToolUse钩子(100%可靠) |
| 分析方式 | 主上下文 | 后台Agent(Haiku) |
| 粒度 | 完整技能 | 原子化“本能” |
| 置信度 | 无 | 0.3-0.9加权评分 |
| 演化路径 | 直接生成技能 | 本能 → 聚类 → 技能/命令/Agent |
| 共享功能 | 无 | 导出/导入本能 |
来自Homunculus的关键见解:
"v1依赖技能进行观测。技能是概率性的——触发率约为50-80%。v2使用钩子进行观测(100%可靠),并将本能作为学习行为的原子单元。"
Potential v2 Enhancements
v2潜在增强点
- Instinct-based learning - Smaller, atomic behaviors with confidence scoring
- Background observer - Haiku agent analyzing in parallel
- Confidence decay - Instincts lose confidence if contradicted
- Domain tagging - code-style, testing, git, debugging, etc.
- Evolution path - Cluster related instincts into skills/commands
See: for full spec.
docs/continuous-learning-v2-spec.md- 基于本能的学习 - 更小的原子化行为,带有置信度评分
- 后台观测器 - Haiku Agent并行分析
- 置信度衰减 - 若本能被反驳,其置信度会降低
- 领域标记 - 代码风格、测试、Git、调试等
- 演化路径 - 将相关本能聚类为技能/命令
详情请见:完整规范。
docs/continuous-learning-v2-spec.md