Install rlm-claude-code as Recursive Language Model plugin¶
- Date: 2026-04-06
- Status: Accepted
- Tags:
tooling,claude,workflow
Context¶
During onsite onboarding at a new job, Everett — an accomplished engineer deeply versed in AI tooling — recommended rlm-claude-code as his primary approach for keeping Claude Code fast, token-efficient, and memory-aware.
The core problem: Claude Code processes entire conversation contexts on every turn. As sessions grow, this leads to slower responses, higher token costs, and degraded reasoning quality. Rather than manually managing context or splitting work across sessions, RLM automates this by turning Claude into a recursive agent that decomposes tasks into focused sub-queries.
Key capabilities that motivated adoption:
- Task decomposition — peek at context structure before deep analysis, search strategically, partition large contexts for parallel processing
- Model cascading — routes sub-queries to cheaper models (Haiku for quick lookups, Sonnet for moderate tasks), reserving Opus for orchestration
- Persistent memory — SQLite-backed knowledge store that evolves across sessions (facts, experiences, procedures) with automatic consolidation and decay
- Budget tracking — real-time token and cost accounting with configurable limits
- Execution modes — fast (depth 1, Haiku), balanced (depth 2, Sonnet), thorough (depth 3, Opus) for different task profiles
Decision¶
Install rlm-claude-code as a Claude Code plugin at the user scope. Use balanced mode as the default execution profile. Enable persistent memory for cross-session learning.
Installation method: Claude Code plugin marketplace (claude plugin marketplace add rand/rlm-claude-code).
Default configuration:
- Mode: balanced (depth 2, Sonnet sub-queries, read-only tool access)
- Auto-activation: complexity-based (triggers on >80K tokens, cross-file reasoning, complex debugging)
- Memory: enabled, longterm tier shared across sessions
- Budget: configured per-session with
/rlm budget
Alternatives Considered¶
| Option | Why Rejected |
|---|---|
Manual context management (selective file reads, /compact) |
Works but requires constant human attention; doesn't scale to large sessions or complex multi-file tasks |
| Always use Haiku for sub-tasks via custom prompts | Loses the intelligent routing — some sub-tasks genuinely need Sonnet-level reasoning; manual model selection is error-prone |
| No plugin, just shorter sessions | Loses cross-session memory; forces re-establishing context repeatedly; doesn't address token cost on complex tasks |
| Build custom decomposition via Claude Code skills | Significant engineering effort to replicate what RLM already provides; maintenance burden for diminishing returns |
Consequences¶
Positive:
- Faster responses on complex tasks via intelligent decomposition rather than brute-force context processing
- Lower token costs through model cascading (cheap models for sub-queries)
- Persistent memory reduces context re-establishment across sessions
- Budget tracking provides visibility into actual Claude Code costs
- Configurable modes let user match tool intensity to task complexity
Negative / Trade-offs:
- Adds dependency on third-party plugin (
rand/rlm-claude-code) — must track upstream updates - Introduces additional complexity in the Claude Code execution model (recursion depth, model routing)
- Memory system adds SQLite state that needs occasional review/cleanup
- Auto-activation heuristics may trigger unnecessarily on some tasks (mitigated by
/simplebypass)
Ongoing obligations:
- Monitor upstream repo for breaking changes or security issues
- Periodically review memory store for stale or incorrect persistent facts
- Tune budget limits as usage patterns become clear
ADRs are immutable. If this decision changes, create a new ADR with status "Superseded by" pointing here, and update this record's status.