
Iterative Retrieval
This is a pattern for dealing with the classic multi-agent problem where subagents don't know what context they need until they're already working. Instead of dumping everything or guessing, you run a three-cycle loop: dispatch a broad search, evaluate what's actually relevant, refine your query based on what you learned, repeat. It learns your codebase's terminology on the fly, which is honestly the part that matters most. The 0-1 relevance scoring keeps you from wasting tokens on tangentially related files. If you're orchestrating agents that spawn subagents, or you keep hitting context limit errors because you're sending too much or task failures because you sent too little, this gives you the progressive refinement structure to fix it.
- skills.sh installs
- 5.6K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill iterative-retrieval --agent claude-codeInstalls into .claude/skills of the current project.
Files
Iterative Retrieval Pattern
Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
When to Activate
- Spawning subagents that need codebase context they cannot predict upfront
- Building multi-agent workflows where context is progressively refined
- Encountering "context too large" or "missing context" failures in agent tasks
- Designing RAG-like retrieval pipelines for code exploration
- Optimizing token usage in agent orchestration
The Problem
Subagents are spawned with limited context. They don't know:
- Which files contain relevant code
- What patterns exist in the codebase
- What terminology the project uses
Standard approaches fail:
- Send everything: Exceeds context limits
- Send nothing: Agent lacks critical information
- Guess what's needed: Often wrong
The Solution: Iterative Retrieval
A 4-phase loop that progressively refines context:
Sponsors
Details
More from affaan-m/everything-claude-code
All 256- Agent Harness Construction5.5K
- Configure Ecc5.5K
- Nutrient Document Processing5.5K
- Search First5.5K
- Verification Loop5.5K
- Agentic Engineering5.4K
- Cost Aware Llm Pipeline5.4K
- Django Verification5.4K
- Springboot Verification5.4K
- Codebase Onboarding5.3K
- Deep Research5.3K
- Rust Testing5.3K
- Ai First Engineering5.2K
- Autonomous Loops5.2K
- Content Engine5.2K
- Content Hash Cache Pattern5.2K
- Kotlin Coroutines Flows5.2K
- Swiftui Patterns5.2K
- Investor Materials5.1K
- Laravel Tdd5.1K
- Regex Vs Llm Structured Text5.1K
- Compose Multiplatform Patterns5K
- Continuous Agent Loop5K
- Foundation Models On Device5K