rlm-large-context

rlm-large-context is a skill for Claude Code from logunovFGP/better-rlm. It costs 0 tokens per session (5,110 once invoked), scanned A, original, MIT.

Instructions for using RLM, or recursive language models, to reason over files and collections too large to read directly, such as multi-gigabyte logs, PDFs, data exports and repository dumps.

In plain words
What is it for?
Searching large files, running counting or parsing code, classifying every entry, asking targeted questions, and cross-referencing information across a corpus.
Why use it?
They keep oversized inputs outside the conversation and return only relevant findings, preserving the agent's context for reasoning.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the better-rlm plugin — 1 skill, 1 MCP server shipped together

Good fit Searching large files, running counting or parsing code, classifying every entry, asking targeted questions, and cross-referencing information across a corpus.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/logunovfgp/better-rlm/rlm-large-context
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add logunovFGP/better-rlm --skill rlm-large-context
Clone the repo
git clone --depth 1 https://github.com/logunovFGP/better-rlm

Made for: Claude Code.

Or install better-rlm, the plugin that ships this one along with the rest of its 1 skill, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rlm-large-context

README.md
[![agentmods](https://agentmods.dev/badge/skills/logunovfgp/better-rlm/rlm-large-context/github.svg)](https://agentmods.dev/skills/logunovfgp/better-rlm/rlm-large-context)
Your own site
<a href="https://agentmods.dev/skills/logunovfgp/better-rlm/rlm-large-context"><img src="https://agentmods.dev/badge/skills/logunovfgp/better-rlm/rlm-large-context/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rlm-large-context

Your own site · 80×15
<a href="https://agentmods.dev/skills/logunovfgp/better-rlm/rlm-large-context"><img src="https://agentmods.dev/badge/skills/logunovfgp/better-rlm/rlm-large-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,110 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.05110
Opus 5 $0.00000 $0.02555
Sonnet 5 $0.00000 $0.01022
Haiku 4.5 $0.00000 $0.00511

Measured 4d ago against content hash 8635910c43cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

rlm-large-context scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

1. rlm_exec("import requests; open('/workspace/data','wb').write(requests.get(URL).content)")
skills/rlm-large-context/SKILL.md · 282 lines

How it starts

The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RLM — reason over oversized contexts

The rlm MCP server holds content in an external on-disk store plus a sandboxed Docker REPL and returns only the findings — a multi-GB log never enters this conversation. Reach for these tools instead of reading a huge file.

Route by the shape of the question, not the size of the file

Size decides whether to load. The question's complexity decides which tool.

Question shape Tool Cost
"What will this cost me?" — before any batch or query rlm_estimate(ctx_id, prompt) free, no model call
"Where is X / does X appear" — one lookup rlm_grep(ctx_id, pattern) free, no model call
Exact counts, sums, buckets, parsing rlm_exec(code, ctx_id) free, no model call
"Label / classify / judge every entry"; aggregate over the whole input rlm_chunk_contextrlm_sub_query_batch one cheap call per chunk; re-runs over unchanged chunks are free
One targeted semantic question, input under ~200K tokens rlm_sub_query(ctx_id, prompt) one cheap call
Cross-referencing, contradicting pairs, multi-hop over a corpus rlm_query(ctx_id, question) recursive loop; not forecastable, but gated at the budget line and resumable — see rlm_estimate for its ceiling
Hardest reasoning rlm_query(..., model_override="opus") most expensive

Start at the top. rlm_grep and rlm_exec answer more questions than expected and spend no tokens on the content.

Anything below the free rows: call rlm_estimate first. See Budget below — this is the one step that separates a run you can afford from a run that eats the session.

What this is uniquely good at

From the RLM paper (Zhang, Kraska & Khattab, MIT CSAIL — Recursive Language Models), which measured a median +26% over context compaction and +13% over Claude Code across four long-context tasks at comparable cost:

  • Dense aggregation — every element must be examined (label all, count by category, find the peak). Compaction fails here by design: it "presumes that some details that appear early in the prompt can safely be forgotten." Measured +28% over the base model.
  • Pairwise / cross-referencing — work grows quadratically ("which entries conflict?"). Unaided frontier models scored ≤0.1% where the recursive path reached 58%.
  • Deep research over a corpus — multi-hop across ~1000 documents (6–11M tokens).
  • Whole-repo or whole-directory understanding — reasoning that spans many files at once (LongBench-v2 CodeQA, 23K–4.2M tokens). Route it by question shape: see the code-repository entry under What it is not for — deterministic rlm_exec first, sub-calls only if needed.

Read the full file on GitHub · 282 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +102 lines 8635910c43cb
  2. 8d ago First seen · 180 lines · 0 tokens per session scan A 27154d0b8191

Subscribe to this mod's changes

rlm-large-context is a skill published in the GitHub repository logunovFGP/better-rlm (0 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,110 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens