iterative-retrieval

Refine subagent context through iterative codebase retrieval cycles.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pattern for progressively refining context retrieval to solve the subagent context problem in multi-agent workflows where subagents don't know what context they need until they start working.

Core Features & Use Cases

  • Four-phase retrieval loop: DISPATCH, EVALUATE, REFINE, and LOOP, to incrementally surface relevant files.
  • Bounded iterations (max three cycles) to avoid overfetching and keep runtime predictable.
  • Practical examples including bug-fix context gathering and feature implementation in evolving codebases.
  • Clear integration guidance for agents, with explicit evaluation criteria to surface high-value context.

Quick Start

Begin the iterative retrieval cycle by invoking the task with the initial broad search to kick off DISPATCH.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I retrieve relevant codebase context for subagents when the required files are unknown upfront?

Use an iterative retrieval pipeline to progressively refine context for subagents over codebase files. It cycles through a four-phase loop—DISPATCH, EVALUATE, REFINE, and LOOP—to incrementally surface high-value files when the required context is not known upfront.

What is the best way to manage context size limits in multi-agent workflows?

Apply bounded iterative retrieval to manage context size limits in multi-agent workflows. It restricts the refinement loop to a maximum of three cycles, preventing overfetching and reducing context waste while surfacing necessary files.

How does the four-phase retrieval loop work for discovering codebase patterns?

The four-phase loop works by dispatching an initial broad search, evaluating results against explicit criteria, refining the query to surface high-value files, and looping up to three cycles. This incremental pattern discovery handles missing context in evolving codebases.

Can I use iterative retrieval for both bug-fix context gathering and feature implementation?

Yes, iterative retrieval applies to both bug-fix context gathering and feature implementation in evolving codebases. The four-phase loop evaluates and refines file searches whether the subagent task requires patching existing logic or building new features.

When should I avoid using iterative retrieval for subagent context management?

Avoid iterative retrieval when the exact codebase files needed by a subagent are already known upfront. Since the four-phase loop adds cycles to discover missing context dynamically, using it for predictable retrieval tasks introduces unnecessary overhead.