Pattern for progressively refining context retrieval to solve the subagent context problem.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 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:
```
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────│ EVALUATE │ │
…
The line at the top of this page pins the label git:20260512.6523792, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_p3mzi4nz7huhm5bc
GET https://markdownregistry.com/api/v1/resolve?ref=hashgraph-online/awesome-codex-plugins/iterative-retrieval
GET https://markdownregistry.com/api/v1/blob/1f8f1498c023961760ded33db22964645d23b100eeba531e3318a6072765997f
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
hashgraph-online/awesome-codex-plugins · .agents/skills/list-my-plugin/SKILL.md · Add a Codex plugin to the awesome-codex-plugins README as one correctly placed line, check it locally, and finish with…
hashgraph-online/awesome-codex-plugins · plugins/321zz321/computefirst-skill/skills/computefirst/SKILL.md · Use ComputeFirst for exact or deterministic computation when model-side arithmetic or manual transformation risks being…
hashgraph-online/awesome-codex-plugins · plugins/6Delta9/task-scheduler-codex-plugin/skills/task-planner/SKILL.md · Turn a list of goals, tasks, deadlines, and working constraints into a practical schedule with next actions and…
hashgraph-online/awesome-codex-plugins · plugins/6jeffr3y/burpsuite-mcp-bridge/skills/use-burpsuite-mcp-bridge/SKILL.md · Operate BurpSuite MCP Bridge for professional, authorized web testing. Use when Codex needs to inspect Burp…
bradygaster/squad · .github/skills/iterative-retrieval/SKILL.md · Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to…
bradygaster/squad · packages/squad-cli/templates/skills/iterative-retrieval/SKILL.md · Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to…
bradygaster/squad · packages/squad-sdk/templates/skills/iterative-retrieval/SKILL.md · Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to…
bradygaster/squad · .squad-templates/skills/iterative-retrieval/SKILL.md · Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to…
microsoft/waza · .github/skills/iterative-retrieval/SKILL.md · Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to…
jnpiyush/agentx · .github/skills/ai-systems/iterative-retrieval/SKILL.md · Progressive context refinement for subagents and tool-using LLMs. Use when a parent agent must delegate research, code…
frankxai/agentic-creator-os · .claude/skills/iterative-retrieval/SKILL.md · Pattern for progressively refining context retrieval to solve the subagent context problem