Repo Search for Coding Agents
Real Source Code
Answers the Question
Clone any GitHub repo into a persistent sandbox, then let your agent search the real code instead of recalling it from memory.
AI agents answer questions about libraries from memory. Memory is often wrong, outdated, or invented outright.
The external problem
You ask how an external library or framework actually implements something, and the agent answers from training data instead of opening the repo.
The internal problem
The answer sounds confident and specific, right up until it turns out to describe a different version, or a method that doesn’t exist in the codebase at all.
What's at stake
Time spent chasing an answer that was never true, or code shipped on a wrong assumption about how a dependency actually behaves.
Three steps: confirm the repo, clone it, verify by reading.
Give it a repo name or URL, and it clones, syncs, and searches before it answers.
Find & Confirm
Give a full GitHub URL, or just a name. If it’s only a name, the skill searches the web to confirm the exact repository before cloning anything.
Clone & Sync
The repo is shallow-cloned into a persistent, read-only sandbox. Every run resets it to match the remote’s current default branch, so you’re always searching current code.
Search & Verify
Haiku subagents comb the codebase in parallel to find the relevant files. Every file they point to gets read directly before it factors into the answer.
Use it now. It's free.
Works on all platforms. Pick yours and get set up in under a minute.
Claude.ai
Download & upload in 60 seconds
Download the zip, then open Claude.ai to upload it.
Download the zip below. With JavaScript enabled, Claude.ai opens in a new tab if your browser allows it. Otherwise, use Open Claude.ai.
Click the + button in the skills column on the left.
Select Create a skill.
Select Upload a skill and upload the zip.
Start your repo search session by running /estack-repo-search.
Claude Code
Run one command in any terminal
Works anywhere Node.js is installed — your project directory, home directory, anywhere.
Open your terminal app and run this command.
npx elliot-stack@latest
Run the command.
Start Claude Code by typing claude in your terminal.
Start your repo search session by running /estack-repo-search.
ChatGPT / Other
Paste a prompt — the AI does the rest
This prompt tells the AI where to fetch current instructions from the live site. No installs. No version lag.
Copy the prompt below.
Preview prompt
# Repo Search
Search external repositories by cloning them into a persistent sandbox and exploring with subagents.
**Read-only sandbox — never edit, write, or delete files inside `~/repo-search-storage/`.** This directory holds cloned copies of other people's repos purely for you to `Read`/`Grep`/`Explore`. It is not a workspace to modify, patch, or "fix" anything in. It's fine to be extra careful here: on every invocation this skill hard-resets each repo to match its remote HEAD (see below), so any local edits would be silently discarded anyway — but the point stands regardless of that safety net. If the user wants to *change* code in one of these repos, that's a different task (fork it, clone it elsewhere as a real working copy) — not something this skill does.
## Available repos
```!
mkdir -p ~/repo-search-storage
echo "=== Repo Sandbox: ~/repo-search-storage ==="
echo ""
found=0
for dir in ~/repo-search-storage/*/; do
[ -d "$dir/.git" ] || continue
found=1
name=$(basename "$dir")
url=$(cd "$dir" && git remote get-url origin 2>/dev/null || echo "(no remote)")
echo "- $name → $url"
echo " Resetting to latest origin state..."
(
cd "$dir" || exit 1
default_branch=$(git ls-remote --symref origin HEAD 2>/dev/null | sed -n 's#^ref: refs/heads/\(.*\)\tHEAD#\1#p')
[ -z "$default_branch" ] && default_branch="main"
git fetch --depth 1 origin "$default_branch" 2>&1
git reset --hard FETCH_HEAD 2>&1
git clean -fdx 2>&1
) | sed 's/^/ /'
echo ""
done
if [ "$found" -eq 0 ]; then
echo "(no repos cached yet)"
fi
```
Every repo listed above is force-synced to its remote's current default-branch tip before you see it — this covers both a repo that drifted out of local sync and one that picked up stray local changes (from a prior session, a crash, whatever). You're always searching fresh, unmodified upstream state. Present the user with the repos listed above and offer to search any of them or clone a new one.
## Finding the correct repo
Before cloning, you must have the exact GitHub URL. Follow these rules:
- **If the user gave a full GitHub URL** (e.g. `https://github.com/org/repo`), use it directly.
- **If the user gave only a name** (e.g. "openclaw", "langchain"), use WebSearch to find the correct GitHub repository URL first. Never guess a repo URL — confirm it via search.
- **Always verify** the search result matches what the user is asking about before cloning. It doesn't hurt to confirm with the user — "I found X repo, is that the one you meant?" — before spending time cloning. Wrong repo = wasted time and misleading answers.
## Cloning
Once you have a confirmed URL, shallow clone into the sandbox:
```bash
git clone --depth 1 <repo-url> ~/repo-search-storage/<repo-name>
```
## Searching
To explore a repo, spawn one or more **Haiku** subagents using the Agent tool with `model: "haiku"` and `subagent_type: "Explore"`. In the prompt, always include the **full absolute path** to the cloned repo (e.g. `C:/Users/2supe/repo-search-storage/gstack`) and tell the subagent to search within that directory. Without this, the subagent won't know where to look.
If the question spans multiple areas of the repo, spawn multiple subagents in parallel — each focused on a different aspect — to get answers faster.
**The subagent's job is navigation, not answers.** Use subagent results to identify which files are relevant, then **read those files yourself** with the Read tool before drawing conclusions. Never trust a subagent's summary of code verbatim — always verify by reading the source directly.
---
## Skill Feedback
If the user shares feedback about this skill — a bug, something confusing, a missing feature, or a suggestion — ask them to describe it in a bit more detail (what they expected, what happened, and any relevant context). Then file the issue using whichever method is available:
**If `gh` is installed** (`gh --version` succeeds), create the issue directly:
```bash
gh issue create \
--repo ElliotDrel/e-stack \
--title "estack-repo-search: <concise summary>" \
--body "<description from user feedback — expected vs. actual behavior and context>"
```
**If `gh` is not installed**, build a pre-filled URL:
```bash
python3 -c "
import urllib.parse
title = 'estack-repo-search: <concise summary>'
body = '<description from user feedback — expected vs. actual behavior and context>'
base = 'https://github.com/ElliotDrel/e-stack/issues/new'
print(base + '?title=' + urllib.parse.quote(title) + '&body=' + urllib.parse.quote(body))
"
```
Share the printed URL with the user and offer to open it in their browser.
They can also click it directly, review the pre-filled title and body, and click **Submit new issue**.
Open your platform and paste the prompt.
Start your repo search session.
Repo Search ships in E-Stack, a set of 21 free skills installed by one command. See the whole stack.