context-retrieval-loop

context-retrieval-loop is a skill for Claude Code from yeaight7/agent-powerups. It costs 48 tokens per session (825 once invoked), scanned A, original, Apache-2.0.

A guided search process for finding the right files and code before changing an unfamiliar codebase. It repeats broad and focused searches until there is enough context.

In plain words
What is it for?
Use it when starting unfamiliar work, locating missed files, finding tests and call sites, or narrowing the files involved in a task.
Why use it?
It reduces the risk of editing the wrong files or giving a subagent incomplete information.

Skill for Claude Code

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

Part of the agentic-systems plugin — 5 skills shipped together

Good fit Use it when starting unfamiliar work, locating missed files, finding tests and call sites, or narrowing the files involved in a task.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/context-retrieval-loop
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 yeaight7/agent-powerups --skill context-retrieval-loop
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install agentic-systems, the plugin that ships this one along with the rest of its 5 skills.

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 context-retrieval-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/context-retrieval-loop/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/context-retrieval-loop)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/context-retrieval-loop"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/context-retrieval-loop/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 context-retrieval-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/context-retrieval-loop"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/context-retrieval-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 825 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.00048 $0.00825
Opus 5.5 $0.00019 $0.00330
Sonnet 5.5 $0.00010 $0.00165
Haiku 4.5 $0.00005 $0.00082

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

Security

Grade A, and why

context-retrieval-loop 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 3mo 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/agentic-systems/skills/context-retrieval-loop/SKILL.md · 112 lines

How it starts

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

Context Retrieval Loop

Gather the right codebase context before making changes or spawning subagents. Prevents acting on incomplete information.

When to Use

  • Starting work on an unfamiliar area of a codebase
  • Spawning a subagent that needs targeted file context
  • Failing to find a relevant file on the first search pass
  • Unsure which files are in scope for a task

The 3-Cycle Loop

Each cycle builds on the previous. Stop early when you have enough context. Do not exceed 3 cycles.

Cycle 1 — Broad Search

# Find files by keyword
rg "<primary-keyword>" --type ts --type js -l
rg "<primary-keyword>" --glob "*.py" -l

# Find by filename pattern
find . -name "*<keyword>*" -not -path "*/node_modules/*" -not -path "*/.git/*"

Collect: file paths, key terms, naming conventions seen.

Stop here if: 3 or more directly relevant files found with no critical gaps.

Cycle 2 — Exact Source and Tests

Read the most relevant files from Cycle 1 in full. Then:

# Find tests for those files
rg "<filename-stem>" --glob "*.test.*" --glob "*.spec.*" -l
rg "import.*<module-name>" -l

# Find call sites
rg "<function-name>|<class-name>" --type ts --type js -l

Collect: imports used, function signatures, test patterns, adjacent files referenced.

Stop here if: You can describe the change needed and its blast radius.

Cycle 3 — Docs and Setup

# Check project-specific docs
ls docs/ README.md AGENTS.md CLAUDE.md .claude/ 2>/dev/null

# Check config for feature flags, env vars, or schema
rg "<keyword>" .env.example *.config.* *.toml *.yaml -l 2>/dev/null

Collect: configuration constraints, environment requirements, anything that would block a change.

Stopping Conditions

Stop the loop (whichever comes first):

  • You have 3+ high-relevance files and understand the change scope
  • Cycle 3 complete
  • Each new cycle returns only files already seen

Output

After the loop, report:

Context gathered:
  <file-path> — <one-line reason for relevance>
  ...

Missing context (if any):
  <what is still unclear and why it matters>

Read the full file on GitHub · 112 lines

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. 3mo ago First seen · 112 lines · 48 tokens per session scan A 359642778e73

Subscribe to this mod's changes

context-retrieval-loop is a skill published in the GitHub repository yeaight7/agent-powerups (10 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 825 once invoked, about $0.0002 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-08-31.

Related

context-retrieval-loop compared with skills from other repositories

context-retrieval-loop next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-retrieval-loopyeaight7/agent-powerupsSkill102mo agoApache-2.0A48Claude Code
systematic-debuggingHezaoHezao/poirotSkill2624mo agoMITA16Claude Code
simplify-codeHezaoHezao/poirotSkill2624mo agoMITA15Claude Code
python-debugpyHezaoHezao/poirotSkill2624mo agoMITA17Claude Code
node-inspect-debuggerHezaoHezao/poirotSkill2624mo agoMITA18Claude Code
hqespearchucker667/Skill-HQESkill43mo agoApache-2.0A29Claude Code, Codex
debug-gatewaykirodotdev/KiroCrewSkill5.1ktodayApache-2.0A63Claude Code, Codex