continuous-learning
它能做什么
这项技能会在 Claude Code 会话结束时运行,并把其中可复用的模式保存为已学习的技能。适合希望 AI 助手能在不同会话之间记住修复方法和约定的开发者。
适用场景
- ✓当你希望把某次会话中有用的修复方法和变通方法保存下来以备后用的时候。
- ✓当你希望在一次长会话结束时自动记录项目专属约定的时候。
- ✓当你想设置一个会话结束时运行的钩子,用来回顾你的工作的时候。
技能链接
https://github.com/WorldFlowAI/everything-claude-code/blob/main/skills/continuous-learning/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我设置一个钩子,让每次较长的 Claude Code 会话结束时,有用的修复方法和项目约定都能保存为技能。”
每周 5 个新技能,1 分钟读完。
工作原理
停止钩子会先检查会话是否足够长,然后识别错误解决、用户纠正等模式,并把其中有用的部分保存到已学习技能的文件夹中。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Continuous Learning Skill
Automatically evaluates Claude Code sessions on end to extract reusable patterns that can be saved as learned skills.
How 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/
Configuration
Edit config.json to customize:
{
"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 |
|---|---|
error_resolution |
How specific errors were resolved |
user_corrections |
Patterns from user corrections |
workarounds |
Solutions to framework/library quirks |
debugging_techniques |
Effective debugging approaches |
project_specific |
Project-specific conventions |
Hook Setup
Add to your ~/.claude/settings.json:
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
}]
}]
}
}
Why Stop Hook?
- 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
/learncommand - Manual pattern extraction mid-session
常见问题
保存的模式会自动应用吗?
它们会被保存为已学习的技能,供以后使用。设置文件决定要识别哪些模式,以及是否自动批准。
我可以限制保存的内容吗?
可以。配置文件允许你设置最短会话时长、提取阈值以及要忽略的模式。
已学习的技能保存在哪里?
默认保存在你的 Claude 配置目录下的已学习技能文件夹中。
详情
作者的原始描述
Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.
热度
- GitHub 星标
- 5.8k
- 排名
- #14662
- 许可证
- —
- 更新时间
- 2026/1/23
评论
- …