tessl i github:ysyecust/everything-claude-code --skill iterative-retrievalPattern for progressively refining context retrieval to solve the subagent context problem
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.cppAssess 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.hppTask: "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.hppUse 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.7If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.