recursive-decomposition

recursive-decomposition is a skill for Claude Code from massimodeluisa/recursive-decomposition-skill. It costs 151 tokens per session (1,500 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; mentions Claude Code; mentions Codex.

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,500 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.00151 $0.01500
Opus 5 $0.00076 $0.00750
Sonnet 5 $0.00030 $0.00300
Haiku 4.5 $0.00015 $0.00150

Measured 8d ago against content hash 5b4cdc9babe2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 8d 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 · 100 lines

How it starts

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

Recursive Decomposition

Long inputs degrade model quality: details get missed, distant parts get linked by guesswork, reasoning drifts. The RLM paper calls it context rot. Instead of loading everything into the context window, treat the input as an environment you query with tools: size it, narrow it, split it, delegate independent parts to sub-agents, verify on small windows, and merge results programmatically. 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

Situation Approach
10+ files, 50k+ tokens, or a multi-hop question across scattered sources Decompose (this skill)
30k to 50k tokens Decompose when completeness matters; otherwise read directly
Under 30k tokens, one file, or a localized 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: give each independent batch to a sub-agent with a self-contained brief (files, question, output schema); run batches in parallel.
  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.

Rules

  • MUST size the input before reading it
  • MUST search before reading a directory; NEVER list a tree recursively as a substitute for search
  • MUST read large files by line range: over 2,000 lines or 50 KB never in one read; PDFs over 100 pages or 30 MB by metadata or split
  • NEVER load more than 5 files into the main context without a written batch plan
  • MUST give every sub-agent its own context: the files, the question, the output schema
  • MUST spot-check the synthesised result against the sources before answering
  • SHOULD read definitions first (grep -n "function") and bodies later; tables of contents and abstracts before full text
  • NEVER run the same query over the same content in several sub-agents; partition once into disjoint batches

Read the full file on GitHub · 100 lines

Files

What ships with it

4 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. 8d 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 (46 stars, last pushed 10d ago), licensed MIT. It adds 151 tokens to every session and 1,500 once invoked, about $0.0008 per session on Opus 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

security-audit

Conduct a security-led audit of code, systems, APIs, infrastructure, dependencies, and AI workflows with threat modeling and exploitability-backed remediation. Use when security risk is the primary concern. Do not use for a generic code review, database design, or non-security debugging.

Noorkhalel/saas-ai-skills · 58 tokens

architecture-planning

Plan the future architecture of a new or materially changing system before implementation. Use for greenfield products, planned platform changes, and technical blueprints spanning components, data, APIs, deployment, and delivery trade-offs. Do not use to audit an existing repository, review a PR, or diagnose an…

Noorkhalel/saas-ai-skills · 64 tokens

code-review

Review a specific implementation, change set, PR, function, or service for broad correctness and production-readiness findings. Use when code-quality is the primary concern. Do not use when security, performance, architecture, dependencies, or tests are the exclusive requested discipline.

Noorkhalel/saas-ai-skills · 55 tokens

database-design

Design, review, or evolve a database schema and its data-integrity, tenancy, migration, indexing, and operational model. Use when the primary deliverable is a datastore or schema decision. Do not use for general system planning, query debugging, or generic dependency/security review.

Noorkhalel/saas-ai-skills · 58 tokens

debugging

Investigate and safely fix an active, observable software failure, error, regression, or unexpected behavior using reproduction and evidence. Use for the proximate technical cause and remediation. Do not use for a systemic incident postmortem or general performance tuning without a failure.

Noorkhalel/saas-ai-skills · 55 tokens

performance-optimization

Measure, diagnose, and improve a performance or capacity objective?latency, throughput, CPU, memory, scalability, or cost?without regressing correctness. Use when performance is the primary requested outcome. Do not use for generic code cleanup or an unmeasured incident postmortem.

Noorkhalel/saas-ai-skills · 61 tokens