private-github-search

Searches all GitHub repos including private ones via a local mirror and ripgrep.

10.0k|808|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/ykdojo/claude-code-tips --skill private-github-search
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: private-github-search
Source: https://github.com/ykdojo/claude-code-tips/tree/main/skills/private-github-search
Command: npx skills add https://github.com/ykdojo/claude-code-tips --skill private-github-search

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GitHub's gh search code and REST API use the legacy search engine, which often returns nothing for private repositories. This Skill mirrors all of your repos locally and searches them with ripgrep, so full-text search across private code actually works.

Core Features & Use Cases

  • Local mirror sync: Shallow-clones the default branch of every non-fork repo from your configured GitHub accounts into ~/repo-mirror, refreshing in about 15 seconds when stale.
  • Fast full-text search: Runs ripgrep across the mirror to find which repos and files contain a pattern, with results in milliseconds.
  • Use Case: You remember writing a utility function months ago but not which repo it lives in. Ask to search your repos for the function name and instantly get the matching files and lines across all your private projects.

Quick Start

Search all of my GitHub repos, including private ones, for where I defined the retry-with-backoff helper function.

Frequently Asked Questions about private-github-search

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

FAQPage Schema
How do I search code across all my private GitHub repos?

Mirror all repos locally with the bundled sync script, then run ripgrep against ~/repo-mirror/repos. GitHub's gh search code uses the legacy engine and often misses private repos, while the local mirror covers the same content as GitHub's modern index.

Why does gh search code return nothing for private repositories?

gh search code and the REST API use GitHub's legacy search engine, which does not reliably index private repos. The modern code search that covers private repos is only available through the GitHub web interface, not the CLI or API.

What do I need to set up local GitHub repo search?

You need the gh CLI authenticated with access to your accounts, ripgrep installed, and an owners.txt file at ~/repo-mirror listing the GitHub usernames to mirror. The initial clone takes a few minutes; later syncs take about 15 seconds.

Can local mirror search find code in git history or other branches?

No, the mirror only contains the default-branch tip as a shallow clone. For history or other branches, use git log -S in a full clone of the specific repo, or GitHub's web search.

Is it safe to mirror private repos locally?

The mirror contains private data, so keep it out of synced folders like Dropbox and never commit or publish its contents. It lives at ~/repo-mirror by default and can be relocated with the REPO_MIRROR_DIR environment variable.