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.
npx agentmods add skills/yeaight7/agent-powerups/context-retrieval-loopnpx skills add yeaight7/agent-powerups --skill context-retrieval-loopgit clone --depth 1 https://github.com/yeaight7/agent-powerupsWrote 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.
[](https://agentmods.dev/skills/yeaight7/agent-powerups/context-retrieval-loop)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00048 | $0.00825 |
| Opus 5 | $0.00024 | $0.00413 |
| Sonnet 5 | $0.00010 | $0.00165 |
| Haiku 4.5 | $0.00005 | $0.00082 |
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 4d 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.
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>
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.
- 4d ago First seen · 112 lines · 48 tokens per session scan A 359642778e73
context-retrieval-loop is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 825 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
mongodb-natural-language-querying
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB, asks "how do I query...", needs help with…
plugin-publish
发布 Zhin.js 插件到 npm 和 Zhin 插件市场。Use when asked to publish a plugin, prepare for release, check publish readiness, or submit to the Zhin plugin marketplace. 引导完成发布前检查、版本管理和提交流程。.
mongodb-schema-design
MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree…
plugin-develop
Implement Zhin.js plugin features with Plugin Runtime: defineCommand, defineAgentTool, middleware, pages. Use when asked to add a command, register a tool, wire cron, extend middleware, or build a console page. Triggers: 插件开发, add command, 加命令, 写插件功能, defineCommand.
mongodb-query-optimizer
Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query…
mongodb-search-and-ai
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG…