iterative-retrieval

Run a 4-phase retrieval loop to gather high-relevance files for subagent tasks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Subagents often start with limited or unknown codebase context, especially in large repositories or during multi-file refactors. Iterative retrieval provides a structured 4-phase loop to progressively refine context while respecting token limits.

Core Features & Use Cases

  • Progressive context refinement across cycles to surface high-relevance files.
  • Suitable for large or unfamiliar codebases, onboarding, and targeted bug fixes.
  • Clear fallback when context is insufficient; enables deterministic task scoping.

Quick Start

Run the iterative retrieval loop to gather a small set of high-relevance files that provide sufficient context for the task.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I gather relevant codebase context for subagents in large repositories?

Gathering relevant codebase context for subagents is automated through a progressive retrieval loop that refines file relevance across multiple cycles. It uses a 4-phase loop to dispatch, evaluate, and refine context, returning high-quality files while respecting token limits.

What is the best way to scope multi-file refactors when agent context is limited?

Scoping multi-file refactors with limited agent context is handled by iterative retrieval, which progressively surfaces high-relevance files. It runs a maximum of three cycles to infer file relevance, providing a deterministic fallback when initial context is insufficient.

How does progressive context refinement work for codebase onboarding?

Progressive context refinement for codebase onboarding works by applying a relevance scoring model across a 4-phase loop. It dispatches retrieval tasks, evaluates file relevance, refines the scope, and loops up to three times to ensure subagents receive sufficient context.

Can I use iterative retrieval for targeted bug fixes in unfamiliar codebases?

Yes, iterative retrieval is suitable for targeted bug fixes in unfamiliar codebases. It progressively narrows down file relevance through evaluation and refinement cycles, ensuring subagents operate with high-quality context without exceeding token limits.

What happens when subagents start with unknown codebase context?

When subagents start with unknown codebase context, the iterative retrieval loop provides a clear fallback by progressively inferring file relevance. It evaluates and refines context over up to three cycles, ensuring deterministic task scoping even in large repositories.

Are there limitations to the iterative retrieval loop for context gathering?

The iterative retrieval loop limits context gathering to a maximum of three refinement cycles. This constraint ensures token limits are respected, but means extremely large or highly dispersed codebases may require additional scoping if high-relevance files are not surfaced within the cycle limit.