iterative-retrieval

iterative-retrieval is a skill for Claude Code from closedloop-ai/claude-plugins. It costs 22 tokens per session (1,300 once invoked), scanned A, original, Apache-2.0.

A protocol for asking coding sub-agents follow-up questions when their first answer lacks enough context. A sub-agent is a helper agent given a focused task by a larger coding workflow.

In plain words
What is it for?
Use it in the /code orchestrator to refine requests and gather more complete information from sub-agents when a simple one-shot query is not enough.
Why use it?
Initial answers can omit details that the main workflow knows are important. Iterative follow-ups help fill those gaps before the workflow accepts the result.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; mentions Claude Code.

Part of the code plugin — 13 skills, 6 commands, 23 agents, 7 hooks shipped together

Good fit Use it in the /code orchestrator to refine requests and gather more complete information from sub-agents when a simple one-shot query is not enough.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/closedloop-ai/claude-plugins/iterative-retrieval
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add closedloop-ai/claude-plugins --skill iterative-retrieval
Clone the repo
git clone --depth 1 https://github.com/closedloop-ai/claude-plugins

Made for: Claude Code.

Or install code, the plugin that ships this one along with the rest of its 13 skills, 6 commands, 23 agents, 7 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for iterative-retrieval

README.md
[![agentmods](https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/iterative-retrieval/github.svg)](https://agentmods.dev/skills/closedloop-ai/claude-plugins/iterative-retrieval)
Your own site
<a href="https://agentmods.dev/skills/closedloop-ai/claude-plugins/iterative-retrieval"><img src="https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/iterative-retrieval/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for iterative-retrieval

Your own site · 80×15
<a href="https://agentmods.dev/skills/closedloop-ai/claude-plugins/iterative-retrieval"><img src="https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/iterative-retrieval.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,300 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.01300
Opus 5.5 $0.00009 $0.00520
Sonnet 5.5 $0.00004 $0.00260
Haiku 4.5 $0.00002 $0.00130

Measured 1mo ago against content hash 55debbb04138, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

iterative-retrieval scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/code/skills/iterative-retrieval/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Iterative Retrieval Skill

This skill enables orchestrators to iteratively refine sub-agent queries through follow-up questions, ensuring sub-agents gather sufficient context before the orchestrator accepts their output. This addresses the problem where orchestrators have semantic context that sub-agents lack, leading to incomplete summaries.

Target Audience

This skill is designed for the /code orchestrator only (code.md slash command). Sub-agents do not use this skill - they simply respond to queries. The orchestrator is responsible for evaluating responses and deciding whether to resume with follow-ups.

Note: Sub-agents do NOT see this skill documentation in their context. Only the orchestrator can invoke and follow the protocol. Sub-agents are unaware they're part of an iterative retrieval loop - they just respond to queries and follow-ups as normal requests.

Usage Model

This skill is optional and opt-in. Not every sub-agent call benefits from iterative refinement - simple lookups or well-defined queries don't need it. Invoke this skill when you anticipate that a sub-agent may return incomplete context due to semantic gaps.

The 4-Phase Protocol

This protocol provides a structured approach to iterative context gathering. All 4 phases represent the recommended workflow, but phases 2-4 are optional if the initial response is sufficient. Exercise judgment - if Phase 2 evaluation shows context is sufficient on first pass, phases 3-4 aren't needed.

Phase 1: Initial Dispatch

Define and dispatch the initial query with full context:

  1. Define PRIMARY OBJECTIVE: Clearly state what you ultimately need to accomplish
  2. Formulate INITIAL QUERIES: Specific questions or search criteria for the sub-agent
  3. Dispatch with BOTH: Send both the queries AND the primary objective to provide semantic context
  4. Store AGENT ID: Keep the agent_id returned from the Task(...) call for potential continuation via SendMessage

Read the full file on GitHub · 111 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 111 lines · 22 tokens per session scan A 55debbb04138

Subscribe to this mod's changes

iterative-retrieval is a skill published in the GitHub repository closedloop-ai/claude-plugins (122 stars, last pushed today), licensed Apache-2.0. It adds 22 tokens to every session and 1,300 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.