Automatically capture errors, corrections, and best practices into structured logs so your AI agent learns and improves over time.
npx clawhub@latest install self-improving-agentThe Self-Improving Agent skill gives AI coding agents (Claude Code, Codex, GitHub Copilot, OpenClaw) a structured memory system for capturing mistakes, user corrections, and discovered best practices. Logged entries are stored in .learnings/ markdown files and can be promoted to permanent project memory files like CLAUDE.md or AGENTS.md. By reviewing these logs before major tasks, agents avoid repeating the same errors and apply accumulated project knowledge automatically.
npx clawhub@latest install self-improving-agentClick the Install button at the top of this page for one-click setup
Every captured event gets a typed, timestamped entry with priority, area tag, status, and metadata fields like Pattern-Key and See Also links. Three separate log files keep corrections, command failures, and feature requests organized and grep-friendly.
When a learning is broadly applicable, the skill provides a clear workflow to distill it into concise rules and write them to CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, or OpenClaw workspace files (SOUL.md, TOOLS.md). This turns ephemeral session context into durable, contributor-visible knowledge.
Entries include a stable Pattern-Key and Recurrence-Count. When a pattern is logged 3+ times across 2+ distinct tasks within 30 days, the skill's promotion rules automatically flag it for elevation to system-prompt–level guidance, stopping repeat mistakes at the source.
Optional hook scripts (activator.sh, error-detector.sh) integrate with Claude Code and Codex CLI via UserPromptSubmit and PostToolUse hooks. This means error detection and learning prompts fire automatically without manual intervention (~50–100 token overhead per prompt).
Learnings that meet quality criteria (recurring, verified, non-obvious, broadly applicable) can be extracted into standalone, shareable skills using the provided extract-skill.sh helper. The workflow includes dry-run mode, quality gates, and status tracking on the original entry.
Works with Claude Code, Codex CLI, GitHub Copilot, and OpenClaw. Each agent has a documented activation method — hook-based for Claude Code/Codex, manual .github/copilot-instructions.md injection for Copilot, and workspace injection with inter-session messaging tools for OpenClaw.
An agent repeatedly tries npm install on a pnpm workspace. After the first correction, the skill logs a correction entry and the developer promotes it to CLAUDE.md as Package manager: pnpm. Subsequent sessions read this rule and never make the same mistake.
A team tracks .learnings/ in version control. When one developer's session hits a CI auth issue and logs it to ERRORS.md, every agent on the team picks up the documented fix and suggested resolution in future sessions.
After diagnosing a tricky TypeScript client regeneration issue that required three debugging sessions, the learning accumulates See Also links and a high Recurrence-Count. The developer runs extract-skill.sh api-client-regen to package the solution as a distributable skill.
Before starting a large refactor, an OpenClaw session uses the hook-triggered reminder to scan .learnings/ for pending high-priority entries in the backend area, applying all accumulated conventions before writing a single line of code.
npx clawhub@latest install self-improving-agentLog in to write a review
No reviews yet. Be the first to share your experience!