rlm — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited rlm (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
The RLM pattern enables processing massive contexts (10M+ tokens) that exceed Claude's context window by recursively chunking, processing, and aggregating results. Instead of failing on large files, use RLM to break them into manageable pieces.
Use RLM when you encounter:
Don't use RLM for:
The core workflow is: Load → Inspect → Chunk → Sub-Query → Aggregate
# Load large content into RLM memory
rlm_load_context(
name="codebase",
content=file_contents # Full file content
)Returns: {name, size_bytes, size_chars, line_count, loaded: true}
# Understand structure without loading into prompt
rlm_inspect_context(
name="codebase",
preview_chars=500 # Optional preview
)Returns: Metadata + preview (first N chars)
# Break into manageable pieces
rlm_chunk_context(
name="codebase",
strategy="lines", # or "chars" or "paragraphs"
size=100 # Lines per chunk (or chars if strategy=chars)
)Chunking Strategies:
lines (default): Split by line count - best for code, logs, structured datachars: Split by character count - best for prose, unstructured textparagraphs: Split by blank lines - best for documents, markdownReturns: {name, chunk_count, strategy, size_per_chunk}
Single chunk:
rlm_sub_query(
context_name="codebase",
chunk_index=0,
query="Extract all function names",
provider="claude-sdk" # or "ollama"
)Batch processing (parallel):
rlm_sub_query_batch(
context_name="codebase",
chunk_indices=[0, 1, 2, 3],
query="Extract all function names",
provider="claude-sdk",
concurrency=4 # Max parallel requests (max: 8)
)Returns: Array of results, one per chunk
# Store intermediate results for later aggregation
rlm_store_result(
name="function_names",
result=sub_query_response,
metadata={"chunk": 0} # Optional
)# Retrieve all stored results
rlm_get_results(name="function_names")Then synthesize final answer from all chunk results.
provider="claude-sdk"provider="ollama"Choosing a Provider:
claude-sdk for production tasksollama when cost/privacy is primary concernTask: Find all TODO comments across 50 Python files
# 1. Read all files and combine
all_code = ""
for file in python_files:
all_code += read_file(file)
# 2. Load into RLM
rlm_load_context(name="codebase", content=all_code)
# 3. Inspect to understand size
metadata = rlm_inspect_context(name="codebase")
# Shows: 15,000 lines, 500KB
# 4. Chunk by lines (code is line-oriented)
rlm_chunk_context(
name="codebase",
strategy="lines",
size=200 # 200 lines per chunk
)
# Result: 75 chunks
# 5. Process in batches
for batch_start in range(0, 75, 4):
batch_indices = list(range(batch_start, min(batch_start+4, 75)))
results = rlm_sub_query_batch(
context_name="codebase",
chunk_indices=batch_indices,
query="Extract all TODO comments with line context",
concurrency=4
)
# 6. Store results
for i, result in enumerate(results):
rlm_store_result(
name="todos",
result=result,
metadata={"chunk": batch_start + i}
)
# 7. Aggregate
all_results = rlm_get_results(name="todos")
# Synthesize final TODO listTask: Summarize errors from 10MB log file
# 1. Load logs
logs = read_file("/var/log/app.log")
rlm_load_context(name="logs", content=logs)
# 2. Chunk by lines (logs are line-oriented)
rlm_chunk_context(name="logs", strategy="lines", size=500)
# 3. Filter to error lines only
rlm_filter_context(
name="logs",
output_name="errors",
pattern=r"ERROR|CRITICAL",
mode="keep"
)
# 4. Chunk filtered results
rlm_chunk_context(name="errors", strategy="lines", size=100)
# 5. Batch process errors
chunk_metadata = rlm_inspect_context(name="errors")
num_chunks = chunk_metadata["chunk_count"]
all_indices = list(range(num_chunks))
results = rlm_sub_query_batch(
context_name="errors",
chunk_indices=all_indices,
query="Group errors by type and count occurrences",
concurrency=8
)
# 6. Aggregate error summary
# Synthesize from results arrayTask: Answer questions from 20 research papers
# 1. Load all papers
combined_docs = "\n\n=== DOCUMENT BREAK ===\n\n".join(papers)
rlm_load_context(name="research", content=combined_docs)
# 2. Chunk by paragraphs (prose is paragraph-oriented)
rlm_chunk_context(name="research", strategy="paragraphs", size=50)
# 3. Ask question across all chunks
results = rlm_sub_query_batch(
context_name="research",
chunk_indices=list(range(chunk_count)),
query="Does this section mention climate change impacts on agriculture? If yes, summarize key points.",
concurrency=8
)
# 4. Filter relevant results
relevant = [r for r in results if "yes" in r.lower()]
# 5. Final synthesis
# Combine relevant excerpts into answerLoad large content into RLM memory without consuming context window.
name: Identifier for this contextcontent: Full text content to loadGet metadata and preview without loading full content.
name: Context identifierpreview_chars: Number of characters to preview (default: 500)Split context into manageable chunks.
name: Context identifierstrategy: "lines", "chars", or "paragraphs"size: Chunk size (meaning depends on strategy)Retrieve specific chunk by index.
name: Context identifierchunk_index: Zero-based chunk indexFilter context using regex, creates new filtered context.
name: Source context identifieroutput_name: Name for filtered contextpattern: Regex pattern to matchmode: "keep" (keep matches) or "remove" (remove matches)Process single chunk with sub-LLM call.
context_name: Context identifierquery: Question/instruction for sub-callchunk_index: Optional specific chunk (otherwise uses whole context)provider: "claude-sdk" or "ollama"model: Optional model overrideProcess multiple chunks in parallel (recommended).
context_name: Context identifierquery: Question/instruction for each chunkchunk_indices: Array of chunk indices to processprovider: "claude-sdk" or "ollama"concurrency: Max parallel requests (default: 4, max: 8)Store sub-call result for later aggregation.
name: Result set identifierresult: Result content to storemetadata: Optional metadata about resultRetrieve all stored results for aggregation.
name: Result set identifierList all loaded contexts and their metadata.
lines (structured, line-oriented)paragraphs (semantic boundaries)chars (uniform distribution)rlm_sub_query_batch is much faster than sequential callsrlm_filter_context to reduce data volumeclaude-sdk (Haiku 4.5) for most tasks - fast and cheapollama for experimentation or when processing very large volumes# Map: Process each chunk
results = rlm_sub_query_batch(
context_name="data",
chunk_indices=all_indices,
query="Extract key information",
concurrency=8
)
# Reduce: Aggregate results
final = synthesize(results)# Filter to relevant content
rlm_filter_context(
name="all_logs",
output_name="errors",
pattern="ERROR",
mode="keep"
)
# Process filtered content
results = rlm_sub_query_batch(
context_name="errors",
chunk_indices=all_indices,
query="Categorize error type"
)# First pass: Summarize each chunk
summaries = rlm_sub_query_batch(
context_name="docs",
chunk_indices=all_indices,
query="Summarize key points"
)
# Second pass: Aggregate summaries
rlm_load_context(name="summaries", content="\n".join(summaries))
final = rlm_sub_query(
context_name="summaries",
query="Create overall summary from chunk summaries"
)rlm_sub_query_batch with appropriate concurrencyclaude-sdk) and filter before processingRLM unlocks massive context processing for Claude Code:
Default workflow: Load → Inspect → Chunk (lines, 200) → Batch Sub-Query (claude-sdk, concurrency=4) → Aggregate
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.