iterative-retrieval

Refines codebase context retrieval through iterative dispatch, evaluate, and refine cycles.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill iterative-retrieval-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/iterative-retrieval
Command: npx skills add https://github.com/ibytechaos/claude --skill iterative-retrieval-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Subagents in multi-agent workflows are spawned with limited context and cannot predict which files or patterns they need upfront, leading to context overflow, missing information, or failed tasks. ## Core Features & Use Cases - Four-Phase Retrieval Loop: Dispatch broad queries, evaluate file relevance on a 0-1 scale, refine search criteria from discovered terminology, and loop up to 3 cycles. - Relevance Scoring and Gap Detection: Scores candidate files, identifies missing context, and excludes confirmed irrelevant paths to optimize token usage. - Use Case: When fixing an authentication token expiry bug, the agent starts with broad keywords like "token" and "auth", discovers the codebase uses "jwt" and "refresh" terminology, refines the query, and converges on the four high-relevance files needed for the fix. ## Quick Start Use the iterative-retrieval pattern to gather the right codebase context for fixing the authentication token expiry bug, refining the search over up to three cycles.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I give subagents the right codebase context?

Use iterative retrieval: start with a broad keyword search, score each file's relevance on a 0-1 scale, identify missing context, then refine the query and repeat up to 3 cycles. Return files scoring 0.7 or higher.

How to reduce token usage in multi-agent workflows?

Iterative retrieval reduces token usage by sending only high-relevance files instead of entire codebases. Low-relevance files are excluded after evaluation, and the loop stops once roughly three high-relevance files are found.

What is iterative retrieval for code search?

Iterative retrieval is a 4-phase loop (dispatch, evaluate, refine, loop) that progressively narrows file searches. Each cycle learns codebase terminology from previous results, so later queries match the project's actual naming conventions.

Why do subagents fail with missing context errors?

Subagents fail because they are spawned without knowing which files, patterns, or terminology the codebase uses. Sending everything exceeds context limits while sending nothing lacks critical information; iterative refinement resolves this trade-off.

When should I stop the retrieval loop?

Stop when you have at least three files with relevance scores of 0.7 or higher and no critical context gaps remain. The pattern caps execution at 3 cycles to prevent unbounded searching, then proceeds with the best context gathered.