private-github-search
What it does
This skill searches a local copy of your GitHub repositories, including private ones, to find where code or text lives. It is for developers who cannot remember which repository holds something.
When to use it
- ✓When you cannot remember which of your repositories contains a piece of code.
- ✓When you want to find where you wrote a specific function or setting across all your projects.
- ✓When GitHub's own search does not find results in your private repositories.
Skill link
https://github.com/ykdojo/claude-code-tips/blob/main/skills/private-github-search/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Search all my repos for where I put the Stripe webhook handler.”
5 new skills a week. 1 minute to read.
How it works
The skill keeps a local copy of the main branch of your repositories, refreshes it, and runs a fast text search over it. The copy is set up once, from the GitHub accounts you choose.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Private GitHub search
GitHub's modern code search (the one that indexes private repos) is web-only; gh search code uses the legacy engine and often returns nothing for private repos. Instead, search a local mirror of all the user's repos - it covers the same content as GitHub's index (default branch, non-fork) and a full search takes milliseconds.
Searching
Find the bundled sync script (works for plugin installs and manual symlinks):
find ~/.claude ~/.codex -name "private-github-search-sync.sh" 2>/dev/null | sort -V | tail -1
Always refresh first - it exits instantly if the mirror was synced within the last hour, and takes ~15s otherwise (--force syncs regardless of age):
bash <script-path>
rg -il 'pattern' ~/repo-mirror/repos # which files
rg -in 'pattern' ~/repo-mirror/repos | head # matching lines
First-time setup
If ~/repo-mirror/owners.txt doesn't exist: ask the user which GitHub accounts to mirror (don't guess - they may manage several), write them one per line to ~/repo-mirror/owners.txt, then run the sync script in the background (initial clone takes a few minutes; needs gh auth with access to those accounts).
Caveats
- Only the default-branch tip is mirrored - for history or other branches, use
git log -Sin a full clone or GitHub web search. - The mirror may contain private data: keep it out of synced folders and never commit or publish its contents.
FAQ
Does it search older branches?
No. It covers only the main branch of each repository, so use git log or GitHub search for other branches.
Which accounts does it search?
Only the GitHub accounts you list during setup, so the skill asks you which accounts to copy.
Is the local copy safe to share?
The copy may contain private data, so keep it out of synced folders.
Details
Original description by the author
Full-text search across all of the user's GitHub repos (including private ones) using a local mirror and ripgrep. Use for "where did I put X", "which repo has X", or any search spanning the user's repos - gh search code / the REST API cannot reliably search private repos.
repo: ykdojo/claude-code-tips
Popularity
- GitHub stars
- 10k
- Ranking position
- #11902
- License
- —
- Updated
- 9/25/2026
Comments
- …
More skills from this repository
gha
10kHelps your agent find out why a GitHub Actions workflow failed, and whether the same job keeps failing.
half-clone
10kHelps your agent copy the later half of a long chat into a new session, using fewer tokens while keeping your recent work.
handoff
10kHelps your agent write a handoff document that lets a new chat pick up your project with clear goals, progress and next steps.
hn-summarize
10kHelps your agent summarize the top Hacker News stories, or one story and its comments, using the official Hacker News data.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.