iterative-retrieval

Iteratively search and refine code context for agent tasks in large repositories.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill iterative-retrieval-mostafa-ismail-2004
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/mostafa-ismail-2004/codex-plugin/tree/main/skills/iterative-retrieval
Command: npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill iterative-retrieval-mostafa-ismail-2004

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps agents find the right codebase context when they cannot know upfront which files matter, avoiding wasted tokens, incomplete retrieval, and guesswork.

Core Features & Use Cases

  • Progressive context discovery: Starts with a broad search, evaluates relevance, and narrows the search based on what was found.
  • Gap-driven refinement: Identifies missing context and adjusts keywords, patterns, and exclusions to improve retrieval quality.
  • Multi-agent workflows: Useful when spawning subagents for debugging, feature work, or architecture analysis across large repositories.
  • Use Case: A subagent debugging an authentication issue can begin with broad auth-related files, score what it finds, then refine toward session, token, and refresh logic.

Quick Start

Use the iterative-retrieval skill to gather context for this task by starting broad, evaluating relevance, refining the query, and repeating 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 find the right codebase context for agent tasks when I don't know which files matter?

Iterative codebase context retrieval starts with a broad search, evaluates relevance scores, and progressively narrows results using query refinement. This gap-driven approach identifies missing context and adjusts keywords across up to three bounded cycles to locate the necessary files.

What is the best way to explore a large repository for multi-agent debugging workflows?

Multi-agent debugging in large repositories benefits from iterative context discovery. A subagent begins with broad related files, scores what it finds, then refines the search toward specific logic like session and token handling, ensuring complete retrieval without wasted tokens.

How does query refinement improve code exploration in complex repositories?

Query refinement improves code exploration by applying gap detection after an initial broad search. It identifies missing context from retrieved results and adjusts search patterns and exclusions, progressively increasing relevance scoring quality for accurate file discovery.

Can I use iterative search for feature implementation when initial information is incomplete?

Yes, iterative search supports feature implementation tasks that begin with incomplete information. It applies progressive context discovery and bounded loops to evaluate and refine search results, ensuring the agent gathers the specific code context needed.

Why does my agent waste tokens on incomplete codebase retrieval during architecture analysis?

Incomplete codebase retrieval wastes tokens when agents guess at relevant files upfront. Iterative retrieval avoids this by applying relevance scoring and gap-driven refinement, systematically narrowing the search to ensure the right files appear without unnecessary exploration.