RLMBLOCK
Recursive Language Model patterns for Claude Code — handle massive contexts (10M+ tokens) by treating them as external variables
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Recursive Language Model patterns for Claude Code — handle massive contexts (10M+ tokens) by treating them as external variables.
Based on: https://arxiv.org/html/2512.24601v1
How Users Interact
You don't call RLM tools directly. You ask Claude to analyze large files, and Claude uses RLM behind the scenes.
Example:
- You say: "Analyze this 2MB log file for errors"
- Claude uses RLM tools internally
- You get: "I found 3 error patterns: database timeouts (47), auth failures (23)..."
Core Idea
Instead of feeding massive contexts directly into the LLM:
- Load context as external variable (stays out of prompt)
- Inspect structure programmatically
- Chunk strategically (lines, chars, or paragraphs)
- Sub-query recursively on chunks
- Aggregate results for final synthesis
Quick Start
Installation
git clone https://github.com/richardwhiteii/rlm.git cd rlm uv sync
Or with pip:
python -m venv .venv source .venv/bin/activate pip install -e .
Configure for Claude Code
Option 1: Quick Setup (recommended)
# From the rlm directory claude mcp add rlm -s user -- uv run --directory "$(pwd)" python -m src.rlm_mcp_server
This adds RLM globally (-s user) so it's available in all your Claude Code sessions.
Option 2: With Ollama (free local inference)
First set environment variables, then add:
export RLM_DATA_DIR="$HOME/.rlm-data" export OLLAMA_URL="http://localhost:11434" claude mcp add rlm -s user -- uv run --directory "$(pwd)" python -m src.rlm_mcp_server
Option 3: Manual JSON config
Add to ~/.claude/.mcp.json for full control:
{
"mcpServers": {
"rlm": {
"command": "uv",
"args": ["run", "--directory", "/path/to/rlm", "python", "-m", "src.rlm_mcp_server"],
"env": {
"RLM_DATA_DIR": "/path/to/.rlm-data",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}Note: Replace `/path/t
0bf6fd0958f2OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add rlm-mcp-server -- uvx rlm-mcp-server
{
"mcpServers": {
"rlm-mcp-server": {
"command": "uvx",
"args": [
"rlm-mcp-server"
]
}
}
}Exposed tools (12)
11 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
rlm_auto_analyze | read | Automatically detect content type and analyze with optimal chunking strategy. One-step analysis for common tasks. |
rlm_chunk_context | read | Chunk a loaded context by strategy. Returns chunk metadata, not full content. |
rlm_exec | write | Execute Python code against a loaded context in a sandboxed subprocess. Set result variable for output. |
rlm_filter_context | read | Filter context using regex/string operations. Creates a new filtered context. |
rlm_get_chunk | read | Get a specific chunk by index. Use after chunking to retrieve individual pieces. |
rlm_get_results | read | Retrieve stored results for aggregation. |
rlm_inspect_context | read | Inspect a loaded context - get structure info without loading full content into prompt. |
rlm_list_contexts | read | List all loaded contexts and their metadata. |
rlm_load_context | read | Load a large context as an external variable. Returns metadata without the content itself. |
rlm_store_result | read | Store a sub-call result for later aggregation. |
rlm_sub_query | read | Make a sub-LLM call on a chunk or filtered context. Core of recursive pattern. Set max_depth > 0 to allow the sub-LLM to use RLM tools for hierarchical decomposition. |
rlm_sub_query_batch | read | Process multiple chunks in parallel. Respects concurrency limit to manage system resources. Set max_depth > 0 to allow sub-LLMs to use RLM tools for hierarchical decomposition. |
Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (2 observation(s))
- Shell
- declared (1 observation(s))
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (3)
"python": "Find security vulnerabilities: SQL injection, command injection, eval(), exec(), unsafe deserialization, hardcoded secrets, path traversal.",
docs/arxiv-2512.24601v1.pdf
docs/encyclopedia/merged_encyclopedia.txt
Gates applied: no_behavioural_pass.
0bf6fd0958f2full audit observations/trust-audit/mcp-server/richardwhiteii__rlm.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 0bf6fd0958f2 | BLOCK | D | 69 | first audit |
Questions
What is the RLM MCP server?
Recursive Language Model patterns for Claude Code — handle massive contexts (10M+ tokens) by treating them as external variables
What tools does RLM expose?
12 in total: 11 read-only, 1 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is RLM safe to connect to an agent?
No — not without reading the findings first. The audit graded it D (69/100) and found 1 critical or high issue in the source. Each one is listed on this page with the file and line it is on.
What credentials does RLM need?
No credential environment variables were found in its source, so it appears to need none.
How does RLM run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as rlm-mcp-server.
How current is this page?
The grade is for one exact copy of the source (0bf6fd0958f2), read on 2026-10-08. The repository is watched and re-audited when it changes.