Iterative Retrieval Pattern
Fix the subagent context problem with Muse: a dispatch-evaluate-refine-loop that progressively sharpens codebase retrieval, capped at 3 cycles.
- What
- Fix the subagent context problem with Muse: a dispatch-evaluate-refine-loop that progressively sharpens codebase retrieval, capped at 3 cycles.
- Cost
- Free
- Needs
- Use "Iterative Retrieval Pattern" with your Muse.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor: a retrieval pattern that makes Muse solve the subagent context problem instead of guessing what a subagent needs upfront. The problem is real: subagents do not know which files contain the relevant code or what terminology the project uses, so sending everything blows the context limit and sending nothing leaves them blind. The solution is a four-phase loop, dispatch, evaluate, refine, loop, capped at three cycles: start with a broad keyword query, score each retrieved file on a 0 to 1 relevance scale with the reason and the missing context noted, refine the query by adding discovered patterns and terminology while excluding confirmed irrelevant paths, and repeat until three or more high-relevance files are found or the cap is hit. Worked examples show a bug-fix context retrieval and a feature-implementation retrieval where the second cycle discovers the codebase says throttle instead of rate limit. An agent-prompt snippet shows how to embed the pattern in instructions, and the best practices close with the line that matters: start broad and narrow progressively, learn the codebase terminology from the first cycle, and stop at good enough because three high-relevance files beat ten mediocre ones. By @affaan-m, listed here with credit to its creator. From the affaan-m/ECC repository (MIT). Honest caveats: the relevance scoring is heuristic, tune it to your retrieval backend; the three-cycle cap is a starting default, not a law; it optimizes retrieval, it does not guarantee the agent understands what it found. Skill Harbor never reviews the code, review it yourself before use.
Version:
Install
Copy the install package below, then paste it into MuseThe install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Use "Iterative Retrieval Pattern" with your Muse. Prerequisites: none to install. Pure guidance; a multi-agent setup helps. 1. Open the skill: https://github.com/affaan-m/ECC/blob/main/skills/iterative-retrieval/SKILL.md and copy the full SKILL.md text. 2. Paste it into a chat with Muse and add: "Design the retrieval loop for this subagent task: [describe the task]." 3. Ask follow-ups like "what should the first broad query be" or "which files scored above 0.7 and why?" Tip: cap at 3 cycles; 3 high-relevance files beat 10 mediocre ones. Safety: a skill is plain-text instructions; it runs nothing by itself. Review generated commands before running them.
Saved to your recent installs. Find it anytime on /connect.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.