recursive-decomposition

recursive-decomposition is a skill for Claude Code from massimodeluisa/recursive-decomposition-skill. It costs 144 tokens per session (2,158 once invoked), scanned A, original, MIT.

A procedure for splitting very large tasks into smaller parts, processing them separately, checking the results, and combining them.

In plain words
What is it for?
It is for sizing inputs, filtering relevant material, dividing work among sub-agents, verifying smaller sections, and synthesising the final result.
Why use it?
It reduces missed details and confusion when the full task is too large to handle reliably at once.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; positional $N argument; mentions Claude Code.

Part of the recursive-decomposition plugin — 1 skill shipped together

Good fit It is for sizing inputs, filtering relevant material, dividing work among sub-agents, verifying smaller sections, and synthesising the final result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add massimodeluisa/recursive-decomposition-skill --skill recursive-decomposition
Clone the repo
git clone --depth 1 https://github.com/massimodeluisa/recursive-decomposition-skill

Made for: Claude Code.

Or install recursive-decomposition, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for recursive-decomposition

README.md
[![agentmods](https://agentmods.dev/badge/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition/github.svg)](https://agentmods.dev/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition)
Your own site
<a href="https://agentmods.dev/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition"><img src="https://agentmods.dev/badge/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for recursive-decomposition

Your own site · 80×15
<a href="https://agentmods.dev/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition"><img src="https://agentmods.dev/badge/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,158 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Data Exfiltration · line 73
    Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.
    Fix: Remove any code that sends prompts, responses, or session data externally. Preserve user privacy; never exfiltrate conversation content.
  • medium Memory Poisoning · line 3
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.02158
Opus 5.5 $0.00058 $0.00863
Sonnet 5.5 $0.00029 $0.00432
Haiku 4.5 $0.00014 $0.00216

Measured 1mo ago against content hash 5fd29fab49e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

recursive-decomposition scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/recursive-decomposition/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 (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.

Read the full file on GitHub · 117 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +17 lines · -7 tokens per session 5fd29fab49e9
  2. 1mo ago First seen · 100 lines · 151 tokens per session scan A 5b4cdc9babe2

Subscribe to this mod's changes

recursive-decomposition is a skill published in the GitHub repository massimodeluisa/recursive-decomposition-skill (52 stars, last pushed 1mo ago), licensed MIT. It adds 144 tokens to every session and 2,158 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

feature-dev

Take one new feature slice from idea to reviewed, committed code in a single guided pass — scope it into the smallest shippable slice, build it test-first with strict TDD, review and fix the diff, then commit it. Chains slice → test-driven-development → the built-in /code-review → git-commit. Not for reviewing an…

thoughtbot/rails-consultant · 83 tokens

test-driven-development

Strict red-green-refactor TDD workflow for implementing features, fixing bugs, or changing behavior in Rails applications. Enforces the discipline of writing a failing test before any production code. Use whenever you want to implement with TDD — whether a new feature, a bugfix, a refactor, or any behavior change.

thoughtbot/rails-consultant · 68 tokens

git-commit

Turn the working changes into one or more atomic commits with well-written messages. Use whenever the user runs /git-commit or asks to commit their work, wrap up a feature, or "commit what I have.".

thoughtbot/rails-consultant · 47 tokens

csift

Reads, searches and counts Claude Code session transcripts (the .jsonl files under /.claude/projects, subagents too) with the csift command-line tool, and ships hooks that re-inject compacted turns or record pending questions. Use when asked what a past or running session said, did, edited, spent or is doing now; when…

wdhwg001/csift · 227 tokens

socratic-review

Socratic code review and refactoring session — whether it's your own code, a teammate's PR, or something you inherited. Leads you to see the issues through questions, names smells and moves precisely, then closes with a concrete plan.

thoughtbot/rails-consultant · 51 tokens

slice

Turn a feature into well-defined, independently shippable slices — whether it's an epic that needs breaking apart or a single story that needs sharpening into a job story.

thoughtbot/rails-consultant · 34 tokens