Skip to content
Agentmart
Submit a tool

rlm

Use when processing very long contexts, large documents, or extensive codebases that exceed practical context window limits.

Skill by dmoskov

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dmoskov-rlm

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when processing very long contexts, large documents, or extensive codebases that exceed practical context window limits. Activate when user mentions 'rlm', 'recursive language model', or needs to process files too large to read into context.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rlm

What's inside

Skill name
rlm
Description
Use when processing very long contexts, large documents, or extensive codebases that exceed practical context window limits. Activate when user mentions 'rlm', 'recursive language model', or needs to process files too large to read into context.
License
MIT
Instructions
76 lines in SKILL.md · view on GitHub

Files (4)

  • SKILL.md
  • rlm-agent.md · prompts/
  • rlm-batch · scripts/
  • rlm-query · scripts/

SKILL.md (first lines)

# Recursive Language Model (RLM)

You have access to `rlm-query` and `rlm-batch` for delegating long-context work to sub-agents. **Do not try to orchestrate the work yourself** — your job is to set up the workspace and immediately hand off to a depth-0 orchestrator.

## Setup

```bash
SKILL_DIR="$(dirname "$(readlink -f ~/.claude/skills/rlm/SKILL.md 2>/dev/null || echo ~/.claude/skills/rlm/SKILL.md)")"
export PATH="${SKILL_DIR}/scripts:$PATH"
```

## What to do

1. **Write a prompt file** describing what needs to be done, including paths to any input files:
   ```bash
   TASK="my-task"
   mkdir -p .rlm/$TASK
   cat > .rlm/$TASK/task.md << 'EOF'
   Analyze /path/to/big-document.txt for liability risks...
   EOF
   ```

2. **Launch the root orchestrator in the background** so you can give the user progress updates while it runs:
   ```bash
   rlm-query .rlm/$TASK/task.md .rlm/$TASK/result.out \
       --task $TASK --model opus --max-depth 2 &
   RLM_PID=$!
   ```

3. **Poll for progress** and keep the user informed. Check active sub-agents, completed results, and whether the orchestrator has finished:
   ```bash
   # How many sub-agents are running?
   tmux list-sessions 2>/dev/null | grep -c "rlm-$TASK" || echo 0
   # How many results are in so far?
   ls .rlm/$TASK/results/*.out 2>/dev/null | wc -l
   # Is the orchestrator done?
   kill -0 $RLM_PID 2>/dev/null && echo "still running" || echo "done"
   ```
   Tell the user things like "3 sub-agents active, 5/16 chunks processed so far" while waiting.

4. **Read the result** once the orchestrator finishes:
   ```bash
   wait $RLM_PID
   cat .rlm/$TASK/result.out
   ```

The orchestrator receives the full RLM instructions (`rlm-agent.md`) automatically and knows how to split, delegate to sub-agents, and aggregate. You don't need to read those instructions yourself.

## Configuration

Set these via flags on `rlm-query` or environment variables. Choose based on the task:

- **`--model` / `RLM_MODEL`** (default: `opus`) — Model for the orchestrator and sub-agents. Use `opus` for the root orchestrator (it needs to plan and decompose). Sub-agents doing straightforward work (classification, extraction) can use `sonnet` — the orchestrator can pass `--model sonnet` when it calls `rlm-batch`.

- **`--max-depth` / `RLM_MAX_DEPTH`** (default: `3`) — How many levels of recursion are allowed. Depth 1 means the orchestrator can spawn leaf agents but they can't delegate further. Depth 2 is usually enough — go higher only if chunks are still too large for a single agent after one level of splitting.

- **`--timeout` / `RLM_TIMEOUT`** (default: `1200`) — Seconds before a sub-agent is killed. If agents are timing out, either increase this or split into smaller chunks.

- **`RLM_MAX_PARALLEL`** (default: `15`) — Max concurrent Claude instances across the entire task tree. All depths share the same pool. Lower this if you're hitting rate limits or resource constraints. Set via environment variable only (not a flag).

Example for a large task:
```bash
RLM_MAX_PARALLEL=10 rlm-query .rlm/$TASK/task.md .rlm/$TASK/result.out \
    --task $TASK --model opus --max-depth 2 --timeout 1200
```

## Monitoring

Sub-agents run in named tmux sessions. You (or the user) can watch them live:

```bash
tmux list-sessions | grep rlm   # list all active sub-agents
tmux attach -t rlm-<task>-d1-…  # watch a specific sub-agent work
```

From dmoskov/sharedskills, MIT.

Signals

Stars
2
Forks
2
Open issues
0
Last commit (this folder)
Mar 11, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dmoskov

Cite this page

rlm skill. Agent Mart. https://agentmart.dev/skills/dmoskov-rlm (last updated 2026-10-24)