Skip to content
cccskills
FreePublished on GitHub

continuous-learning

自动从 Claude Code 会话(Session)中提取可重用的模式(Pattern),并将其作为已学习的技能(Skill)保存以备将来使用。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

持续学习技能(Continuous Learning Skill)

Claude Code 会话结束时自动进行评估,提取可作为已学习技能保存的可重用模式(Pattern)。

工作原理(How it Works)

此技能在每个会话结束时作为 Stop 钩子(Hook) 执行:

  1. 会话评估:检查会话是否有足够的消息(默认:10 条以上)
  2. 模式检测:识别可从会话中提取的模式
  3. 技能提取:将有用的模式保存到 ~/.claude/skills/learned/

配置(Configuration)

通过编辑 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 Types)

模式描述
error_resolution特定错误的解决方法
user_corrections来自用户修正的模式
workarounds针对框架/库特性的解决方案
debugging_techniques有效的调试方法(Debugging Approaches)
project_specific项目特定的约定

钩子配置(Hook Configuration)

添加到 ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
      }]
    }]
  }
}

为什么使用 Stop 钩子

  • 轻量:仅在会话(Session)结束时执行一次
  • 非阻塞:不会给每条消息增加延迟(Latency)
  • 完整上下文:可以访问整个会话的转录内容

相关项目

  • The Longform Guide - 关于持续学习的部分
  • /learn 命令 - 会话中的手动模式提取

对比笔记(调查:2025年1月)

vs Homunculus

Homunculus v2 采用了更精细的方法:

功能当前方法Homunculus v2
观察Stop 钩子 (会话结束时)PreToolUse/PostToolUse 钩子 (100% 可靠性)
分析主上下文 (Main Context)后台智能体 (Background Agent, Haiku)
粒度完整的技能原子级的“本能 (Instinct)”
置信度无0.3-0.9 的权重分配
演进直接转换为技能本能 → 集群 → 技能/命令/智能体
共享无本能的导出/导入

homunculus 的重要洞察:

"v1 依赖技能进行观察。技能是概率性的,触发率约为 50-80%。v2 使用钩子(100% 可靠性)进行观察,并使用本能作为学习行为的原子单位。"

v2 的潜在改进

  1. 基于本能的学习 - 具有置信度评分的更小、原子级的行为
  2. 后台观察者 - 并行分析的 Haiku 智能体
  3. 置信度衰减 - 在发生冲突时降低本能的置信度
  4. 领域标签 - 代码风格、测试、git、调试等
  5. 演进路径 - 将相关的本能聚类为技能/命令/智能体

详细信息:请参阅 /Users/affoon/Documents/tasks/12-continuous-learning-v2.md。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

生产级 API 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

REST API设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和生产API的速率限制。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

撰写文章、指南、博客、教程、时事通讯等长篇内容,并根据提供的示例或品牌指南呈现独特的语言风格。当用户需要篇幅超过一段的精炼文字,且重视风格一致性、结构和可信度时,请使用此技能。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

编写文章、指南、博客、教程、时事通讯(Newsletter)等长内容,支持从示例或品牌指南中提取独特的语感语调。适用于需要撰写超过一个段落的精炼文本,尤其是对语气一致性、结构和可信度有较高要求时。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

根据提供的示例或品牌指导,以独特的语气撰写文章、指南、博客帖子、教程、新闻简报等长篇内容。当用户需要超过一段的精致书面内容时使用,尤其是当语气一致性、结构和可信度至关重要时。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

编写文章、指南、博客帖子、教程、新闻通讯(newsletter)以及其他长篇内容。这些内容具有从提供的示例或品牌指南中提取出的独特语气。当用户需要比段落更长的精美文案,且对语气一致性、结构和可信度有要求时,请使用此技能(Skill)。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

See all skills by xu-xiang

Report a problem with this skill