ghq

ghq is a skill for Claude Code, Codex from natsukium/dotfiles. It costs 162 tokens per session (1,354 once invoked), scanned A, original, CC0-1.0.

A tool for cloning remote Git repositories into one predictable local folder. Git repositories are project folders that store source code and its change history.

In plain words
What is it for?
It helps inspect, search, compare, and reference source code from GitHub or GitLab repositories, including across an entire project.
Why use it?
It avoids repeatedly downloading individual files or recloning projects into temporary folders. Once a repository is local, it can be searched and reused without more network requests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/natsukium/dotfiles/ghq
Any agent
npx skills add natsukium/dotfiles --skill ghq
Clone the repo
git clone --depth 1 https://github.com/natsukium/dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ghq

README.md
[![agentmods](https://agentmods.dev/badge/skills/natsukium/dotfiles/ghq.svg)](https://agentmods.dev/skills/natsukium/dotfiles/ghq)
Your own site
<a href="https://agentmods.dev/skills/natsukium/dotfiles/ghq"><img src="https://agentmods.dev/badge/skills/natsukium/dotfiles/ghq.svg" alt="Measured on agentmods" height="20"></a>
Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,354 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00162 $0.01354
Opus 5 $0.00081 $0.00677
Sonnet 5 $0.00032 $0.00271
Haiku 4.5 $0.00016 $0.00135

Measured 6d ago against content hash e6d24f2fdfbf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ghq scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

modules/features/coding-agents/common/skills/ghq/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 firstghq 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 missingghq 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 pathghq list -p -e <owner>/<repo> returns the absolute path. Use this with Read/Grep/Glob, not cd.
  4. Update only when neededghq 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

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 79 lines · 162 tokens per session scan A e6d24f2fdfbf

Subscribe to this mod's changes

ghq is a skill published in the GitHub repository natsukium/dotfiles (104 stars, last pushed yesterday), licensed CC0-1.0. It adds 162 tokens to every session and 1,354 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.