Agent skill

Ghq

by natsukium in natsukium/dotfiles

Clone and reuse GitHub/GitLab repositories under a single managed root (ghq root) instead of fetching files one-by-one via gh api/WebFetch or scratch-cloning into /tmp.

CC0-1.0Auto-check passed

Install Ghq

skills CLI
$ npx skills add natsukium/dotfiles --skill ghq -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install natsukium/dotfiles ghq --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/natsukium/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/modules/features/coding-agents/common/skills/ghq .claude/skills/ghq && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ghq
GitHub stars
106
Token cost
~1.2k tokens
SKILL.md length
528 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
CC0-1.0

At a glance

Clone and reuse GitHub/GitLab repositories under a single managed root (ghq root) instead of fetching files one-by-one via gh api/WebFetch or scratch-cloning into /tmp.

  • Works in 4 steps: Check first — ghq list (or ghq list -e /… → Clone if missing — ghq get /. Add… → Resolve the path — ghq list -p -e /… → …
  • Referencing source code from any remote repository — even for a single file
  • SKILL.md covers Why this skill exists, The workflow, Anti-patterns and Good examples, plus 1 more section
  • Calls gh, rg and git

What it does

Ghq is an agent skill from natsukium/dotfiles. Clone and reuse GitHub/GitLab repositories under a single managed root (ghq root) instead of fetching files one-by-one via gh api/WebFetch or scratch-cloning into /tmp. Use this skill whenever investigating, reading, grepping, or referencing source code from any remote repository — even for a single file. Triggers include "look at X's source", "how does X implement Y", "check the X repo", "find Z in nixpkgs/react/linux/etc.", or any moment a remote repo URL appears and you need to read more than one file from it…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with GitHub, Linux, GitLab and React. The repository describes itself as: Nix dotfiles for NixOS, Darwin and WSL. The licence is CC0-1.0.

When your agent uses it

  • Referencing source code from any remote repository — even for a single file
  • Include look at Xs source
  • How does X implement Y
  • Check the X repo

Example prompts

  • “look at X”
  • “how does X implement Y”
  • “check the X repo”
  • “/ghq”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Check first — ghq list (or ghq list -e / for exact match). If it prints a path, the repo is already there; skip the clone.
  2. Clone if missing — ghq get /. Add --shallow for one-off inspection of a specific commit's tree, or --partial blobless if the repo is huge…
  3. Resolve the path — ghq list -p -e / returns the absolute path. Use this with Read/Grep/Glob, not cd.
  4. Update only when needed — ghq get -u / to pull latest. Don't update reflexively; a stale clone is usually fine for "how does X work"…

What it can do on your machine

Read from SKILL.md and the folder at commit ce7dae8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • rg
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • raw.githubusercontent.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ghq loads about 1.2k tokens when it runs. Until then it costs about 171 tokens; SKILL.md has 528 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~171
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from natsukium/dotfiles at commit ce7dae8, republished under its CC0-1.0 licence (© natsukium). 528 words, ~1,233 tokens.

Download SKILL.mdSave it as .claude/skills/ghq/SKILL.md (or your agent's skills folder).
name
ghq
description
Clone and reuse GitHub/GitLab repositories under a single managed root (`ghq root`) instead of fetching files one-by-one via `gh api`/`WebFetch` or scratch-cloning into `/tmp`. Use this skill whenever investigating, reading, grepping, or referencing source code from any remote repository — even for a single file. Triggers include "look at X's source", "how does X implement Y", "check the X repo", "find Z in nixpkgs/react/linux/etc.", or any moment a remote repo URL appears and you need to read more than one file from it. Skip only for one-shot GitHub API operations that have no source code in them (PR comments, issue bodies, workflow runs — those belong to the `gh` skill).

ghq - Local Repository Management

ghq clones remote repositories into a predictable, deduplicated directory tree under ghq root (here: ~/src/private, layout <host>/<owner>/<repo>). Once a repo is there, reading it is a local filesystem operation — no API calls, no rate limits, no re-download next time.

Why this skill exists

When inspecting source code, the wasteful patterns are:

  • gh api repos/.../contents/<file> per file — burns a request and base64 round-trip per read, can't grep across the tree, can't follow imports.
  • git clone into /tmp (or mktemp -d) — re-downloads on every session, leaves the repo unfindable later, wastes bandwidth and disk.
  • WebFetch of raw.githubusercontent.com URLs — same problem as gh api, plus no recursion.

ghq get solves all three: it's idempotent (no-op if the repo is already cloned), it puts the repo in a path you can find again with ghq list, and once local you can use Read, Grep, Glob, and ast-grep freely.

The workflow

  1. Check first — ghq list <repo> (or ghq list -e <owner>/<repo> for exact match). If it prints a path, the repo is already there; skip the clone.
  2. Clone if missing — ghq get <owner>/<repo>. Add --shallow for one-off inspection of a specific commit's tree, or --partial blobless if the repo is huge (e.g., nixpkgs, linux, chromium) and you only need to navigate before reading a few files.
  3. Resolve the path — ghq list -p -e <owner>/<repo> returns the absolute path. Use this with Read/Grep/Glob, not cd.
  4. Update only when needed — ghq get -u <owner>/<repo> to pull latest. Don't update reflexively; a stale clone is usually fine for "how does X work" questions.

Anti-patterns

<examples>
  <example type="bad">
    <description>Fetching files individually via the GitHub API</description>
    <bad>gh api repos/NixOS/nixpkgs/contents/pkgs/development/interpreters/python/default.nix</bad>
    <good>ghq get NixOS/nixpkgs && Read $(ghq list -p -e NixOS/nixpkgs)/pkgs/development/interpreters/python/default.nix</good>
  </example>
  <example type="bad">
    <description>Cloning into /tmp for "just this session"</description>
    <bad>git clone --depth 1 https://github.com/facebook/react /tmp/react</bad>
    <good>ghq get --shallow facebook/react  # ends up at ~/src/private/github.com/facebook/react, reusable</good>
  </example>
  <example type="bad">
    <description>Using WebFetch on raw.githubusercontent.com to read source</description>
    <bad>WebFetch https://raw.githubusercontent.com/owner/repo/main/src/foo.ts</bad>
    <good>ghq get owner/repo && Read $(ghq list -p -e owner/repo)/src/foo.ts</good>
  </example>
</examples>
Show full SKILL.md (194 more words)Show less

Good examples

<examples>
  <example>
    <user>Check how nixpkgs handles uv2nix</user>
    <agent>I'll make sure nixpkgs is cloned, then grep it locally.
`ghq get NixOS/nixpkgs` (no-op if present)
`rg -l uv2nix $(ghq list -p -e NixOS/nixpkgs)/pkgs`</agent>
  </example>
  <example>
    <user>Look at how React implements useEffect</user>
    <agent>I'll fetch React once and search the source tree.
`ghq get facebook/react`
Then `Grep` for `function useEffect` inside `$(ghq list -p -e facebook/react)`.</agent>
  </example>
  <example>
    <user>I want to see the changes in https://github.com/owner/repo/pull/42</user>
    <agent>That's a PR review, not source-code reading — using `gh` instead: `gh pr diff 42 --repo owner/repo`. (If I then need to explore the surrounding code, I'll `ghq get owner/repo`.)</agent>
  </example>
  <example>
    <user>The linux kernel has a function called vmalloc, can you find where it's defined?</user>
    <agent>Huge repo — partial clone keeps it tractable.
`ghq get --partial blobless torvalds/linux`
`rg -n 'void \*vmalloc\(' $(ghq list -p -e torvalds/linux)`</agent>
  </example>
</examples>

When NOT to use ghq

  • PR/issue/workflow operations — use gh (gh pr view, gh issue view, gh run view). Those aren't source code.
  • A single, never-revisited file from a documentation URL — WebFetch is fine; cloning a repo for one README is overkill.
  • Inside this dotfiles repo itself — already on disk; just Read/Grep directly.

© natsukium, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in modules/features/coding-agents/common/skills/ghq of natsukium/dotfiles.

Open the folder on GitHubat commit ce7dae8

Compare with similar skills

Ghq next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ghq compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ghq this skillnatsukium/dotfiles106—~1.2kAutomated safety check: PassCC0-1.0
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT
Check PRonyx-dot-app/onyx32k2 repos~2.3kAutomated safety check: PassMIT
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
Update .NET OS Packagesdotnet/core22k—~2.3kAutomated safety check: PassMIT
Run Paritymillionco/react-doctor15k—~4.1kAutomated safety check: PassCustom licence

Similar skills

  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Check PR

    onyx-dot-app/onyx

    Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.

    32k GitHub starsUsed in 2 repos~2.3k tokens
    DevelopmentAuto-check passed
  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 1 repo~2.7k tokens
    Game DevelopmentAuto-check passed
  • Official

    Audits and updates os-packages.json files listing the Linux packages each .NET release needs per distro, then regenerates the Markdown from the JSON.

    22k GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Run Parity

    millionco/react-doctor

    Compare React Doctor diagnostics for a GitHub pull request (PR) with Vercel Sandbox.

    15k GitHub stars~4.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Cut Release

    jfernandez/bpftop

    Cut a new versioned release of bpftop — pick the version, open a version-bump PR, sign-tag the merge commit on main, and draft GitHub release notes in the project's established format.

    2.7k GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from natsukium/dotfiles

All 10 skills in this repo
  • Pi Review

    natsukium/dotfiles

    Delegate a source-grounded design or code review to a fresh pi CLI process using sol or luna, then address verified findings until no blockers remain.

    106 GitHub stars~972 tokensUpdated today
    Auto-check passed
  • Attmcojp Claude Md

    natsukium/dotfiles

    Change the org-level CLAUDE.md that governs every attmcojp repository.

    106 GitHub stars~1.3k tokensUpdated today
    Auto-check: notes
  • Gui Debug

    natsukium/dotfiles

    Verify a rendering or window-chrome change in any macOS GUI app unattended — find its CGWindowID via JXA, capture that window alone (with per-pixel alpha) using screencapture -l, and read exact RGBA…

    106 GitHub stars~909 tokensUpdated today
    Auto-check passed
  • Gui Debug

    natsukium/dotfiles

    Verify a rendering or window-chrome change in a GUI app unattended on Linux/Wayland under the niri compositor — enumerate windows and read output scale via niri msg --json, capture a specific window…

    106 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Po Translate

    natsukium/dotfiles

    Orchestrate English→Japanese translation of po/ja.po — classify, delegate translation/review to subagents, iterate until clean

    106 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Gh

    natsukium/dotfiles

    GitHub CLI for pull requests, issues, releases, workflows, and repository operations.

    106 GitHub stars~422 tokensUpdated today
    Auto-check passed

Questions about Ghq

What does Ghq do?

Clone and reuse GitHub/GitLab repositories under a single managed root (ghq root) instead of fetching files one-by-one via gh api/WebFetch or scratch-cloning into /tmp. Ghq is an agent skill from natsukium/dotfiles. Clone and reuse GitHub/GitLab repositories under a single managed root (ghq root) instead of fetching files one-by-one via gh api/WebFetch or scratch-cloning into /tmp.

When should I use Ghq?

Ghq fits situations like: referencing source code from any remote repository — even for a single file; include look at Xs source; how does X implement Y; check the X repo.

How do I install Ghq in Claude Code?

Run `npx skills add natsukium/dotfiles --skill ghq -a claude-code`. Or copy the skill folder (modules/features/coding-agents/common/skills/ghq in natsukium/dotfiles) into .claude/skills/ghq in your project. Claude Code loads it when a task matches its description.

How do I install Ghq in Codex?

Run `npx skills add natsukium/dotfiles --skill ghq -a codex`. Or copy the skill folder (modules/features/coding-agents/common/skills/ghq in natsukium/dotfiles) into .agents/skills/ghq in your project. Codex loads it when a task matches its description.

Can I use Ghq in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add natsukium/dotfiles --skill ghq -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ghq, .gemini/skills/ghq, .github/skills/ghq and .opencode/skills/ghq in your project.

What does Ghq need to run?

Going by SKILL.md and its folder, Ghq needs the command-line tools its instructions call (gh, rg and git).

Does Ghq access the network?

SKILL.md names 2 domains. As links in the text: github.com and raw.githubusercontent.com. This is read from the text; nothing was executed.

Is Ghq safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ghq use?

Ghq is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ghq use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ghq?

Skills that share tags, products or a category with Ghq: Greploop (onyx-dot-app/onyx, 32k stars), Check PR (onyx-dot-app/onyx, 32k stars), Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars) and Update .NET OS Packages (dotnet/core, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ghq?

natsukium (a GitHub user) maintains it in natsukium/dotfiles, which has 106 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 10, 2026.

Source: natsukium/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.