Recursive Decomposition skill

A skill based on the Recursive Language Models paper: the agent splits repo-wide or multi-PDF tasks into batches for sub-agents

  • 53 ★ on the repository
  • Last commit
  • MIT
Skill

Extended access

Why this level

  • Runs search and file conversion commands via npx
  • May send scanned PDFs to the Firecrawl cloud service
All reasons and checks

massimodeluisa/recursive-decomposition-skill

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add skills/recursive-decomposition

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Runs search and file conversion commands via npx
  • May send scanned PDFs to the Firecrawl cloud service

This is third-party code. Review the repository files before installing.

What it does

The skill changes how the agent handles large inputs. The agent first sizes the input, narrows it with searches rather than reads, and splits the rest into batches of 5 to 10 files. Each batch goes to a separate sub-agent with a self-contained brief, with recursion limited to one level. The merged answer is checked against sources and returned with file and line references. PDFs and Office files are converted to markdown first.

Who it is for. For developers and analysts who ask an agent to analyze a whole repository or a large document set.

Good fit when

  • You need every endpoint, TODO or error handling pattern across a project
  • You need to consolidate decisions from dozens of documents or meeting notes
  • You need an answer connecting facts scattered across files

Not a fit when

  • The question concerns one file or one function
  • You just need to convert a single short PDF

Example request

Find every error handling site across the repository and group them by approach

Limitations

Working through sub-agents costs more tokens and time than reading a small input directly. For PDFs the skill uses Firecrawl's anydoc via npx, and cloud firecrawl parse for scans, which needs a Firecrawl account and spends credits. Performance figures come from the paper, not from the skill author's measurements on your tasks.

How to disable. Uninstall the recursive-decomposition plugin via claude plugin or delete the recursive-decomposition folder from your skills directory.

FAQ

How do I invoke it explicitly?

With /recursive-decomposition, optionally with a path or question. It also activates on its own for project-wide or multi-document requests.

Why don't sub-agents spawn sub-agents?

The skill caps depth at one level to avoid runaway calls. On disagreements the agent re-reads the source instead of recursing deeper.

Discussion

No questions or reviews yet.

Skills

28 skills that remove instead of add: rewrite a document clean, check the read of a request, compress text and challenge a decision

SkillExtended access1.4KRepository stars

A completion-discipline skill for large agent tasks: write the acceptance ledger with runnable checks first, then do the work, then reverify against evidence

SkillExtended access4.2KRepository stars

A Ralph loop for long tasks: an agent in a Docker sandbox works through a PRD task list, checks each task with tests and commits until the list is done

WorkflowBroad access333Repository stars

A meta-skill that distills methodologies from books, long videos, podcasts and courses into a set of ready-to-invoke agent skills

SkillExtended access11.9KRepository stars

A skill plus hooks that keep a coding agent on task and cut speculative defenses, unread checksums and scope creep

PluginExtended access3.3KRepository stars
Official

Feynman — a terminal AI agent for scientific research: literature reviews, source checks, paper critique and comparing a paper with its code

CLIExtended access10KRepository stars

README in short

The README describes how models degrade on long context and the six-step protocol. Install via the skills CLI, as a Claude Code plugin or by copying the folder. It includes a table of when to decompose versus read directly, results from the paper and the author's own run on a corpus of mortgage PDFs. MIT licensed.

README badge

Original SKILL.md

---
name: recursive-decomposition
description: "Decompose dense codebase-wide, multi-document, PDF, and aggregation work even when the input fits the context window, following Recursive Language Models (Zhang, Kraska, Khattab, 2025). Use when the user asks to analyse all files, a whole repo, all docs, large PDFs, or to aggregate or multi-hop across scattered sources. Skip one file, one function, a single needle, or a one-page PDF conversion. Triggers: long context, context rot, large codebase, many files, all files, big document, multi-document, PDF, aggregate, summarize everything, codebase-wide, multi-hop, recursive, sub-agents, map-reduce."
license: MIT
metadata:
  author: massimodeluisa
  version: "1.2.0"
  paper: https://arxiv.org/abs/2512.24601
---

# Recursive Decomposition

Long inputs rot. Details get missed, distant parts get glued together by guesswork, and the reasoning drifts. The RLM paper calls it context rot. Do not load the whole input into the window. Treat it as an environment you query: size it, narrow it, split it, hand independent parts to sub-agents, verify on a small window, synthesise in code. Based on [Recursive Language Models](https://arxiv.org/abs/2512.24601) (Zhang, Kraska, Khattab, 2025).

## How to use

- `/recursive-decomposition`: apply the protocol below to the current task.
- `/recursive-decomposition <path or question>`: size that input first, then run the protocol on it.

## When it applies

Fit is not the test. Dense work can rot inside a million-token window. In the paper, OOLONG-Pairs is 32k tokens and GPT-5 scores 0.1% F1; RLM(depth=1) reaches 58.0% (arXiv:2512.24601, Table 1). 30k and 50k below are harness caps.

| Situation | Approach |
|-----------|----------|
| One file, one function, or a single needle | Read directly |
| Linear aggregate or list-everything, and completeness matters | Decompose (this skill) |
| Pairwise, quadratic, or multi-hop across scattered sources | Decompose, even under 30k tokens |
| 10+ files or 50k+ tokens | Decompose |
| Under 30k tokens and a localised answer | Read directly |

## Protocol

1. **Size the input** before reading anything: count files (glob, `find`), lines (`wc -l`), bytes (`ls -lh`), pages for PDFs.
2. **Filter** the search space with searches (content search, file patterns, keywords, file types) before opening any file. Chain filters: file type, then keyword, then meaning.
3. **Chunk** what remains: natural units (functions, classes, sections), line ranges, or keyword partitions. Batches of 5 to 10 files.
4. **Recurse** at depth 1: one sub-agent per independent batch, self-contained brief (files, question, output schema); run one parallel wave. Write the batch count first. If more batches remain, run the next wave after the merge. Sub-agents answer; they do not spawn sub-agents.
5. **Verify** the synthesised answer on a smaller window: extract the minimal evidence and re-check it; settle disagreements with a targeted re-read.
6. **Synthesise programmatically**: aggregate the structured results, deduplicate, categorise, then write the answer with file and line references.

Report a problem

Foxx AIRecursive Decomposition
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.