Skip to content
affaan-m avatar

Iterative Retrieval

Progressive context retrieval pattern that solves the subagent context problem through repeated refinement.

CCM score
67 of 100
skills.sh installs
12.6K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a four-phase loop: dispatch, evaluate, refine, and loop, with a maximum of three cycles
  • Includes relevance scoring bands from 0.8 to 1.0 for direct implementations down to 0 to 0.2 for exclusions
  • Enforces an early stop once three or more files reach 0.7 relevance with no critical gaps remaining
  • Designed for multi-agent workflows where subagents cannot predict which files or terminology they need

Install

$ npx -y skills add affaan-m/ecc --skill iterative-retrieval -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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:

Details

Repository
github.com/affaan-m/ecc
Categories
Memory & Context, Agent Workflow & Planning
First seen
Jul 14, 2026

Questions

What does the iterative-retrieval skill do?

The iterative-retrieval skill applies a four-phase loop of dispatch, evaluate, refine and repeat to progressively refine context retrieval. It solves the subagent context problem, where subagents do not know which files or terminology they need until they start working.

How do I install the iterative-retrieval skill?

Run npx -y skills add affaan-m/ecc --skill iterative-retrieval -y in a project to install it. Once installed, the agent can retrieve candidate files, score their relevance and stop after at most three cycles with files scoring 0.7 or higher.

When should I use iterative-retrieval?

Use it when spawning subagents that need codebase context they cannot predict upfront, or when you hit context too large or missing context failures. It also fits RAG-like retrieval pipelines for code exploration and token use optimization in agent orchestration.

Where does iterative-retrieval rank in its category?

It is in the Memory & Context category and ranks in the top 25 on that category page. Other skills in the category include handoff and several caveman skills such as caveman-compress and caveman-stats.

More from affaan-m/ecc

All 257

Similar to Iterative Retrieval

More Memory & Context