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.
npx skills add logunovFGP/better-rlm --skill rlm-large-contextgit clone --depth 1 https://github.com/logunovFGP/better-rlmWrote 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.
[](https://agentmods.dev/skills/logunovfgp/better-rlm/rlm-large-context)<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.
<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>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.
| Model | Per session | Once 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 |
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)") 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_context → rlm_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_execfirst, sub-calls only if needed.
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.
- 4d ago Changed · +102 lines 8635910c43cb
- 8d ago First seen · 180 lines · 0 tokens per session scan A 27154d0b8191
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.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
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…
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…
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…
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…
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…