Self-Improving Agent skill

self-improving-agent

Skill for OpenClaw: the agent logs errors, corrections and missing features to .learnings files and promotes verified lessons into workspace memory

  • 782 ★ on the repository
  • Last commit
Skill

Extended access

Why this level

  • The agent appends to files in .learnings and, with your consent, promotes lessons into SOUL.md, TOOLS.md and AGENTS.md, which shape future sessions
  • The optional hook reads transcripts of finished sessions, which may hold commands and fragments of other people's data
All reasons and checks

pskoett/self-improving-agent

Install

Works in

Manual install

openclaw skills install @pskoett/self-improving-agent

OpenClaw's built-in installer puts the skill into the active workspace.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The agent appends to files in .learnings and, with your consent, promotes lessons into SOUL.md, TOOLS.md and AGENTS.md, which shape future sessions
  • The optional hook reads transcripts of finished sessions, which may hold commands and fragments of other people's data

This is third-party code. Review the repository files before installing.

What it does

Self-Improving Agent is a skill for OpenClaw that makes the agent keep a log of its own mistakes and lessons. When a command fails, the user corrects the agent, a feature is missing or knowledge is outdated, the agent appends an entry to one of three files in a .learnings folder: LEARNINGS.md, ERRORS.md or FEATURE_REQUESTS.md. Each entry gets an id like LRN-20250115-001 and a status from pending to resolved, and learnings fall into the categories correction, insight, knowledge_gap and best_practice. If the folder is missing, the agent creates it with empty files and never overwrites existing ones. A lesson that proves broadly useful is offered for promotion into OpenClaw workspace files: tool tips into TOOLS.md, workflows into AGENTS.md, behavior rules into SOUL.md. Every entry carries a maintenance block: what is claimed, where it applies, how it was verified and when to review it. Staleness is judged by cause, not by the age of the entry: facts about the environment, team decisions, dependencies and relevance are revalidated in different ways. An optional hook reminds the agent about the log at session start, and after a session ends it scans the transcript for error patterns and adds them to ERRORS.md as pending triage. The extract-skill.sh script in the scripts folder builds a new skill from a log entry.

Who it is for. For OpenClaw users who want the agent to accumulate experience across sessions, and for people who review those logs and move the conclusions into permanent instructions.

Good fit when

  • The agent keeps repeating the same command mistake and you want it recorded in a log and in tool notes
  • You correct the agent often and the corrections should move into SOUL.md or AGENTS.md instead of vanishing after the session
  • You want requests for capabilities the agent lacked collected in a separate file
  • Before a big task the agent should review saved lessons and check that they still hold

Not a fit when

  • You work in Claude Code, Codex or GitHub Copilot: this version is for OpenClaw only, and the multi-agent one lives in the pskoett-ai-skills repository
  • You need errors captured automatically during a session: OpenClaw has no per-tool-call event, and the hook scans the transcript only after the session
  • You need hosted memory or search over it as a service: the skill keeps plain Markdown files with no database
  • The log cannot live in the project, for example because logs contain third-party code: the files sit next to your work and reach git unless excluded

Example request

The build command failed again because of a wrong path. Log it in the errors file and check whether such a lesson already exists so we do not add a duplicate

Limitations

The author did not specify a license, so rights to use and copy are undefined; check with the author.

The skill is built only for OpenClaw, and its SKILL.md version is 4.0.2. The repository is described as a remake of the original multi-agent project.

The OpenClaw hook cannot see tool calls one by one, so it finds errors only in the transcript of a finished session, and only when a .learnings folder already exists. Hook changes take effect after re-copying and a gateway restart.

The skill does not update itself or other files on its own: creating and editing skills needs separate user permission. If a needed edit is outside the granted rights, the agent records it in the entry as pending.

The log should not contain secrets, tokens or full configs, but only the agent itself enforces that, and sharing entries between sessions through the sessions_* tools happens only when the user asks.

How to disable. Disable the hook with `openclaw hooks disable self-improvement` and restart the gateway. To remove the skill completely, delete the hook and skill folders following references/uninstall.md. Review the .learnings folder first: it holds your entries and no skill code. Anything promoted into SOUL.md, TOOLS.md and AGENTS.md is removed separately.

FAQ

Does self-improving-agent work in Claude Code or Codex?

No, this version is made for OpenClaw only. For Claude Code, Codex and GitHub Copilot the author points to the original multi-agent skill in the pskoett-ai-skills repository, folder skills/self-improvement.

