iterative-retrieval

Refine file selection across four phases for subagent context.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/thmspi/claude-setup --skill iterative-retrieval-thmspi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/thmspi/claude-setup/tree/main/.claude/skills/iterative-retrieval
Command: npx skills add https://github.com/thmspi/claude-setup --skill iterative-retrieval-thmspi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Iterative retrieval addresses the challenge of providing subagents with relevant, sufficient context in large codebases where context windows are limited, by progressively refining what to include.

Core Features & Use Cases

  • 4-phase loop: DISPATCH, EVALUATE, REFINE, LOOP to iteratively narrow the results.
  • Context-aware filtering: exclude low-relevance files and expand search terms based on results.
  • Use Case: when subagents must explore a codebase without knowing exactly which files are relevant upfront.

Quick Start

Start a 3-cycle iterative retrieval to gather high-relevance files for the given task.

Frequently Asked Questions about iterative-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refine context for subagents in a large codebase?

To refine context for subagents in a large codebase, use iterative retrieval to progressively narrow down relevant files. This approach enforces a 4-phase loop to filter low-relevance files and produce a concise set of high-relevance context for multi-agent workflows.

What is the best way to gather relevant files for codebase exploration with limited context windows?

The best way to gather relevant files for codebase exploration with limited context windows is iterative retrieval. It applies explicit relevance scoring and dynamic query refinement across a max of three cycles to extract only the most high-relevance files for the agent.

How does the iterative retrieval pattern work for multi-agent workflows?

The iterative retrieval pattern works for multi-agent workflows by executing a 4-phase loop: DISPATCH, EVALUATE, REFINE, and LOOP. It evaluates subagent context, scores file relevance, and dynamically expands search terms to narrow results over a maximum of three cycles.

When do I need iterative retrieval for subagent context?

You need iterative retrieval for subagent context when subagents must operate with uncertain or expanding context, such as during bug triage or feature development. It is specifically designed for scenarios where context windows are limited and upfront file relevance is unknown.

Does context-aware filtering help with bug triage in multi-agent systems?

Yes, context-aware filtering helps with bug triage in multi-agent systems by excluding low-relevance files and expanding search terms based on evaluation results. This ensures subagents receive a refined, high-relevance set of files for accurate triage.

What are the limitations of using a 3-cycle iterative retrieval loop?

The limitation of using a 3-cycle iterative retrieval loop is that it enforces a strict maximum of three cycles to produce a concise set of high-relevance files. This caps the depth of context refinement for complex codebase exploration or feature development tasks.