Skills self-improvement
Mulch Self Improver โ Let your agents grow ๐ฑ. Captures learnings with Mulch so expertise compounds across sessions. Use when: command/tool fails, user corrects you, missing feature, API fails, knowledge was wrong, or better approach found. Run mulch prime at session start; mulch record before finishing. Benefits: better and more consistent coding, improved experience, less hallucination.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/austindixson/mulch" ~/.claude/skills/clawdbot-skills-self-improvement-eab9a4 && rm -rf "$T"
skills/austindixson/mulch/SKILL.mdMulch Self Improver โ Let your agents grow ๐ฑ
Structured expertise that accumulates over time, lives in git, and works with any agent. Agents start each session from zero; the pattern discovered yesterday is forgotten today. This skill uses Mulch: agents call
mulch record to write learnings and mulch query to read them. Expertise compounds across sessions, domains, and teammates. Mulch is a passive layer โ it does not contain an LLM. Agents use Mulch; Mulch does not use agents.
Benefits: Better and more consistent coding ยท Improved experience ยท Less hallucination (grounding in project expertise)
When to use: Command/tool fails, user corrects you, user wants a missing feature, your knowledge was wrong, or you found a better approach โ record with Mulch and promote proven patterns to project memory. Auto-detection: The hook now detects errors and corrections automatically and prompts to record.
Mechanics: One learning store โ
.mulch/ (append-only JSONL, git-tracked, queryable). Session start: mulch prime. Recording: mulch record <domain> --type <type> .... No .learnings/ markdown files.
Qualification (features, benefits, pain points): See QUALIFICATION.md. Benchmark (token efficiency, troubleshooting skill improvement): See BENCHMARK.md โ e.g. ~54% fewer chars to get same resolutions; find rate same or better; less context โ fewer tokens, less noise, lower risk of wrong fix.
New Features (v1.1)
Auto-Detection
The hook now automatically detects learning moments:
- Errors/failures โ When commands fail or return errors
- Corrections โ When you say "no", "actually", "wrong", etc.
- Retries โ When you ask to try again
The agent will prompt: "Want me to record this for next time?"
Pre-loaded Domains
24 preset domains included in
config/domains.json:
api, database, testing, frontend, backend, infra, docs, config, security, performance, deployment, auth, errors, debugging, workflow, customer, system, marketing, sales, content, competitors, crypto, automation, openclaw
Notifications
When a learning is recorded, you're notified via Telegram.
Quick Reference
| Situation | Action |
|---|---|
| Command/operation or API fails | |
| User corrects you / knowledge was wrong | or |
| Found better approach, best practice | or |
| Architectural or tech decision | |
| Feature request (tracking) | |
| Key file/endpoint to remember | |
| Similar to existing record | Use or ; run first |
| Broadly applicable pattern | Promote to , , SOUL.md, TOOLS.md; use for snippets |
| Session start (project has .mulch/) | Run to load expertise into context |
Mulch Setup
Install (optional; npx works without install):
npm install -g mulch-cli # or: npx mulch-cli <command>
Initialize in project:
mulch init # Quick: add all preset domains at once cat config/domains.json | jq -r '.domains[].name' | xargs -I {} mulch add {} # Or add individually: mulch add api mulch add database mulch add testing # add domains that match your areas: frontend, backend, infra, docs, config
Provider hooks (remind agent to record):
mulch setup cursor # or: claude, codex, gemini, windsurf, aider
Onboarding snippet for AGENTS.md/CLAUDE.md:
mulch onboard
Record Types (Mulch)
| Type | Required | Use Case |
|---|---|---|
| description, resolution | What went wrong and how to avoid it |
| content | "Use pnpm not npm"; "Always WAL mode for SQLite" |
| name, description | Named patterns, optional |
| title, rationale | Architecture, tech choices, feature tracking |
| name, description | Key files, endpoints, resources |
| name, description | Step-by-step procedures |
Optional on any record:
--classification (foundational | tactical | observational), --tags, --relates-to, --supersedes, --evidence-commit, --evidence-file, --outcome-status (success | failure).
Workflow
- Session start: If
exists, run.mulch/
(ormulch prime
for focus).mulch prime <domain> - During work: When something fails or you learn something, run
.mulch record <domain> --type <type> ... - Before finishing: Review; record any remaining insights with
.mulch record - Promote: When a pattern is proven and broadly applicable, add to CLAUDE.md / AGENTS.md / SOUL.md / TOOLS.md; use
to generate snippets.mulch onboard
Finding Domain
- Use existing domains from
ormulch status
.mulch query --all - Run
to get domain suggestions from changed files.mulch learn - Common domains:
,api
,database
,testing
,frontend
,backend
,infra
,docs
.config
Recurring Patterns and Linking
- Search first:
ormulch search "keyword"
.mulch query <domain> - Link records:
ormulch record ... --relates-to <domain>:<id>
.--supersedes <domain>:<id> - Recurring issues โ promote to CLAUDE.md/AGENTS.md or add to TOOLS.md/SOUL.md so all agents see them.
Simplify & Harden Feed
For candidates from the simplify-and-harden skill:
- Use
as a stable tag:pattern_key
.mulch record <domain> --type pattern --name "<pattern_key>" --description "..." --tags "simplify-and-harden" - Search first:
; if found, usemulch search "<pattern_key>"
or add to existing via--relates-to
if needed.mulch edit - When recurrence is high, promote to CLAUDE.md/AGENTS.md/SOUL.md/TOOLS.md as short prevention rules.
Periodic Review
- When: Before major tasks, after features, weekly.
- Commands:
,mulch status
,mulch ready --since 7d
.mulch query --all - Actions: Promote high-value records to project memory; run
for stale tactical/observational entries if desired;mulch prune
for health.mulch doctor --fix
Promotion Targets
| Learning Type | Promote To |
|---|---|
| Behavioral patterns | (OpenClaw workspace) |
| Workflow improvements | |
| Tool gotchas | (OpenClaw workspace) |
| Project facts, conventions | |
| Copilot context | |
Use
mulch onboard to generate AGENTS.md/CLAUDE.md snippets.
Detection Triggers
Record when you notice:
- User corrects you ("No, that's not right...", "Actually...") โ convention or pattern
- Command/API/tool fails โ failure (description + resolution)
- User wants missing capability โ decision (title + rationale)
- Your knowledge was wrong or outdated โ convention
- You found a better approach โ convention or guide
OpenClaw Setup
OpenClaw injects workspace files; use Mulch for learnings.
Installation
clawdhub install self-improving-agent # or: git clone ... ~/.openclaw/skills/self-improving-agent
Workspace and Mulch
- Session start: Run
when the project (or workspace) hasmulch prime
. Optionally add.mulch/
output to workspace context if your setup supports it.mulch prime - Recording: Use
from the project or workspace directory that containsmulch record
..mulch/ - Promotion: SOUL.md, AGENTS.md, TOOLS.md live in
; add promoted rules there.~/.openclaw/workspace/
Enable Hook (reminder at bootstrap)
cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement openclaw hooks enable self-improvement
See
references/openclaw-integration.md.
Generic Setup (Other Agents)
- In project:
andmulch init
as needed.mulch add <domain> - Use
(cursor, claude, codex, etc.) for hooks.mulch setup <provider> - Add to CLAUDE.md/AGENTS.md: "Run mulch prime at session start. Record learnings with mulch record <domain> --type failure|convention|decision|pattern|guide|reference."
- Run
and paste the snippet into your agent docs.mulch onboard
Multi-Agent Safety
Mulch is safe for concurrent use: advisory file locking, atomic writes, and
merge=union in .gitattributes for JSONL. Multiple agents can run mulch prime and mulch record in parallel; locks serialize writes per domain.
Skill Extraction
When a Mulch record is valuable as a reusable skill:
- Get content from
ormulch query <domain>
.mulch search "..." - Create
(template inskills/<skill-name>/SKILL.md
).assets/SKILL-TEMPLATE.md - Optionally note in the record (e.g. via
) that it was promoted to a skill.mulch edit
Best Practices
- Record immediately โ context is freshest after the issue.
- Pick the right type โ failure (description+resolution), convention (short rule), decision (title+rationale), etc.
- Use domains consistently โ e.g. same
domain for all API-related learnings.api - Link related records โ
,--relates-to
.--supersedes - Run mulch prime at session start โ so the agent is grounded in existing expertise.
- Promote when proven โ move broadly applicable rules to CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md.
No .learnings/
This skill does not use
.learnings/ or markdown log files. All learnings live in .mulch/ and are recorded via the Mulch CLI. If you see references to .learnings/ in older docs, treat them as superseded by Mulch.