Complete setup and usage guide for integrating the self-improvement skill with OpenClaw.
OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.
~/.openclaw/
├── workspace/ # Working directory
│ ├── AGENTS.md # Multi-agent coordination patterns
│ ├── SOUL.md # Behavioral guidelines and personality
│ ├── TOOLS.md # Tool capabilities and gotchas
│ ├── MEMORY.md # Long-term memory (main session only)
│ └── memory/ # Daily memory files
│ └── YYYY-MM-DD.md
├── skills/ # Installed skills
│ └── <skill-name>/
│ └── SKILL.md
└── hooks/ # Custom hooks
└── <hook-name>/
├── HOOK.md
└── handler.ts
clawdhub install self-improving-agent
Or copy manually:
cp -r self-improving-agent ~/.openclaw/skills/
Copy the hook to OpenClaw's hooks directory:
cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement
Enable the hook:
openclaw hooks enable self-improvement
Create the .learnings/ directory in your workspace:
mkdir -p ~/.openclaw/workspace/.learnings
Or in the skill directory:
mkdir -p ~/.openclaw/skills/self-improving-agent/.learnings
Purpose: Multi-agent workflows and delegation patterns.
# Agent Coordination
## Delegation Rules
- Use explore agent for open-ended codebase questions
- Spawn sub-agents for long-running tasks
- Use sessions_send for cross-session communication
## Session Handoff
When delegating to another session:
1. Provide full context in the handoff message
2. Include relevant file paths
3. Specify expected output format
Purpose: Behavioral guidelines and communication style.
# Behavioral Guidelines
## Communication Style
- Be direct and concise
- Avoid unnecessary caveats and disclaimers
- Use technical language appropriate to context
## Error Handling
- Admit mistakes promptly
- Provide corrected information immediately
- Log significant errors to learnings
Purpose: Tool capabilities, integration gotchas, local configuration.
# Tool Knowledge
## Self-Improvement Skill
Log learnings to `.learnings/` for continuous improvement.
## Local Tools
- Document tool-specific gotchas here
- Note authentication requirements
- Track integration quirks
.learnings/ as usualIs the learning project-specific?
├── Yes → Keep in .learnings/
└── No → Is it behavioral/style-related?
├── Yes → Promote to SOUL.md
└── No → Is it tool-related?
├── Yes → Promote to TOOLS.md
└── No → Promote to AGENTS.md (workflow)
From learning:
Git push to GitHub fails without auth configured - triggers desktop prompt
To TOOLS.md:markdown ## Git - Don't push without confirming auth is configured - Use `gh auth status` to check GitHub CLI auth
OpenClaw provides tools for cross-session communication:
View active and recent sessions: sessions_list(activeMinutes=30, messageLimit=3)
Read transcript from another session: sessions_history(sessionKey="session-id", limit=50)
Send message to another session: sessions_send(sessionKey="session-id", message="Learning: API requires X-Custom-Header")
Spawn a background sub-agent: sessions_spawn(task="Research X and report back", label="research")
| Event | When It Fires |
|---|---|
agent:bootstrap |
Before workspace files inject |
command:new |
When /new command issued |
command:reset |
When /reset command issued |
command:stop |
When /stop command issued |
gateway:startup |
When gateway starts |
| Trigger | Action |
|---|---|
| Tool call error | Log to TOOLS.md with tool name |
| Session handoff confusion | Log to AGENTS.md with delegation pattern |
| Model behavior surprise | Log to SOUL.md with expected vs actual |
| Skill issue | Log to .learnings/ or report upstream |
Check hook is registered:
openclaw hooks list
Check skill is loaded:
openclaw status
.learnings/ directory existsopenclaw status to see loaded skills