context-fetch
Skill952 starsChanged 3 months agoMITView on GitHub
Search-first skill to reduce unnecessary file reads by searching before loading
In this repository12 other files it gives its agents.
- adapters/CLAUDE.mdCLAUDE.md
- codebase-mapperSkill
- context-compressorSkill
- context-health-monitorSkill
- debuggerSkill
- empirical-validationSkill
- executorSkill
- plan-checkerSkill
- plannerSkill
- subagent-delegationSkill
- token-budgetSkill
- verifierSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Core principle: Search first, read targeted sections, never load full files blindly.
- Distinctive: line 77
Only read what's justified:
- Distinctive: line 91
When invoking this skill, provide:
- Distinctive: line 103
After executing this skill, report:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Fetch Skill
<role>
You are a context-efficient agent. Your job is to find relevant code with minimal file reads.Core principle: Search first, read targeted sections, never load full files blindly.
</role>
When to Use
Activate this skill before:
- Starting any coding task
- Beginning a refactor
- Investigating a bug
- Understanding unfamiliar code
Process
Step 1: Define the Question
What are you trying to find or understand?
Examples:
- "Where is the login endpoint defined?"
- "How does the caching layer work?"
- "What calls the
processPaymentfunction?"
Step 2: Identify Keywords
Extract searchable terms:
| Question | Keywords |
| Login endpoint | login, auth, POST.*login |
| Caching layer | cache, redis, memoize |
| Payment calls | processPayment, payment |
Step 3: Search Before Reading
PowerShell:
# Simple pattern search
Select-String -Path "src/**/*.ts" -Pattern "login" -Recurse
# With ripgrep (if available)
rg "login" --type tsBash:
# With ripgrep (recommended)
rg "login" --type ts
# With grep
grep -r "login" src/ --include="*.ts"Step 4: Evaluate Results
From search results, identify:
- Primary candidates — Files directly matching your question
- Secondary candidates — Files that reference primary candidates
- Ignore list — Files with keyword but unrelated context
Step 5: Targeted Reading
Only read what's justified:
# Read specific line range (PowerShell)
Get-Content "src/auth/login.ts" | Select-Object -Skip 49 -First 30
# Read specific function (with view_code_item tool)
# view_code_item: src/auth/login.ts -> handleLoginInputs
When invoking this skill, provide:
| Input | Description | Example |
| Question | What you're trying to find | "Where is user validation?" |
| Scope | Directory or file pattern | src/, *.service.ts |
| Keywords | Terms to search for | validate, user, schema |
Outputs
After executing this skill, report:
- Candidate files — Ranked by relevance
- Relevant extracts — Key snippets found
- Next reads — Specific files/line-ranges to read next
- Skip list — Files searched but not relevant
Anti-Patterns
❌ Loading Everything First
# BAD: Reading 5 full files to "understand context"
Read: src/auth/login.ts (500 lines)
Read: src/auth/register.ts (400 lines)
Read: src/auth/types.ts (200 lines)✅ Search Then Target
# GOOD: Search first, read only what's needed
Search: "validatePassword" in src/auth/
Found: login.ts:45, register.ts:78
Read: login.ts lines 40-60❌ Broad Searches
# BAD: Searching for common terms
Search: "function" → 10,000 results✅ Specific Searches
# GOOD: Searching for specific identifiers
Search: "validateUserCredentials" → 3 resultsContext Efficiency Metrics
Track your efficiency:
| Metric | Good | Poor |
| Files searched | 10+ | <5 |
| Files fully read | <3 | 10+ |
| Lines read | <200 | 1000+ |
| Targeted sections | Yes | No |
Integration with GSD
This skill supports GSD's context management:
- Prevents context pollution — Less irrelevant code loaded
- Supports wave execution — Each wave starts with minimal context
- Enables model switching — Less context = easier handoff
Quick Reference
1. Define question → What am I looking for?
2. Extract keywords → What terms to search?
3. Search codebase → rg/grep/Select-String
4. Evaluate results → Which files matter?
5. Read targeted → Specific lines only
6. Report findings → Candidates + extractsPart of GSD methodology. See PROJECT_RULES.md for search-first discipline rules.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

