context-fetch

Searches codebases with keywords before reading targeted file sections to reduce context usage.

1|Updated Sep 3, 2026
One-click install
npx skills add https://github.com/amanpal3/SKILLs --skill context-fetch-amanpal3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-fetch
Source: https://github.com/amanpal3/SKILLs/tree/main/.agent/plugins/gsd/.agents/skills/context-fetch
Command: npx skills add https://github.com/amanpal3/SKILLs --skill context-fetch-amanpal3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents often waste context window space by loading entire files when only a few lines are relevant. This Skill enforces a search-first discipline so agents find the right code with minimal file reads, keeping context clean for the actual task. ## Core Features & Use Cases - Search-First Workflow: A five-step process that defines the question, extracts keywords, searches with ripgrep/grep/Select-String, evaluates results, and reads only targeted line ranges. - Anti-Pattern Guardrails: Explicit examples of what to avoid, such as loading multiple full files or running overly broad searches. - Efficiency Metrics: Concrete benchmarks for files searched, files fully read, and lines read to measure context efficiency. - Use Case: Before fixing a bug in an unfamiliar repository, search for the failing function name, identify the two files that reference it, and read only the relevant 20-line sections instead of loading entire modules. ## Quick Start Ask the agent to find where user validation is implemented in the src directory using the context-fetch search-first approach.

Frequently Asked Questions about context-fetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find code in a large repository without reading every file?▼

Define a specific question, extract searchable keywords like function or endpoint names, then run ripgrep or grep across the source directory. Read only the line ranges around matching results instead of full files.

How to search code with ripgrep before reading files?▼

Run rg with a specific identifier and file type filter, for example rg "processPayment" --type ts. Review the matching file list, then read only the relevant line ranges in the top candidate files.

What is the difference between ripgrep and grep for code search?▼

Ripgrep is faster and respects gitignore rules by default, making it preferred for large codebases. Standard grep with recursive flags works as a fallback when ripgrep is unavailable, and PowerShell users can use Select-String.

Why does searching for common terms return too many results?▼

Broad terms like "function" or "user" match thousands of lines and defeat the purpose of targeted search. Use specific identifiers such as full function names or unique endpoint strings to narrow results to a handful of candidates.

When should I not use a search-first approach?▼

Search-first is less useful when you already know the exact file and lines to read, or when the codebase is small enough to load entirely. It adds the most value in unfamiliar or large repositories.