/codebase-intelligence:context-retrieval-loopfrom codebase-intelligence
Guides a 3-cycle search loop to gather codebase context before making changes or spawning subagents. Use when starting in unfamiliar code, search missed a file, or task scope is unclear.
Ships in codebase-intelligence. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Gather the right codebase context before making changes or spawning subagents. Prevents acting on incomplete information.
Each cycle builds on the previous. Stop early when you have enough context. Do not exceed 3 cycles.
# 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.
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.
# 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.
Stop the loop (whichever comes first):
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>
If context is missing, state it explicitly. Do not proceed with guesses when a known gap exists.
When dispatching a subagent, pass only the gathered file list — not the full conversation context:
Relevant files for this task:
src/auth/tokens.ts — contains TokenService used by the bug
src/auth/session.ts — session state management
src/auth/tokens.test.ts — existing test patterns
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub yeaight7/agent-powerups --plugin codebase-intelligence5 skills in this plugin
/local-rag-mcpUse when querying, ingesting, or maintaining a local RAG MCP corpus for semantic document retrieval with privacy controls./managed-codebase-contextUse when connecting to a managed codebase-context MCP/session service, checking stale maps, or safely using MCP-provided repository context./search-before-buildingUse when about to add a new helper, utility, or abstraction, a task sounds like a solved problem, a new external dependency is being considered, or custom code is proposed without checking what already exists.2 plugins in one repository ship this exact skill · first indexed Jul 28, 2026
Other plugins' skills for the same job