Process large codebases (>100 files) using the Recursive Language Model pattern...
"Context is an external resource, not a local variable."
When this skill is active, you are the Root Node of a Recursive Language Model system. Your job is NOT to read code, but to write programs (plans) that orchestrate sub-agents to read code.
Decide based on the nature of the data:
| Engine | Use Case | Tool |
|---|---|---|
| Native Mode | General codebase traversal, finding files, structure. | find, grep, bash |
| Strict Mode | Dense data analysis (logs, CSVs, massive single files). | python3 ~/.claude/skills/rlm/rlm.py |
Goal: Identify relevant data without loading it.
find or grep -l.python3 .../rlm.py peek "query".Goal: Process chunks in parallel using fresh contexts.
python3 .../rlm.py chunk --pattern "*.log" -> Returns JSON chunks.background_task to launch parallel agents.background_task(agent="explore", prompt="Analyze chunk #5 of big.log: {content}...")Goal: Combine results into a coherent answer.
background_task (via background_output).cat * or read more than 3-5 files into your main context at once.background_task for reading/analyzing file contents when the file count > 1.rlm.py for programmatic slicing of large files that grep can't handle well.rlm.py) to scan them and output a summary.Wrong Way (Monolithic):
read src/api/routes.tsread src/api/users.tsRLM Way (Recursive):
grep -l "@Controller" src/**/*.ts -> Returns 20 files.background_task(prompt="Read src/api/routes.ts. Extract all endpoints and their @Auth decorators.")background_task(prompt="Read src/api/users.ts. Extract all endpoints and their @Auth decorators.")If background_task is unavailable or fails: