Agent skill

Iterative Retrieval

by affaan-m in affaan-m/ECC

서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴. An agent skill from affaan-m/ECC.

MITAuto-check passed

Install Iterative Retrieval

skills CLI
$ npx skills add affaan-m/ECC --skill iterative-retrieval -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC iterative-retrieval --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/ko-KR/skills/iterative-retrieval .claude/skills/iterative-retrieval && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
iterative-retrieval
GitHub stars
277k
Used in
2 other repos
Token cost
~1.3k tokens
SKILL.md length
254 words
Files
1
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴. An agent skill from affaan-m/ECC.

  • Works in 5 steps: 광범위하게 시작하여 점진적으로 좁히기 - 초기 쿼리를 과도하게 지정하지 않기 → 코드베이스 용어 학습 - 첫 번째 사이클에서 주로 네이밍 컨벤션이 드러남 → 누락된 것 추적 - 명시적 격차 식별이 개선을 주도 → …
  • SKILL.md covers 활성화 시점, 문제, 해결책: 반복적 검색 and 실용적인 예시, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Iterative Retrieval is an agent skill from affaan-m/ECC. 서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

Example prompts

  • “/iterative-retrieval”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 광범위하게 시작하여 점진적으로 좁히기 - 초기 쿼리를 과도하게 지정하지 않기
  2. 코드베이스 용어 학습 - 첫 번째 사이클에서 주로 네이밍 컨벤션이 드러남
  3. 누락된 것 추적 - 명시적 격차 식별이 개선을 주도
  4. "충분히 좋은" 수준에서 중단 - 관련성 높은 파일 3개가 보통 수준의 파일 10개보다 나음
  5. 자신 있게 제외 - 관련성 낮은 파일은 관련성이 높아지지 않음

What it can do on your machine

Read from SKILL.md and the folder at commit 2d515e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • x.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Iterative Retrieval loads about 1.3k tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 254 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 2d515e4, republished under its MIT licence (© affaan-m). 254 words, ~1,311 tokens.

Download SKILL.mdSave it as .claude/skills/iterative-retrieval/SKILL.md (or your agent's skills folder).
name
iterative-retrieval
description
서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴
origin
ECC

반복적 검색 패턴

서브에이전트가 작업을 시작하기 전까지 필요한 컨텍스트를 알 수 없는 멀티 에이전트 워크플로우의 "컨텍스트 문제"를 해결합니다.

활성화 시점

  • 사전에 예측할 수 없는 코드베이스 컨텍스트가 필요한 서브에이전트를 생성할 때
  • 컨텍스트가 점진적으로 개선되는 멀티 에이전트 워크플로우를 구축할 때
  • 에이전트 작업에서 "컨텍스트 초과" 또는 "컨텍스트 누락" 실패를 겪을 때
  • 코드 탐색을 위한 RAG 유사 검색 파이프라인을 설계할 때
  • 에이전트 오케스트레이션에서 토큰 사용량을 최적화할 때

문제

서브에이전트는 제한된 컨텍스트로 생성됩니다. 다음을 알 수 없습니다:

  • 관련 코드가 포함된 파일
  • 코드베이스에 존재하는 패턴
  • 프로젝트에서 사용하는 용어

표준 접근법의 실패:

  • 모든 것을 전송: 컨텍스트 제한 초과
  • 아무것도 전송하지 않음: 에이전트가 중요한 정보를 갖지 못함
  • 필요한 것을 추측: 종종 잘못됨

해결책: 반복적 검색

컨텍스트를 점진적으로 개선하는 4단계 루프:

┌─────────────────────────────────────────────┐
│                                             │
│   ┌──────────┐      ┌──────────┐            │
│   │ DISPATCH │─────│ EVALUATE │            │
│   └──────────┘      └──────────┘            │
│        ▲                  │                 │
│        │                  ▼                 │
│   ┌──────────┐      ┌──────────┐            │
│   │   LOOP   │─────│  REFINE  │            │
│   └──────────┘      └──────────┘            │
│                                             │
│        Max 3 cycles, then proceed           │
└─────────────────────────────────────────────┘
1단계: DISPATCH

후보 파일을 수집하기 위한 초기 광범위 쿼리:

javascript
// Start with high-level intent
const initialQuery = {
  patterns: ['src/**/*.ts', 'lib/**/*.ts'],
  keywords: ['authentication', 'user', 'session'],
  excludes: ['*.test.ts', '*.spec.ts']
};

// Dispatch to retrieval agent
const candidates = await retrieveFiles(initialQuery);
2단계: EVALUATE

검색된 콘텐츠의 관련성 평가:

javascript
function evaluateRelevance(files, task) {
  return files.map(file => ({
    path: file.path,
    relevance: scoreRelevance(file.content, task),
    reason: explainRelevance(file.content, task),
    missingContext: identifyGaps(file.content, task)
  }));
}

점수 기준:

  • 높음 (0.8-1.0): 대상 기능을 직접 구현
  • 중간 (0.5-0.7): 관련 패턴이나 타입을 포함
  • 낮음 (0.2-0.4): 간접적으로 관련
  • 없음 (0-0.2): 관련 없음, 제외
3단계: REFINE

평가를 기반으로 검색 기준 업데이트:

javascript
function refineQuery(evaluation, previousQuery) {
  return {
    // Add new patterns discovered in high-relevance files
    patterns: [...previousQuery.patterns, ...extractPatterns(evaluation)],

    // Add terminology found in codebase
    keywords: [...previousQuery.keywords, ...extractKeywords(evaluation)],

    // Exclude confirmed irrelevant paths
    excludes: [...previousQuery.excludes, ...evaluation
      .filter(e => e.relevance < 0.2)
      .map(e => e.path)
    ],

    // Target specific gaps
    focusAreas: evaluation
      .flatMap(e => e.missingContext)
      .filter(unique)
  };
}
4단계: LOOP

개선된 기준으로 반복 (최대 3회):

javascript
async function iterativeRetrieve(task, maxCycles = 3) {
  let query = createInitialQuery(task);
  let bestContext = [];

  for (let cycle = 0; cycle < maxCycles; cycle++) {
    const candidates = await retrieveFiles(query);
    const evaluation = evaluateRelevance(candidates, task);

    // Check if we have sufficient context
    const highRelevance = evaluation.filter(e => e.relevance >= 0.7);
    if (highRelevance.length >= 3 && !hasCriticalGaps(evaluation)) {
      return highRelevance;
    }

    // Refine and continue
    query = refineQuery(evaluation, query);
    bestContext = mergeContext(bestContext, highRelevance);
  }

  return bestContext;
}

실용적인 예시

예시 1: 버그 수정 컨텍스트
Task: "Fix the authentication token expiry bug"

Cycle 1:
  DISPATCH: Search for "token", "auth", "expiry" in src/**
  EVALUATE: Found auth.ts (0.9), tokens.ts (0.8), user.ts (0.3)
  REFINE: Add "refresh", "jwt" keywords; exclude user.ts

Cycle 2:
  DISPATCH: Search refined terms
  EVALUATE: Found session-manager.ts (0.95), jwt-utils.ts (0.85)
  REFINE: Sufficient context (2 high-relevance files)

Result: auth.ts, tokens.ts, session-manager.ts, jwt-utils.ts
예시 2: 기능 구현
Task: "Add rate limiting to API endpoints"

Cycle 1:
  DISPATCH: Search "rate", "limit", "api" in routes/**
  EVALUATE: No matches - codebase uses "throttle" terminology
  REFINE: Add "throttle", "middleware" keywords

Cycle 2:
  DISPATCH: Search refined terms
  EVALUATE: Found throttle.ts (0.9), middleware/index.ts (0.7)
  REFINE: Need router patterns

Cycle 3:
  DISPATCH: Search "router", "express" patterns
  EVALUATE: Found router-setup.ts (0.8)
  REFINE: Sufficient context

Result: throttle.ts, middleware/index.ts, router-setup.ts

에이전트와의 통합

에이전트 프롬프트에서 사용:

markdown
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

모범 사례

  1. 광범위하게 시작하여 점진적으로 좁히기 - 초기 쿼리를 과도하게 지정하지 않기
  2. 코드베이스 용어 학습 - 첫 번째 사이클에서 주로 네이밍 컨벤션이 드러남
  3. 누락된 것 추적 - 명시적 격차 식별이 개선을 주도
  4. "충분히 좋은" 수준에서 중단 - 관련성 높은 파일 3개가 보통 수준의 파일 10개보다 나음
  5. 자신 있게 제외 - 관련성 낮은 파일은 관련성이 높아지지 않음

관련 항목

  • The Longform Guide - 서브에이전트 오케스트레이션 섹션
  • continuous-learning 스킬 - 시간이 지남에 따라 개선되는 패턴
  • ~/.claude/agents/의 에이전트 정의

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in docs/ko-KR/skills/iterative-retrieval of affaan-m/ECC.

Open the folder on GitHubat commit 2d515e4

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Iterative Retrieval next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Iterative Retrieval compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Iterative Retrieval this skillaffaan-m/ECC277k2 repos~1.3kAutomated safety check: PassMIT
Iterative Retrievalxu-xiang/everything-claude-code-zh2k1 repos~1.2kAutomated safety check: PassMIT
Iterative Retrievalclosedloop-ai/claude-plugins122—~1.6kAutomated safety check: PassApache-2.0
Iterative Retrievalkubefleet-dev/kubefleet1621 repos~1.6kAutomated safety check: PassMIT
Retrieval Reflexgarrytan/gbrain31k—~735Automated safety check: PassMIT
Grade Iteratealirezarezvani/claude-skills28k—~1kAutomated safety check: PassMIT

Similar skills

  • Iterative Retrieval

    xu-xiang/everything-claude-code-zh

    逐步优化上下文检索以解决子代理上下文问题的模式

    2k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Iterative Retrieval

    closedloop-ai/claude-plugins

    Protocol for iteratively refining sub-agent queries through follow-up questions to ensure sufficient context

    122 GitHub stars~1.6k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Iterative Retrieval

    kubefleet-dev/kubefleet

    Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation.

    162 GitHub starsUsed in 1 repo~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Retrieval Reflex

    garrytan/gbrain

    When/what to retrieve — open the brain page for a salient entity before answering from memory.

    31k GitHub stars~735 tokensUpdated yesterday
    Auto-check passed
  • Grade Iterate

    alirezarezvani/claude-skills

    Phase 3 of building a Claude Managed Agent — the bounded grade→iterate loop.

    28k GitHub stars~1k tokensUpdated 1 mo ago
    EducationAuto-check passed
  • Remote Retrieval Automation

    ComposioHQ/awesome-claude-skills

    Automate Remote Retrieval tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.

    77k GitHub starsUsed in 3 repos~764 tokens
    Productivity & AutomationAuto-check passed

More from affaan-m/ECC

All 682 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    277k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    277k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    277k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    277k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    277k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Set an ECC-specific frontend design direction for production UI work.

    277k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Questions about Iterative Retrieval

What does Iterative Retrieval do?

서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴. An agent skill from affaan-m/ECC. Iterative Retrieval is an agent skill from affaan-m/ECC.

How do I install Iterative Retrieval in Claude Code?

Run `npx skills add affaan-m/ECC --skill iterative-retrieval -a claude-code`. Or copy the skill folder (docs/ko-KR/skills/iterative-retrieval in affaan-m/ECC) into .claude/skills/iterative-retrieval in your project. Claude Code loads it when a task matches its description.

How do I install Iterative Retrieval in Codex?

Run `npx skills add affaan-m/ECC --skill iterative-retrieval -a codex`. Or copy the skill folder (docs/ko-KR/skills/iterative-retrieval in affaan-m/ECC) into .agents/skills/iterative-retrieval in your project. Codex loads it when a task matches its description.

Can I use Iterative Retrieval in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill iterative-retrieval -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/iterative-retrieval, .gemini/skills/iterative-retrieval, .github/skills/iterative-retrieval and .opencode/skills/iterative-retrieval in your project.

What does Iterative Retrieval need to run?

SKILL.md names no scripts, command-line tools or credentials: Iterative Retrieval is instructions for the agent only.

Does Iterative Retrieval access the network?

SKILL.md names 1 domain. As links in the text: x.com. This is read from the text; nothing was executed.

Is Iterative Retrieval safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Iterative Retrieval use?

Iterative Retrieval is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Iterative Retrieval use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Iterative Retrieval?

Skills that share tags, products or a category with Iterative Retrieval: Iterative Retrieval (xu-xiang/everything-claude-code-zh, 2k stars), Iterative Retrieval (closedloop-ai/claude-plugins, 122 stars), Iterative Retrieval (kubefleet-dev/kubefleet, 162 stars) and Retrieval Reflex (garrytan/gbrain, 31k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Iterative Retrieval?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,673 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 11, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.