self-optimize

self-optimize is a skill for Claude Code from Kit4Some/Oh-my-ClaudeClaw. It costs 115 tokens per session (2,037 once invoked), scanned A, original, MIT.

An automated process for examining how an AI coding system performs and improving its instructions and workflows based on errors and successful results.

In plain words
What is it for?
Use it to review recent errors and successes, refine skill instructions or hooks, test the changes, and roll them back when they do not improve results.
Why use it?
It helps find repeated failure patterns and adjust the system instead of leaving the same problems to recur.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; built for openclaw.

Part of the openclaw-cc plugin — 22 skills, 4 agents, 5 MCP servers shipped together

Good fit Use it to review recent errors and successes, refine skill instructions or hooks, test the changes, and roll them back when they do not improve results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kit4some/oh-my-claudeclaw/self-optimize
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.

Any agent
npx skills add Kit4Some/Oh-my-ClaudeClaw --skill self-optimize
Clone the repo
git clone --depth 1 https://github.com/Kit4Some/Oh-my-ClaudeClaw

Made for: Claude Code.

Or install openclaw-cc, the plugin that ships this one along with the rest of its 22 skills, 4 agents, 5 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for self-optimize

README.md
[![agentmods](https://agentmods.dev/badge/skills/kit4some/oh-my-claudeclaw/self-optimize.svg)](https://agentmods.dev/skills/kit4some/oh-my-claudeclaw/self-optimize)
Your own site
<a href="https://agentmods.dev/skills/kit4some/oh-my-claudeclaw/self-optimize"><img src="https://agentmods.dev/badge/skills/kit4some/oh-my-claudeclaw/self-optimize.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,037 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00115 $0.02037
Opus 5 $0.00057 $0.01019
Sonnet 5 $0.00023 $0.00407
Haiku 4.5 $0.00012 $0.00204

Measured 7d ago against content hash eab2113bb4fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

self-optimize scanned grade A with 0 findings 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 7d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/self-optimize/SKILL.md · 239 lines

How it starts

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

Self-Optimize — Autonomous System Evolution Engine

Role

Continuously improve the OpenClaw-CC system by analyzing its own performance, identifying failure patterns, and modifying skill prompts, hooks, and workflows to reduce errors and increase success rates. This is a closed-loop optimization cycle: measure → analyze → modify → verify → commit or rollback.

Safety Boundaries

NEVER modify:

  • mcp-servers/ — MCP 서버 코드는 손대지 않음 (테스트 깨짐 위험)
  • .mcp.json — 서버 설정 변경 금지
  • memory-store/_memory.db — DB 직접 조작 금지

CAN modify:

  • skills/*/SKILL.md — 스킬 프롬프트 개선
  • scripts/hooks/*.mjs — 훅 로직 개선
  • .claude/agents/*.md — 에이전트 프롬프트 개선
  • CLAUDE.md — 시스템 지시문 미세 조정 (구조 변경 금지, 문구 개선만)

Guardrails:

  • 한 사이클에 최대 3개 파일만 수정
  • 수정 전 반드시 git stash or branch 생성 (롤백 포인트)
  • 수정 후 기존 테스트 실행 — 1개라도 실패 시 즉시 롤백
  • 메신저로 변경 사항 보고 — 사용자 확인 후 main에 반영
  • 1주일 후 성과 비교 — 개선 없으면 자동 롤백

7-Step Optimization Cycle

Step 1 — Performance Data Collection

memory_search(tag: "error", limit: 50)       → 최근 에러 로그
memory_search(tag: "done", limit: 50)         → 최근 성공 로그
memory_search(tag: "bug", limit: 20)          → 버그 이력
memory_search_date(start_date: "{7d_ago}")    → 이번 주 전체 활동
memory_stats                                  → 전체 시스템 통계

Step 2 — Failure Pattern Analysis

각 실패를 분류:

실패 유형 원인 분석 개선 대상
Skill 실행 실패 프롬프트 불명확, 도구 매핑 오류 SKILL.md
에이전트 위임 실패 컨텍스트 부족, 잘못된 에이전트 선택 agent .md 또는 SKILL.md
메모리 검색 미스 태그/카테고리 불일치, 인덱스 부재 hook 또는 memory-ops
Hook 타임아웃 처리 시간 초과, 무거운 로직 hook .mjs
잘못된 결과 프롬프트 모호성, 검증 부재 SKILL.md

결과를 구조화:

## Failure Report — Week of {date}

### Top Failure Patterns
1. **{skill_name}**: {failure_count}회 실패
   - 공통 원인: {root_cause}
   - 영향받은 워크플로우: {workflows}
   - 제안 수정: {proposed_fix}

2. **{skill_name}**: ...

Step 3 — Improvement Hypothesis

각 실패 패턴에 대해 구체적 가설 수립:

### Hypothesis #{n}
- **문제**: {skill}이 {situation}에서 {failure_mode}
- **원인**: 프롬프트의 {section}이 {reason}
- **수정안**: "{old_text}" → "{new_text}"
- **예상 효과**: {failure_type} {X}% 감소
- **검증 방법**: {how_to_measure}

Read the full file on GitHub · 239 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. 7d ago First seen · 239 lines · 115 tokens per session scan A eab2113bb4fb

Subscribe to this mod's changes

self-optimize is a skill published in the GitHub repository Kit4Some/Oh-my-ClaudeClaw (4 stars, last pushed 5mo ago), licensed MIT. It adds 115 tokens to every session and 2,037 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ready

From any input — a natural-language goal, existing docs (spec / plan / brain-dump), notes, or a mix — interactively elicit and validate intent and produce an execution-ready 3-doc (handoff, spec, plan) for go, replacing third-party brainstorming + planning in one skill. Input format is open; the input is material, not…

fn-opt/dryforge · 92 tokens

messaging

Set up a messaging channel (WhatsApp, Telegram, Discord, iMessage, Slack) to reach this agent from outside Claude Code. Triggers on /agent:messaging, "configurar whatsapp", "setup messaging", "conectar telegram", "agregar canal".

crisandrews/ClawCode · 58 tokens

voice

Voice — text-to-speech and transcription. Triggers on /agent:voice, /agent:voice status, /agent:voice setup, /agent:voice test, "configurar voz", "prueba voz", "voice setup", "speak this", "read this aloud", "transcribe audio".

crisandrews/ClawCode · 66 tokens

new

Start a new session — save summary to memory, then mark as reset so next message gets a fresh greeting. OpenClaw-compatible. Triggers on /new, /reset, /agent:new, "nueva sesión", "new session", "reset".

crisandrews/ClawCode · 54 tokens

compact

Flush important session context to daily log (manual memory flush). Does NOT invoke native /compact. Triggers on /compact, /agent:compact, /flush, "guarda memoria", "flush".

crisandrews/ClawCode · 43 tokens

status

Show agent runtime status — identity, model, context, memory, crons, voice. Works from CLI or messaging. Triggers on /status, /agent:status, "status del agente", "cómo estás técnicamente".

crisandrews/ClawCode · 48 tokens