iterative-retrieval

Refine retrieved context across iterative cycles for subagent workflows.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/linnefromice/claude-code-workspace --skill iterative-retrieval-linnefromice
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/linnefromice/claude-code-workspace/tree/main/template-.claude/skills/iterative-retrieval
Command: npx skills add https://github.com/linnefromice/claude-code-workspace --skill iterative-retrieval-linnefromice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In multi-agent workflows, subagents often start work with incomplete or uncertain context. Standard approaches such as sending everything or nothing can overwhelm the context window or leave critical details missing, leading to poor decisions. This Skill provides a structured method to incrementally refine the knowledge available to subagents, reducing waste while preserving essential information.

Core Features & Use Cases

  • Four-phase loop: DISPATCH, EVALUATE, REFINE, LOOP to progressively narrow down relevant context.
  • Context scoring: files are scored for relevance, enabling selective inclusion of high-value material.
  • Controlled cycles: up to a configurable number of iterations (default 3) to avoid overfitting or endless search.
  • Use Case: When diagnosing a bug in a large codebase, iteratively gather candidate files, prune irrelevant ones, and assemble a concise, high-signal context for the subagent.

Quick Start

Use an initial broad query to collect candidate files. Evaluate the relevance of each candidate and identify missing context. Refine the search conditions based on evaluation results and repeat up to three cycles. Return the set of high-relevance files that cover 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 retrieve relevant context for subagents in a large codebase without overloading the context window?

Iterative context retrieval progressively narrows down relevant files for subagents through a four-phase loop of dispatching, evaluating, refining, and looping. This structured method selectively includes high-value material, reducing waste while preserving essential information needed for accurate decisions.

What is the best way to gather candidate files when diagnosing a bug across a multi-agent workflow?

The best way to gather candidate files for bug diagnosis is using an initial broad query to collect candidates, evaluating relevance scores, and refining search conditions. This iterative query refinement repeats up to a configurable limit, returning a concise, high-signal context set.

How does context scoring work for multi-agent subagent file retrieval?

Context scoring evaluates retrieved files for relevance during the EVALUATE phase, enabling selective inclusion of high-value material. Files are scored to identify relevant patterns and terms, allowing the system to prune irrelevant ones and assemble a concise context for the subagent.

Can I configure the maximum number of retrieval cycles for subagent context refinement?

Yes, you can configure the maximum number of retrieval cycles for subagent context refinement. The system enforces a controlled cycle limit, defaulting to three iterations, to prevent overfitting or endless search while progressively narrowing down relevant context.

Why does my subagent make poor decisions due to incomplete context in a multi-agent workflow?

Subagents make poor decisions because standard approaches like sending everything or nothing overwhelm the context window or leave critical details missing. Applying an iterative retrieval loop with high-relevance scoring incrementally refines knowledge, ensuring essential information is preserved.

When should I avoid using iterative query refinement for codebase context retrieval?

You should avoid iterative query refinement when a single broad query sufficiently captures necessary context, or if the codebase is small enough that overfitting could occur. The controlled cycle limit prevents endless search, but simple tasks may not require progressive refinement.