Where does the skill keep its error and lesson records?

In a .learnings folder in the workspace or project: errors in ERRORS.md, corrections and knowledge in LEARNINGS.md, feature requests in FEATURE_REQUESTS.md. Entry templates are in the skill's assets folder.

What does the self-improvement hook do?

At session start it adds a log reminder to the context and flags errors awaiting triage. When the session ends with the new or reset command, it scans the transcript and appends found error patterns to ERRORS.md.

How does staleness checking differ in this skill?

Entries are not deleted by age. Each claim has a check type (environment fact, decision, dependency, relevance) and a review rate from fast to durable, and events such as a dependency change trigger a review.

How does the skill reach other OpenClaw sessions?

Through the sessions_list, sessions_history, sessions_send and sessions_spawn tools it can pass a lesson to another session. It should do so only in a trusted environment and at the user's request, sending a short sanitized summary instead of transcripts.

Can a log entry become a separate skill?

Yes, the scripts folder has extract-skill.sh for that. It takes the new skill's name and a --dry-run flag to preview without writing.

Discussion

No questions or reviews yet.

Skills

Self-learning

self-learning-skills

A meta-skill that saves a hard-won working procedure as a new skill or rule, so the next session starts already knowing it

SkillExtended access971Repository stars

A skill that helps an agent author other skills to the agentskills.io spec: structure, metadata, progressive disclosure and validation

SkillMinimal access2.3KRepository stars

A universal loader for Anthropic-format skills (SKILL.md) in any coding agent: install, sync and load on demand

CLIExtended access10.8KRepository stars

A skill for creating skills that proves them by behavior: before-and-after runs, regression evals and ecosystem audit

SkillExtended access914Repository stars

A Go terminal UI for agent skills: list, check, update and find new ones in a single window

CLIExtended access334Repository stars

A research project that improves and deduplicates an agent's skill library from its sessions through a local proxy and an optional server

CLIBroad access2.7KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialRepository starsMain difference
Self-Improving Agent (this entry)no782
Self-learningno971meta-skill that saves a worked-out path as a new skill or rule after a hard task
claude-reflectno1,901Claude Code plugin that catches corrections in a conversation and writes them to CLAUDE.md and AGENTS.md
Agent Apprenticeshipno1,603a CLI for training agents

README in short

The description explains the repository layout: the publishable package sits in the self-improving-agent subfolder while root files and CI stay outside. It then gives three install routes (the built-in OpenClaw installer, the ClawHub client, a manual copy), the upgrade order with re-copying the hook, and a link to uninstall instructions. A separate section covers development: tests run against an OpenClaw type stub, so OpenClaw itself is not needed. The package includes a changelog, entry templates, examples and maintenance evals.

README badge

Original SKILL.md

---
name: self-improving-agent
description: "Captures and maintains learnings, errors, and corrections. Use when a command fails, the user corrects an assumption, a capability is missing, knowledge is outdated, or a better approach is found. Review relevant saved guidance before major tasks, reuse, and promotion; revalidate it according to what could change and how quickly."
version: "4.0.2"
metadata:
---

# Self-Improvement Skill

Log learnings and errors to markdown files for continuous improvement. Agents can later process these into fixes, and important learnings get promoted to workspace memory. This version of the skill is built for OpenClaw only — for other agents, see the original multi-agent version at https://github.com/pskoett/pskoett-ai-skills.

Capture, review, reuse, promotion, and maintenance are self-contained here: no companion skill, service, plugin, memory backend, or OpenClaw core change is required. The optional hook only reminds and captures possible errors; it does not enforce this workflow or revalidate claims.

## First-Use Initialisation

Before logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:

```bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\n**Categories**: correction | insight | knowledge_gap | best_practice\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/ERRORS.md ] || printf "# Errors\n\nCommand failures and integration errors.\n\n---\n" > .learnings/ERRORS.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Feature Requests\n\nCapabilities requested by the user.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
```

Never overwrite existing files. This is a no-op if `.learnings/` is already initialised.

Do not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.

If you want automatic reminders and session-end error detection, enable the opt-in hook described in [Optional: Enable Hook](#optional-enable-hook).

## Quick Reference

| Situation | Action |
|-----------|--------|
| Command/operation fails | Log to `.learnings/ERRORS.md` |
| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |
| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |
| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |
| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |
| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |

Report a problem

Foxx AISelf-Improving Agent
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.