Recursive Decomposition
This skill should be used when facing long-context tasks, processing large documents, handling multi-file analysis, aggregating information across many sources, answering questions requiring hierarchical reasoning, or when context length would cause "context rot" degradation. Triggers on phrases like "analyze all files", "process this large document", "aggregate information from", "search across the codebase", or tasks involving 10+ files or 50k+ tokens of input.
npx skills add majiayu000/claude-skill-registry --skill recursive-decomposition --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Recursive Decomposition for Long-Context Tasks Based on the Recursive Language Models (RLM) research by Zhang, Kraska, and Khattab (2025), this skill provides strategies for handling tasks that exceed comfortable context limits through programmatic decomposition and recursive self-invocation. ## Core Principle Instead of loading entire contexts into the processing window, treat inputs as **environmental variables** accessible through code execution. Decompose problems recursively, process segments independently, and aggregate results programmatically. ## When to Apply - **Linear complexity tasks**: Information aggregation requiring analysis of all entries - **Quadratic complexity tasks**: Pairwise reasoning across multiple items - **Multi-hop questions**: Answers requiring evidence from multiple scattered sources - **Large document analysis**: Processing documents beyond comfortable context limits - **Codebase-wide operations**: Analyzing patterns across many files ## Decomposition Strategies ### 1. Filter Before Deep Analysis Narrow the search space before detailed processing: ``` # Instead of reading all files into context: 1. Use Grep/Glob to identify candidate files by patter
- Core Principle
- When to Apply
- Decomposition Strategies
- 1. Filter Before Deep Analysis
- 2. Strategic Chunking
- 3. Recursive Sub-Queries
- 4. Answer Verification
- 5. Incremental Output Construction
- Implementation Patterns
- Pattern A: Codebase Analysis
- Pattern B: Multi-Document QA
- Pattern C: Information Aggregation
- Cost-Performance Tradeoffs
- Anti-Patterns to Avoid
What does the Recursive Decomposition skill do?
This skill should be used when facing long-context tasks, processing large documents, handling multi-file analysis, aggregating information across many sources, answering questions requiring hierarchical reasoning, or when context length would cause "context rot" degradation. Triggers on phrases like "analyze all files", "process this large document", "aggregate information from", "search across the codebase", or tasks involving 10+ files or 50k+ tokens of input.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill recursive-decomposition --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
