Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.
在会话结束时自动评估 Claude Code 会话(Sessions),以提取可保存为学习技能(Learned Skills)的可重用模式。
该技能作为 停止钩子(Stop hook) 在每个会话结束时运行:
~/.claude/skills/learned/编辑 config.json 进行自定义:
{
"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) | 描述(Description) |
|---------|-------------|
| error_resolution | 特定错误的解决方式 |
| user_corrections | 来自用户修正的模式 |
| workarounds | 框架/库特有问题的变通方案 |
| debugging_techniques | 有效的调试方法 |
| project_specific | 项目特定的约定 |
添加到你的 ~/.claude/settings.json:
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
}]
}]
}
}
/learn 命令 - 在会话中手动提取模式Homunculus v2 采用了更复杂的方法:
| 特性(Feature) | 我们的方法(Our Approach) | Homunculus v2 | |---------|--------------|---------------| | 观测(Observation) | 停止钩子(Stop hook,会话结束时) | PreToolUse/PostToolUse 钩子(100% 可靠) | | 分析(Analysis) | 主上下文(Main context) | 后台智能体(Background agent,Haiku) | | 粒度(Granularity) | 完整技能(Full skills) | 原子化的“本能(instincts)” | | 置信度(Confidence) | 无 | 0.3-0.9 加权 | | 演进(Evolution) | 直接转化为技能 | 本能(Instincts)→ 聚类(cluster)→ 技能/命令/智能体 | | 共享(Sharing) | 无 | 导出/导入本能 |
来自 homunculus 的关键洞察:
“v1 依赖技能进行观测。技能是概率性的——它们的触发率约为 50-80%。v2 使用钩子进行观测(100% 可靠),并将本能(instincts)作为学习行为的原子单位。”
参见:/Users/affoon/Documents/tasks/12-continuous-learning-v2.md 以获取完整规范。
npx skills add codelably/continuous-learning下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer