Show original
Enjoyed this article?
Use "Request tipping" to ask the author to set up tip receiving.

AI translation
自己増殖するエージェント環境
Enjoyed this article?
Use "Request tipping" to ask the author to set up tip receiving.
https://zenn.dev/bokuwalily/articles/self-growing-skills
Last time, I wrote Claude Codeの記憶を4層に分けた話. This time is a continuation—the story of having Claude Code itself find "reusable procedures" and accumulate them as skills.
After several months of operation, I now have 64 auto-generated skills accumulated in ~/.claude/skills/auto/. In this article, I'll write about the self-replicating design, mechanisms to prevent runaway generation, and the generation curve I've learned from operating it.
Claude Code is excellent, but when sessions end, it forgets "how did I work around this error before?" The fix for launchd's exit 78, the procedure for burning favicons with png-to-ico, how to trim Next.js RSC payloads—I was rebuilding these procedures I'd already solved from scratch every time.
I could manually add them to CLAUDE.md, but that becomes an operation where "I write when I notice," which doesn't sustain. So I changed my thinking: have Claude do the work of finding procedures itself.
I've split skill generation into two layers.
And a Curator (skill-curate.sh) runs weekly to periodically organize the accumulated skills. The key is separating generation and organization into different processes.
Here's what's written in CLAUDE.md (excerpt):
## スキル自己生成(auto-skills)
作業の中で再利用価値のある手順を見つけたら、頼まれなくても自分でスキル化する。
ただし乱造はしない。
### 生成トリガー(いずれか該当時のみ)
- 5回以上ツールを使う非自明なタスクを最後までやり切った
- エラー・行き止まりにぶつかった後、動く回避策を見つけた
- ユーザーにアプローチを修正された(同じ修正を繰り返さないため)
- 再利用できる手順・コマンド列・ワークフローを発見したThe key is "but don't generate recklessly" and narrowing triggers to 4 conditions. Without writing this, Claude will skillify everything and quickly become noise-filled.
Procedures missed during sessions are picked up from conversation logs by the nightly batch. skill-harvest.sh The pipeline looks like this:
claude -p is the headless launch mentioned in the previous article. It runs in the Max tier, so API key billing is zero.
Auto-generated skills are not placed in the same location as hand-written skills or bundled plugin skills. I push them into an isolated namespace at ~/.claude/skills/auto/. Two reasons:
This author: auto is the Curator's target judgment key, made mandatory in frontmatter.
---
name: <kebab-case>
description: <発火条件を具体的に>
author: auto # ← Curatorの対象判定キー。必須
created: <YYYY-MM-DD>
version: 1.0.0
status: active # active | stale(Curatorが自動設定)
---If generation runs unchecked, skills rot. Curator runs weekly like this:
Key Point
Not letting Curator auto-delete is the core of safe design. "Unused for 30 days" doesn't mean the skill is bad (just that we haven't done that task). So I keep it to demotion and retirement, leaving final judgment to humans.
Looking at the created: distribution, 28 skills were articulated all at once in the first 3 days (5/28–30), then dropped to a few per day afterward. This matches intuition—past "unarticulated procedures" are released early, then only newly encountered procedures get added.
12 created: 2026-05-30
9 created: 2026-05-29
7 created: 2026-06-09
6 created: 2026-06-11
5 created: 2026-06-10
5 created: 2026-05-28This morning's harvest log:
会話ログを精査した結果、以下の理由から該当なし。
- Codex CLI のセットアップ → codex-cli-setup が既存
- /insights を CLAUDE.md に反映 → insights-to-claude-md が既存
- カード債務の支払い優先順位 → 個人の財務状況に依存、再利用手順に非該当
該当なし
[2026-06-15 04:11:21] harvest done (exit 0, created=0)created=0. Filtered out duplicates with existing skills, filtered out one-off personal content, and completed normally with 0 generated. Evidence that the "don't generate recklessly" design can treat misses as "correct misses." If I generated carelessly here, 64 would quickly balloon to 200 and become noise.
From the actual Pitfalls sections of skills, the ones that worked:
You don't need the full pipeline. Just add 1 block to CLAUDE.md and Layer 1 works.
That's it—skills grow bit by bit with each task. Nightly batch and Curator can be added later when skills accumulate and you feel like "organizing."
Next time, I'll write about when these skills grew so much that Claude Code itself became heavy—**コンテキスト注入を228KBから48KBに削った監査**.
Lily (@bokuwalily)—Individual developer. Building automation infrastructure with Claude Code while mass-producing iOS apps and web services
◼︎Apps I've made are summarized at **ポートフォリオ**📱
◼︎New releases and development behind-the-scenes on X **@bokuwalily**🐦
◼︎OSS: **github.com/bokuwalily**🐙
Your ❤️ and shares are my motivation!
https://zenn.dev/bokuwalily/articles/self-growing-skills
前回、Claude Codeの記憶を4層に分けた話を書きました。今回はその続きで、Claude Code自身に「再利用できる手順」を見つけさせて、スキルとして書き溜めていく仕組みの話です。
数ヶ月運用した結果、いま ~/.claude/skills/auto/ には自動生成されたスキルが64個たまっています。この記事では、その自己増殖の設計・乱造を防ぐ仕掛け・運用して分かった生成曲線を書きます。
Claude Codeは優秀ですが、セッションを跨ぐと「前にこのエラーをどう回避したか」を忘れます。launchdのexit 78の直し方、png-to-icoでfaviconを焼く手順、Next.jsのRSCペイロードを削る方法 ―― こういう一度解いたはずの手順を、毎回ゼロから組み直していました。
CLAUDE.mdに手で書き足す手もありますが、それだと「気づいた自分が書く」運用になり、続きません。そこで発想を変えて、手順を見つける作業ごとClaudeにやらせることにしました。
スキルの生成を2つの層に分けています。
そして溜まったスキルを定期的に整理する Curator(skill-curate.sh)が週次で回ります。生成と整理を別プロセスに分けるのがポイントです。
CLAUDE.mdにこう書いてあります(抜粋)。
## スキル自己生成(auto-skills)
作業の中で再利用価値のある手順を見つけたら、頼まれなくても自分でスキル化する。
ただし乱造はしない。
### 生成トリガー(いずれか該当時のみ)
- 5回以上ツールを使う非自明なタスクを最後までやり切った
- エラー・行き止まりにぶつかった後、動く回避策を見つけた
- ユーザーにアプローチを修正された(同じ修正を繰り返さないため)
- 再利用できる手順・コマンド列・ワークフローを発見した肝は「ただし乱造はしない」と、トリガーを4つに絞っていることです。これを書かないと、Claudeは何でもかんでもスキル化して、すぐにノイズだらけになります。
セッション中に書きそびれた手順を、夜間バッチが会話ログから拾います。skill-harvest.sh のパイプラインはこうなっています。
claude -p は前回の記事で触れたヘッドレス起動です。Max枠で回るのでAPIキー課金はゼロ。
自動生成スキルは、手書きスキルやプラグイン同梱スキルと同じ場所に置きません。~/.claude/skills/auto/ という隔離名前空間に押し込めています。理由は2つ。
この author: auto がCuratorの対象判定キーで、frontmatterに必須にしています。
---
name: <kebab-case>
description: <発火条件を具体的に>
author: auto # ← Curatorの対象判定キー。必須
created: <YYYY-MM-DD>
version: 1.0.0
status: active # active | stale(Curatorが自動設定)
---生成しっぱなしだとスキルは腐ります。Curatorが週次でこう動きます。
ポイント
Curatorに自動削除をさせないのが安全設計の核です。「30日触ってない」はスキルが悪いとは限らない(その作業をしてないだけ)。だから降格と退避に留め、最終判断は人間に残します。
created: の分布を見ると、導入直後の3日(5/28〜30)で28個が一気に言語化され、その後は日に数個ペースに落ちました。これは直感に合います ―― 過去に溜めた「言語化されてない手順」が初期に放出され、その後は新しく出会った手順だけが追加されるからです。
12 created: 2026-05-30
9 created: 2026-05-29
7 created: 2026-06-09
6 created: 2026-06-11
5 created: 2026-06-10
5 created: 2026-05-28今朝のharvestログがこれです。
会話ログを精査した結果、以下の理由から該当なし。
- Codex CLI のセットアップ → codex-cli-setup が既存
- /insights を CLAUDE.md に反映 → insights-to-claude-md が既存
- カード債務の支払い優先順位 → 個人の財務状況に依存、再利用手順に非該当
該当なし
[2026-06-15 04:11:21] harvest done (exit 0, created=0)created=0。既存スキルとの重複を弾き、個人事情の一回限りの内容も弾いて、0個生成で正常終了しています。乱造しない設計が、空振りを「正しい空振り」として処理できている証拠です。ここでむやみに生成してしまうと、64個がすぐ200個に膨れてノイズ化します。
実際のスキルの Pitfalls 節から、効いたものを。
フルパイプラインはいりません。CLAUDE.mdに1ブロック足すだけで層1は動きます。
これだけで、作業のたびにスキルが少しずつ増えます。夜間バッチとCuratorは、スキルが溜まって「整理したい」と感じてから足せば間に合います。
次回は、このスキルが増えすぎてClaude Code自体が重くなった話 ―― **コンテキスト注入を228KBから48KBに削った監査**を書きます。
Lily(@bokuwalily)― 個人開発者。Claude Code で自動化基盤を組みながら、iOSアプリやWebサービスを量産しています
◼︎作ったアプリは **ポートフォリオ** にまとめています📱
◼︎新着・開発の裏側は X **@bokuwalily** で発信しています🐦
◼︎OSS: **github.com/bokuwalily**🐙
皆さんの ❤️ やシェアが励みになります!