iterative-retrieval

Retrieve and refine relevant codebase files through iterative dispatch-evaluate-refine loops.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/gugug168/claudecode-tutorial --skill iterative-retrieval-gugug168
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/gugug168/claudecode-tutorial/tree/main/everything-claude-code-learning/02-Skills/iterative-retrieval
Command: npx skills add https://github.com/gugug168/claudecode-tutorial --skill iterative-retrieval-gugug168

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Iterative retrieval addresses the missing-or-excessive context problem for child agents by progressively discovering and refining the small set of code files needed to complete a task without sending the entire repository.

Core Features & Use Cases

  • Iterative dispatch-evaluate-refine loop: start broad, score candidates, extract gaps, and refine queries up to a bounded number of cycles.
  • Relevance scoring and early exit: rank files by relevance, identify critical context gaps, and stop once sufficient high-relevance files are found.
  • Query and pattern learning: automatically discover project terminology and file patterns (e.g., auth, jwt, middleware) to focus subsequent searches.
  • Use Cases: bug triage (e.g., token expiry), feature implementation (e.g., add rate limiting), and RAG-style code exploration where exact terms are unknown.

Quick Start

Use iterative retrieval to find and return the top relevant source files for the task: fix authentication token expiry.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I find relevant code context in a large repository without sending the entire codebase to the agent?

Iterative retrieval progressively discovers and refines the small set of code files needed for a task. It uses a dispatch-evaluate-refine loop to rank files by relevance and stop early once sufficient context is found.

How does iterative retrieval work for RAG-style code exploration?

RAG-style code exploration applies a bounded dispatch-evaluate-refine loop, scoring file relevance and expanding queries with discovered patterns. It automatically learns project terminology and file patterns to focus subsequent searches up to three cycles.

Can I use iterative retrieval for bug triage when I don't know the exact search terms?

Bug triage benefits from iterative retrieval's query and pattern learning, which automatically discovers project terminology like auth or jwt. It starts broad and refines searches to locate relevant source files even when exact terms are unknown.

What is the best way to retrieve code context for multi-agent feature implementation workflows?

Multi-agent code exploration workflows use iterative retrieval to retrieve and progressively refine relevant codebase context. The process ranks files by relevance, extracts context gaps, and converges after finding high-relevance files for feature implementation.

Does iterative retrieval stop searching automatically or run a fixed number of cycles?

Iterative retrieval stops on convergence or after three cycles. It features early exit capabilities, halting the dispatch-evaluate-refine loop once sufficient high-relevance files are found and critical context gaps are identified.

Why does my RAG repository retrieval return irrelevant code files for complex tasks?

RAG repository retrieval may return irrelevant files without iterative context refinement. Applying iterative dispatch-evaluate-refine loops ranks files by relevance score and expands queries with discovered patterns to filter out excessive context.