# self-improving-agent

self-improving-agent — a skill for Claude Code, Codex, and Cursor that curates long-term agent memory. Converts repeated task outcomes into reviewed project rules.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 244 installs · ★ 1183 repo stars
- Author: borghei
- License: LicenseRef-MIT-Commons-Clause · policy=link-only · description only; the file stays with the author
- Source: https://github.com/borghei/Claude-Skills/tree/HEAD/engineering/self-improving-agent/SKILL.md
- Updated: 2026-11-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/borghei-self-improving-agent

## What it does

Runs across Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. It monitors outcomes across development sessions, structures takeaways, and detects repeated patterns via `pattern_extractor.py` and `feedback_analyzer.py`.

The improvement cycle separates recording learnings, isolating recurring patterns, proposing rule updates, and auditing memory hygiene. Promoting an entry into `CLAUDE.md` or `.claude/rules/` is strictly gated: `rule_promoter.py` tests recurrence criteria and waits for manual user approval before altering configuration.

Running the included tools requires Python 3. The `rule_promoter.py` script applies automated edits exclusively to section-based `MEMORY.md` files; index-based layouts pointing to standalone topic files require manual promotion.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill self-improving-agent -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/self-improving-agent/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/self-improving-agent/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill self-improving-agent -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/self-improving-agent/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill self-improving-agent -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/self-improving-agent/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install borghei/Claude-Skills engineering/self-improving-agent/SKILL.md
```

2. **Manually: put the files in place**
- File: `.github/skills/self-improving-agent/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill self-improving-agent -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/borghei/Claude-Skills --path engineering/self-improving-agent
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/self-improving-agent/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill self-improving-agent -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/borghei/Claude-Skills/tree/HEAD/engineering/self-improving-agent/SKILL.md

## When to use it
- detect broken topic pointers and line bloat in MEMORY.md
- isolate recurring failure patterns from session logs
- stage verified guidelines before editing CLAUDE.md
- measure performance drops after updating rules

## Example prompts
- Run a health audit on `./MEMORY.md`
- Extract recurring error patterns from `sessions.jsonl`
- Review promotion candidates for project rules

## Similar
- [evo-memory](https://affpapa.org/en/nevibecode/skills/evo-memory.md) — skill · 401 installs
- [self-improvement](https://affpapa.org/en/nevibecode/skills/self-improvement.md) — skill · 2100 installs
- [self-learning](https://affpapa.org/en/nevibecode/skills/kulaxyz-self-learning.md) — skill · 889 installs
- [self-reflection](https://affpapa.org/en/nevibecode/skills/self-reflection.md) — skill · 162 installs
- [claude-self-reflect](https://affpapa.org/en/nevibecode/plugins/claude-self-reflect.md) — plugin · ★ 231 repo stars
- [thinking-systems](https://affpapa.org/en/nevibecode/skills/thinking-systems.md) — skill · 708 installs

## Other versions with the same name
- [self-improving-agent · alirezarezvani](https://affpapa.org/en/nevibecode/skills/self-improving-agent.md) — 1078 installs
- [self-improving-agent · zhaono1](https://affpapa.org/en/nevibecode/skills/zhaono1-self-improving-agent.md) — 35900 installs
- [self-improving-agent · pskoett](https://affpapa.org/en/nevibecode/skills/pskoett-self-improving-agent.md) — 408 installs
- [self-improving-agent · grail-computer](https://affpapa.org/en/nevibecode/skills/grail-computer-self-improving-agent.md) — 520 installs
- [self-improving-agent · jdrhyne](https://affpapa.org/en/nevibecode/skills/jdrhyne-self-improving-agent.md) — ★ 239 repo stars

From the same set: [borghei/claude-skills](https://affpapa.org/en/nevibecode/by/borghei/claude-skills.md) — 120 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
