iterative-retrieval

Iteratively search, score, and refine file retrieval for subagent context.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/beratcelik1/compound-claude --skill iterative-retrieval-beratcelik1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/beratcelik1/compound-claude/tree/main/skills/iterative-retrieval
Command: npx skills add https://github.com/beratcelik1/compound-claude --skill iterative-retrieval-beratcelik1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Subagents in multi-agent workflows often receive either too much irrelevant context or too little relevant context, causing failures, wasted tokens, and incorrect outputs; this pattern provides a structured loop to progressively find the right context without overloading the system.

Core Features & Use Cases

  • Iterative search loop: Dispatch a broad keyword search, evaluate relevance, refine queries, and repeat up to a bounded number of cycles.
  • Relevance scoring: Rank files with a 0–1 score to select high-value context and exclude low-relevance noise.
  • Practical uses: Useful for targeted bug fixes, focused code reviews, and agent orchestration where initial context needs discovery and token budgets must be respected.

Quick Start

Use the iterative-retrieval pattern to refine context for a task by starting with broad keywords and running up to three search-evaluate-refine cycles to return files scoring >= 0.7.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I optimize context retrieval for subagents in multi-agent workflows?

Context retrieval for subagents is optimized by iteratively searching, evaluating relevance, and narrowing results up to three cycles to progressively find the right context without overloading the system.

Why do my subagents fail when I pass too much or too little context for targeted bug fixes?

Subagents fail with incorrect context because they receive irrelevant noise or insufficient data, causing wasted tokens; a structured iterative search loop with relevance scoring progressively finds the right context.

How do I refine queries and exclude low-relevance files during code search?

Query refinement and exclusion of low-relevance files are achieved by ranking files with a 0–1 relevance score, selecting high-value context, and refining search keywords across multiple bounded cycles.

When should I use iterative search cycles for agent orchestration?

Iterative search cycles should be used for agent orchestration when initial context needs discovery, such as focused code reviews or targeted bug fixes, and token budgets must be respected.

What is the maximum number of search loops for context retrieval before stopping?

The maximum number of search loops for context retrieval is three cycles, or the loop stops immediately upon discovery of sufficient high-relevance files scoring 0.7 or above.

Does iterative context retrieval work for focused code reviews with strict token budgets?

Iterative context retrieval works for focused code reviews with strict token budgets by applying relevance scoring and query refinement to exclude low-relevance paths and return only high-value context.