Progressively refines codebase context retrieval for subagents in multi-agent workflows via a 4-phase loop of dispatch, evaluate, refine, and loop up to 3 cycles. Useful for context limits, missing info, or RAG-like code exploration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:iterative-retrievalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
Subagents are spawned with limited context. They don't know:
Standard approaches fail:
A 4-phase loop that progressively refines context:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────▶│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │◀─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ Max 3 cycles, then proceed │
└─────────────────────────────────────────────┘
Initial broad query to gather candidate files:
Start with high-level intent:
patterns: src/**/*.cpp, include/**/*.hpp
keywords: relevant domain terms
excludes: *_test.cpp, *_bench.cpp
Assess retrieved content for relevance:
Scoring criteria:
Update search criteria based on evaluation:
Repeat with refined criteria (max 3 cycles).
Stop when:
Task: "Fix the memory leak in the particle solver"
Cycle 1:
DISPATCH: Search for "particle", "solver", "allocat" in src/**
EVALUATE: Found particle_solver.cpp (0.9), memory_pool.hpp (0.8), main.cpp (0.3)
REFINE: Add "arena", "pool" keywords; exclude main.cpp
Cycle 2:
DISPATCH: Search refined terms
EVALUATE: Found arena_allocator.hpp (0.95), smart_ptr_utils.hpp (0.85)
REFINE: Sufficient context (4 high-relevance files)
Result: particle_solver.cpp, memory_pool.hpp, arena_allocator.hpp, smart_ptr_utils.hpp
Task: "Add MPI communication to the mesh partitioner"
Cycle 1:
DISPATCH: Search "MPI", "mesh", "partition" in src/**
EVALUATE: No matches for "MPI" - codebase uses "comm" namespace
REFINE: Add "comm::", "distribute", "scatter" keywords
Cycle 2:
DISPATCH: Search refined terms
EVALUATE: Found comm_layer.hpp (0.9), mesh_partition.cpp (0.7)
REFINE: Need data serialization patterns
Cycle 3:
DISPATCH: Search "serialize", "pack", "buffer" patterns
EVALUATE: Found serializer.hpp (0.8)
REFINE: Sufficient context
Result: comm_layer.hpp, mesh_partition.cpp, serializer.hpp
Use in agent prompts:
When retrieving context for this task:
1. Start with broad keyword search
2. Evaluate each file's relevance (0-1 scale)
3. Identify what context is still missing
4. Refine search criteria and repeat (max 3 cycles)
5. Return files with relevance >= 0.7
continuous-learning skill - For patterns that improve over timeagents/)npx claudepluginhub ysyecust/everything-claude-code --plugin everything-claude-codeProgressively refines context retrieval for subagents that don't know what context they need upfront. Uses a 4-phase dispatch-evaluate-refine-loop pattern to solve multi-agent context problems.
Pattern for progressively refining context retrieval in multi-agent systems, enabling subagents to discover relevant context through iterative dispatch, evaluation, and refinement cycles.
Enables /code orchestrators to iteratively refine sub-agent queries through a 4-phase protocol with follow-ups, ensuring sufficient context for incomplete summaries due to semantic gaps.