Agent Skillsykdojo/claude-code-tips › private-github-search

private-github-search

GitHub

通过本地镜像和 ripgrep 在用户所有 GitHub 仓库(含私有)中进行全文搜索,解决 gh search code 无法可靠搜索私有仓库的问题。

skills/private-github-search/SKILL.md ykdojo/claude-code-tips

Trigger Scenarios

查找特定代码或文件位置 跨仓库搜索内容 gh search code 失效时

Install

npx skills add ykdojo/claude-code-tips --skill private-github-search -g -y
More Options

Use without installing

npx skills use ykdojo/claude-code-tips@private-github-search

指定 Agent (Claude Code)

npx skills add ykdojo/claude-code-tips --skill private-github-search -a claude-code -g -y

安装 repo 全部 skill

npx skills add ykdojo/claude-code-tips --all -g -y

预览 repo 内 skill

npx skills add ykdojo/claude-code-tips --list

SKILL.md

Frontmatter
{
    "name": "private-github-search",
    "description": "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."
}

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 -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 -S in 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.

Version History

  • 37d92af Current 2026-07-19 18:23

Same Skill Collection

skills/clone/SKILL.md
skills/gha/SKILL.md
skills/half-clone/SKILL.md
skills/handoff/SKILL.md
skills/hn-summarize/SKILL.md
skills/reddit-fetch/SKILL.md
skills/review-claudemd/SKILL.md
skills/version-check/SKILL.md

Metadata

Files
0
Version
37d92af
Hash
215cbfcd
Indexed
2026-07-19 18:23

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-20 15:02
浙ICP备14020137号-1 $お客様$