iterative-retrieval

Retrieve relevant codebase context for subagents through iterative refinement cycles.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the common issue of subagents lacking the correct codebase context when spawned for multi-agent workflows, eliminating failures caused by missing information or context limit overflows from sending excessive unfiltered data.

Core Features & Use Cases

  • 4-Phase Iterative Loop: Implements a dispatch, evaluate, refine, loop workflow to progressively narrow down relevant context without exceeding token limits.
  • Relevance Scoring: Ranks retrieved files on a 0-1 scale to prioritize high-value context and exclude irrelevant content automatically.
  • Codebase Terminology Discovery: Automatically learns project-specific naming conventions and patterns during retrieval cycles to improve search accuracy.
  • Use Case Example: When spawning a subagent to fix an authentication bug, use this pattern to first retrieve broad auth-related files, then refine the search to find session and JWT utility files in the second cycle.

Quick Start

Use the iterative-retrieval skill to gather all relevant codebase context for the subagent task of implementing rate limiting for public API endpoints.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I prevent subagent context overflow in multi-agent workflows?

To prevent subagent context overflow in multi-agent workflows, use a progressive retrieval loop that dispatches, evaluates, and refines queries iteratively. This approach applies relevance scoring to filter files, ensuring subagents receive targeted context without exceeding token limits.

What is the best way to retrieve targeted context for codebase exploration agents?

The best way to retrieve targeted context for codebase exploration is using an iterative retrieval pattern. It automatically discovers project-specific naming conventions during retrieval cycles and ranks retrieved files on a 0-1 relevance scale to prioritize high-value code context.

How does iterative query refinement work for RAG pipeline design?

Iterative query refinement for RAG pipeline design works by progressively narrowing relevant context through a maximum of 3 retrieval cycles. It evaluates and refines search queries based on relevance scores to optimize token usage and improve retrieval accuracy.

Can I use iterative retrieval to gather context for subagent tasks like fixing authentication bugs?

Yes, you can use iterative retrieval to gather context for subagent tasks like fixing authentication bugs. It first retrieves broad auth-related files, then refines the search in subsequent cycles to find specific session and JWT utility files without exceeding token limits.

What are the limitations of using progressive context retrieval for agent orchestration?

A key limitation of progressive context retrieval for agent orchestration is the maximum cap of 3 retrieval cycles. This constrains the depth of iterative query refinement, meaning highly fragmented codebases may still lack complete context if the pattern cannot be found within three iterations.