continuous-learning

A session-ending process that reviews a Claude Code conversation and saves reusable solutions as learned skills. It looks for patterns such as error fixes, debugging methods, workarounds, user corrections, and project-specific practices.

In plain words
What is it for?
Use it to evaluate longer sessions, extract repeatable fixes and techniques, and store them in a learned-skills folder according to configurable rules.
Why use it?
Useful discoveries from one coding session can otherwise be lost. Saving approved patterns creates a growing reference for future work without adding checks to every message.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/luohaothu/everything-codex/continuous-learning
Any agent
npx skills add Luohaothu/everything-codex --skill continuous-learning
Clone the repo
git clone --depth 1 https://github.com/Luohaothu/everything-codex

Made for: Claude Code, Codex.

Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 981 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.00981
Opus 5 $0.00014 $0.00491
Sonnet 5 $0.00005 $0.00196
Haiku 4.5 $0.00003 $0.00098

Measured 2d ago against content hash 9a8536fc1bba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

continuous-learning scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

添加到你的 `~/.claude/settings.json` 中:
docs/zh-CN/skills/continuous-learning/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

持续学习技能

自动评估 Claude Code 会话的结尾,以提取可重用的模式,这些模式可以保存为学习到的技能。

工作原理

此技能作为 停止钩子 在每个会话结束时运行:

  1. 会话评估:检查会话是否包含足够多的消息(默认:10 条以上)
  2. 模式检测:从会话中识别可提取的模式
  3. 技能提取:将有用的模式保存到 ~/.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"
  ]
}

模式类型

模式 描述
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 命令 - 在会话中手动提取模式

对比说明(研究:2025年1月)

与 Homunculus (github.com/humanplane/homunculus) 对比

Homunculus v2 采用了更复杂的方法:

功能 我们的方法 Homunculus v2
观察 停止钩子(会话结束时) PreToolUse/PostToolUse 钩子(100% 可靠)
分析 主上下文 后台代理 (Haiku)
粒度 完整技能 原子化的“本能”
置信度 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

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 112 lines · 27 tokens per session scan B 9a8536fc1bba

Subscribe to this mod's changes

continuous-learning is a skill published in the GitHub repository Luohaothu/everything-codex (24 stars, last pushed 21d ago), licensed MIT. It adds 27 tokens to every session and 981 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens