
rlm-reasoning
by freedom07
AI Studio Claude Code plugin
SKILL.md
name: rlm-reasoning description: Apply RLM (Recursive Language Model) reasoning pattern for large context processing. Use when analyzing large files, codebases, or documents. Triggers on "RLM pattern", "large file analysis", "selective reading", "PROBE EXTRACT CONFIRM", or when dealing with files over 1000 lines. allowed-tools:
- Read
- Grep
- Glob
- Task
- Bash
RLM (Recursive Language Model) Reasoning Pattern
Based on Zhang et al., MIT CSAIL (arXiv:2512.24601)
Core Principle: Context Outside, Not Inside
Never load entire large files into context. Instead, keep data "outside" and access selectively.
4-Step Reasoning Pattern
1. PROBE (Explore)
Search for relevant areas using keywords before reading:
Grep for keywords to find relevant lines
Glob to find related files by pattern
Example:
Grep(pattern="authentication", path="src/")
Glob(pattern="**/auth*.py")
2. EXTRACT (Load Selectively)
Only read the specific sections you need:
Read with offset/limit for specific line ranges
Load only chunks that contain matches
Example:
Read(file_path="src/auth/login.py", offset=50, limit=100)
3. CONFIRM (Verify)
Before answering, verify information against the source:
Re-check that found information matches the question
Validate references actually exist
Cross-reference multiple sources if needed
4. ANSWER (Respond)
Provide verified response based on confirmed evidence.
When to Apply This Pattern
| Situation | Action |
|---|---|
| File > 1000 lines | PROBE first with Grep, never Read entire |
| Complex analysis | Delegate to Task tool sub-agent |
| Code generation | Verify imports/references exist with Grep |
| Multiple files | Use Glob to find, then selective Read |
Anti-Patterns (Avoid)
# BAD: Loading entire file
Read("large_file.py") # Don't do this!
# GOOD: Search first, then selective read
Grep("function_name", "src/")
Read("src/file.py", offset=150, limit=50)
Sub-Agent Delegation
For complex multi-step analysis, use Task tool:
Task(
subagent_type="Explore",
prompt="Find all authentication-related code and summarize the flow"
)
Verification Checklist
Before providing an answer:
- Did I search before reading?
- Did I read only necessary sections?
- Did I verify references exist?
- Is my answer based on confirmed evidence?
Additional Resources
- For Python implementation details, see rlm_agent.py
- For detailed API reference, see REFERENCE.md
Quick Commands
Run the RLM agent directly:
python ~/.claude/skills/rlm-reasoning/scripts/rlm_query.py "your question" /path/to/file
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です