This branch adds OpenClaw compatibility to the Recursive Language Model (RLM) skill.
RLM gives AI agents two capabilities:
- Analyze codebases beyond context limits - Recursively analyze large codebases using sub-agent delegation
- Persistent memory across sessions - Store and recall knowledge that survives restarts
- OpenClaw installed (
brew install openclaw) - UV package manager (script will install if missing)
# Clone the repo and run the install script (auto-detects OpenClaw path)
git clone https://github.com/marknutter/recursive-ai.git
cd recursive-ai
git checkout openclaw-compatibility
./install-openclaw.shIf the install script cannot find your OpenClaw installation, set the path explicitly:
OPENCLAW_SKILLS_DIR=/path/to/openclaw/skills ./install-openclaw.shThe install script will:
- Copy the skill file to OpenClaw's skills directory
- Install Python dependencies via UV
- Make the
rlmCLI globally available
Analyze large codebases:
/rlm "find all security vulnerabilities" ./src
/rlm "summarize the architecture" ~/projects/myapp
/rlm "find uses of deprecated APIs" ./legacy-code
How it works:
- You (orchestrator) scan metadata and chunk the codebase
- Spawn sub-agents to analyze each chunk
- Sub-agents extract and read actual content (keeps it out of your context)
- You synthesize results without ever loading raw content
Benefits:
- Analyze millions of lines of code
- Stay under context limits
- Parallel processing via sub-agents
- Smart chunking strategies (by file, function, semantic units)
RLM includes MCP tools that are ALWAYS available:
// Tool call example (OpenClaw will expose these as functions)
rlm_remember({
content: "Mark prefers Railway for cloud hosting. Uses it for Moxmo production.",
tags: ["preferences", "infrastructure", "moxmo"],
metadata: {
source: "conversation-2026-02-19",
importance: "medium"
}
})rlm_recall({
query: "hosting preferences",
limit: 5
})
// Returns: Top 5 relevant memories with similarity scoresrlm_memory_list({
limit: 10,
tags: ["moxmo"]
})
// Returns: 10 most recent entries tagged "moxmo"rlm_memory_extract({
entry_id: "abc123"
})
// Returns: Full content of that memory entryrlm_forget({
entry_id: "abc123"
})When to use memory:
Remember:
- User preferences and patterns
- Project decisions and rationale
- Important facts that should persist
- Context that spans multiple sessions
Recall:
- At session start (what do I know about this user?)
- Before recommendations (what are their preferences?)
- When context is missing (did we discuss this before?)
RLM memory complements OpenClaw's existing memory system:
- MEMORY.md → Narrative context, curated insights (use
memory_searchtool) - Daily logs → Chronological session records
- RLM memory → Structured, searchable, tagged knowledge
Use both together:
- RLM memory for quick facts, preferences, structured data
- MEMORY.md for narrative context, project history, relationships
- Daily logs for chronological session records
OpenClaw-specific changes:
- Skill location:
$(npm root -g)/openclaw/skills/rlm/(auto-detected) - CLI access: Global
rlmcommand (viauv tool install) - Sub-agent spawning: Uses
sessions_spawninstead of Claude Code'sTasktool - MCP tools: Exposed via OpenClaw's tool system (not MCP servers)
- Metadata: OpenClaw-compatible frontmatter with
requiresandinstallsections
| Feature | Claude Code | OpenClaw |
|---|---|---|
| Skill location | ~/.claude/skills/rlm/ |
$(npm root -g)/openclaw/skills/rlm/ (auto-detected) |
| CLI prefix | cd <path> && uv run rlm |
Global rlm command |
| Sub-agents | Task tool |
sessions_spawn tool |
| MCP tools | MCP server (stdio://rlm) |
Native OpenClaw tools |
| Installation | ./install.sh |
./install-openclaw.sh |
Test the skill:
# In an OpenClaw session
/rlm "test query" ./test-directoryUpdate the skill:
cd "$(npm root -g)/openclaw/skills/rlm/rlm-src"
git pull
uv syncUninstall:
rm -rf "$(npm root -g)/openclaw/skills/rlm"
uv tool uninstall rlmThis OpenClaw branch should stay in sync with the main Claude Code version. When updating:
- Merge changes from
mainbranch - Test that OpenClaw-specific adaptations still work
- Update this README if behavior changes
- RLM Issues: https://github.com/marknutter/recursive-ai/issues
- OpenClaw Issues: https://github.com/openclaw/openclaw/issues
- Documentation: See README.md for detailed RLM algorithm docs
Same as main RLM project (see LICENSE file).