Resolves named repositories to local copies before reasoning about them. Covers maintained repos under ~/projects/<repo> and reference repos via ghq. Use when a repo is named in a task or before making technical claims grounded in source code.
Ships in version-control-and-forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When a repository is named — or a substantive technical claim is about to rest on a project's source, options, defaults, API, or upstream documentation — check for a local copy first; treat the lookup as the default and bypass it only with explicit justification.
Whole-tree review with rg, fd, and direct file reads surfaces cross-file structure, call sites, and conventions that piecemeal API fetches miss, and it costs one clone instead of many round trips.
Resolve the org first: a bare name is often ambiguous — gh search repos <name> returns dozens of matches for a common word — and the org determines everything downstream.
A fully-qualified org/repo or a forge URL settles identity outright; when more than one plausible match survives a search, ask which one was meant rather than guessing.
Then branch on authorship. The distinguishing question: if we cut releases or land commits upstream it is a maintained repo; if we only read it, it is a reference repo.
Maintained repositories live under ~/projects/<repo>/ (copies may sit deeper; repo names can have variants such as <repo>.jl or <repo>-rs).
zoxide query -l --base-dir ~/projects <repo> lists matching directories that still exist, ranked by how often and how recently they were entered.
zoxide learns a directory only when an interactive shell cds into it, so a miss here proves nothing.fd -t d -d 4 '^<repo>$' ~/projectscd <candidate> && git remote -v to confirm the origin matches the expected forge URL.
Name collisions are common with single-token repo names, so this step is required, not optional, before treating a candidate as authoritative.zoxide add <path> so the next lookup finds it there; agent shells set their working directory without cd, so zoxide never learns these paths otherwise.~/projects/<repo>/ (or provide the path if it lives elsewhere) before proceeding; propose the exact command — git clone <url> ~/projects/<repo>/ for reference-only work, or gh repo fork <org>/<repo> --clone --remote -- ~/projects/<repo>/ when contribution back upstream is anticipated.
Do not silently fall back to web tools for substantive research when a local copy would be more authoritative; web tools remain appropriate only for genuinely web-native content (release notes, issue discussions, blog posts).
Pause the work thread until the clone is in place or the user provides an alternative path.Never ask the user to clone a reference repo into ~/projects/.
The gate is ghq list -p <name> (under "Engine: ghq" below): authoritative because it walks the filesystem directly rather than consulting an index.
zoxide query -l <name> is a fast-path cache only — validate any hit against ghq list -p before relying on it.
When ghq list -p confirms a copy that zoxide did not list, register it with zoxide add <path>.
On a miss, acquire the repository with ghq-sync <url>, which clones shallow and blobless and registers the path with zoxide; a raw ghq get clone does not register, so follow it with zoxide add <path>.
Prefer the canonical upstream; acquire a personal fork only when contribution back to upstream is anticipated.
A shallow clone sits at HEAD, which is usually not the revision we pin — read at the pinned revision or every line anchor you cite will be wrong.
A blobless clone holds the file contents of its checked-out revision, and on the shared tree below also those that every commit a request brought into its branches and remote-tracking branches, by an update, a deepen or a tag fetch, needs to be read as a diff, merges included, as git show and lazygit show them: the writer fetches them before it answers, unless more than 100,000 blobs are missing or the clone records no partial-clone filter, when its answer says history not hydrated and why; if that fetch fails, its answer says history hydrate failed, and in either case the request itself succeeds or fails as it would without it.
A commit that only a tag reaches, as ghq-sync -u --tags fetches one at depth 1, is not among them and stays unhydrated until ghq-sync --hydrate <tag>; once a commit an update brings into a branch reaches it, it is a branch commit and the writer hydrates it like any other.
When a request fails or is stopped after its fetch, the clone's next update or deepen fetches what that request left; commits that arrived before the writer first recorded a clone's refs are not among them, so read those as below.
To read anything else, hydrate first with ghq-sync --hydrate <rev> <path-or-owner/repo>, which fetches every object <rev>'s tree needs and so readies git show <rev>:<path>, git grep <rev> and checkouts of <rev>; the revision's commit must already be in the clone, so fetch a tag first with ghq-sync -u --tags.
A commit's diff needs more than its own tree: git show <rev> needs <rev> and each of its parents hydrated (ghq-sync --hydrate <rev>, then --hydrate <rev>^1, and --hydrate <rev>^2 for a merge), and git diff A B needs both A and B hydrated.
When ghq-sync -u fails with git's fatal: Not possible to fast-forward and the line shallow boundary between the local branch and upstream's: <path> (…), the clone holds a commit without its history between its branch and upstream's; repair it with ghq-sync --deepen 1000000 <path>, then ghq-sync -u <path>.
If the update then fails with git's fast-forward refusal and without that line, upstream rewrote its branch and the boundary was not the cause; if the line still appears after a deepen that printed deepened: <path>, the history runs deeper than the deepen reaches, and ghq-sync --full <path> is the repair, at the cost of every blob; after one that printed failed: <path>, the deepen did not run to its end (see the lock below), and the line says nothing of the depth.
The deepen fetches the commits and trees of the whole history below the boundaries of the branches it fetches, which takes long on a large copy; a deepen the writer's hour-long command limit stops normally leaves the clone's history as it was and can be rerun, starting over; if git had to be killed it can leave .git/shallow.lock, after which each deepen of that copy prints failed: <path> and a tag fetch at depth 1 fails, each with git's Unable to create '<path>/.git/shallow.lock': File exists., until the tree's administrator removes the file once no git runs there.
Do not size the deepen to the gap: git marks the commits at the new depth as boundaries even where the clone holds their history, so --deepen N can hide history the clone held, and only a depth beyond the roots, as 1000000 is, hides none.
On magnetite, pyrite and stibnite every account's $(ghq root) is the host's one shared tree, /var/lib/ghq, and ~/ghq is a link to it, so ghq list -p prints paths under the shared root's real path (/private/var/lib/ghq on stibnite) rather than under ~/ghq; elsewhere the root is ghq's default ~/ghq.
The shared tree has a single writer account and is read-only to you: ghq get, ghq-sync, ghq-sync -u, ghq-sync --deepen, ghq-sync --full and ghq-sync --hydrate are carried out by that account on your behalf, and git gc, editing a file or setting configuration inside a reference repository fail with a permission error by design, as does a plain git fetch, which opens .git/FETCH_HEAD before it connects.
Your git also refuses every network transport inside the shared tree (protocol.allow = never under the shared root), so a read that needs file contents the clone lacks fails at once with transport '<scheme>' not allowed and could not fetch <oid> from promisor remote rather than trying to write the tree; ghq-sync --hydrate of the revisions the read compares fixes it.
For the same reason git ls-remote origin, git remote show origin and git fetch --no-write-fetch-head inside a reference repository fail with not allowed; run git ls-remote <url> from outside the tree, or ghq-sync --audit, instead.
lazygit fetches nothing at start-up there: the shared root's .lazygit.yml sets git.autoFetch: false, which overrides that one key of your own lazygit configuration and leaves the rest in force.
Git LFS files in the shared tree are pointer files, not their content: git runs no LFS filter there, for the writer or for you, so git status stays clean and an LFS-tracked image or binary reads as a three-line pointer; fetch its content from the upstream host if you need it.
Update a reference copy with ghq-sync -u <path-or-owner/repo>, where a path such as . inside the repository names it; add --tags to fetch every tag, which a full clone does on every update anyway.
A tag upstream moved moves in the copy, and the answer says tag moved upstream: <path> <tag> (<old commit> -> <new commit>), or tag re-made upstream: <path> <tag> (<old object> -> <new object>, at <commit>) for an annotated tag re-made at the same commit; a tag upstream deleted stays.
The writer carries out requests for one repository one at a time: a request whose repository is busy prints ghq-writer: waiting up to 3600 s for <repository>, in use by another request (<holder>) and waits, and after 3600 s gives up with exit status 75 and a message saying so; try again later.
It logs every request without its target, at start, while it waits and at exit (exit status=<n> duration=<s>s, then history=hydrated:<n>, history=not-hydrated or history=failed when the request walked the history it brought into a blobless clone, whatever happened after, and reason: <why> for a failed request, such as git fetch exited 128, timed out after 3600 s running git fetch, gave up waiting for the lock, refused or not a member of <group>): in the system journal of the ghq-writer@ units on magnetite and pyrite (sudo journalctl -u 'ghq-writer@*'; the journal files are root:systemd-journal 0640), and in /var/log/ghq-writer/writer.log, readable by the tree's readers, on stibnite.
On the shared tree ghq get and ghq-sync accept a repository as owner/repo, host/owner/repo, a URL, or a path, and refuse a bare name such as llm-agents.nix before contacting the writer.
To change a reference repository's working tree, clone it into ~/projects with git clone <path> ~/projects/<repo>.
On those hosts git is configured with safe.bareRepository = explicit for every repository, not only reference ones, so git refuses to work inside a bare repository it discovers from the current directory ("cannot use bare repository"); name it with git --git-dir=<path> or GIT_DIR=<path> instead.
(see local) markerWhen the user appends (see local) — or a close variant such as (see local clone) or (local) — to a name, the lookup above is unconditional: do not answer from general knowledge, do not reach for web tools, and do not ask whether a clone exists.
If the lookup returns no hit, fall through to that category's on-miss handling: the maintained-repo clone request above, or the ghq-sync acquisition under "Reference-repo lookup" above.
Given a GitHub file URL (e.g. https://github.com/org/repo/blob/ref/path#L119-L131), apply the lookup for repo, then read the file with the line range.
Given an issue or PR URL (e.g. https://github.com/org/repo/issues/2491), use gh issue view 2491 -R org/repo or gh pr view 2491 -R org/repo.
ghq is both the acquisition engine and the catalog.
It clones into a predictable path derived from the remote URL — $(ghq root)/<host>/<owner>/<repo> — so the same repository always resolves to the same location regardless of who runs it.
The root is always $(ghq root); the default root is ~/ghq, a host-shared tree changes it, so never hardcode a path.
Check first, then fetch.
The idempotency gate is ghq list:
ghq list -p <name> # -p prints absolute paths; -e forces an exact match; a hit means it is already local
ghq list # prints host/owner/repo (relative paths) for everything already cloned; prefix https:// for the URL
A hit means the source is already local — review it in place, do not re-clone.
On a miss, fetch with ghq-sync <url>, which performs the lazy clone — shallow, blobless, no submodules, enough to review the current tree — and registers the path with zoxide:
ghq-sync <url> # shallow + blobless clone into $(ghq root)/<host>/<org>/<repo>, registered with zoxide
The lower-level ghq get --shallow --partial blobless --no-recursive <host>/<owner>/<repo> performs the same clone without registering the path with zoxide; use it only when registration is unwanted, and complete registration manually otherwise.
When the review needs full history, blame, or submodule contents, promote the lazy clone to a full one.
ghq get -u only updates the existing clone in place — it runs a fast-forward pull or fetch and leaves the clone grafted (shallow) and blobless — so it does not promote a lazy clone to full.
Use the ghq-sync sibling tool instead, which unshallows the clone, removes the partial-clone filter, backfills the missing objects with --refetch, and initializes submodules:
ghq-sync --full <host>/<owner>/<repo> # git unshallow + partial-filter removal + --refetch backfill + submodule init
The in-place promotion it performs is: set an all-branches fetch refspec, git fetch --unshallow, unset remote.origin.partialclonefilter, git fetch --refetch of upstream's branches and of the tags the clone has, a fetch by id of anything else its refs reach that is still missing, unset every remote's promisor settings and extensions.partialclone then gc, fast-forward to @{u}, and git submodule update.
If anything its refs reach stays missing, it prints failed: <path> and the clone stays partial with its promisor settings as they were.
Often you have a package name, not a repository URL.
Resolve the URL in this precedence order:
first, the ecosystem's package manager or lockfile, preferring metadata already fetched locally so the answer is offline and matches the installed version;
on a gap, the registry's own metadata;
as a last resort, a web or gh lookup.
Then normalize the resolved URL and re-run the ghq list -p gate on the resolved name before fetching.
Shared normalization before ghq strips a git+ prefix, converts git@host:owner/repo and ssh:// forms to https://host/owner/repo, drops a trailing .git, and drops any /tree/... path or ?.../#... suffix.
Ordered by reliability.
Highest reliability: flake.lock records an exact locked source for every input.
nix flake metadata --json | jq .locks.nodes # inspect all nodes
nix flake metadata --json | jq -r '.locks.nodes | to_entries[] | .value.locked | select(.type=="github") | "\(.owner)/\(.repo)"'
Each locked node's .locked carries {type, owner, repo, url, ...}.
A github type maps to https://github.com/<owner>/<repo>; gitlab maps similarly; a git type carries the source directly in .locked.url.
Map an input name to its node through .locks.nodes.root.inputs.
High reliability.
cargo tree # human-readable
cargo metadata --format-version 1 # machine-readable; --offline works after `cargo fetch`
cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.source!=null) | (.repository // .homepage // .documentation) | select(.!=null)' \
| sed -E 's#\.git$##; s#/tree/.*$##' | sort -u
Do not pass --no-deps — it drops the dependency packages you are resolving.
For each package prefer .repository; else parse .source (a git+<url> form — strip the git+ prefix and any ?.../#... suffix); else fall back to .homepage then .documentation.
Workspace and path members have .source == null and are skipped; a rare empty .repository needs a web fallback.
High reliability via local reads.
bun pm ls # direct deps; --all for the full tree
bun pm ls --all
bun pm pkg get dependencies devDependencies # project package.json may be JSON5 — use this, not raw jq on the file
The authoritative URL for the exact installed version is the installed package's own manifest: read node_modules/<pkg>/package.json .repository.
This is correct even for npm-aliased installs.
Normalize the shapes: a string "owner/repo" is GitHub shorthand; a github: / gitlab: / bitbucket: prefix names the host; an object carries .url.
The in-file fallback order is .repository, then .homepage, then .bugs.url.
For transitive dependencies, iterate node_modules/*/package.json and node_modules/@*/*/package.json.
Do not rely on npm view <pkg> repository.url or bun pm view as the primary source: they hit the network, return the latest rather than the installed version, and are wrong for aliased installs (for example vite installed as npm:rolldown-vite).
Use them only as a last-resort fallback.
Medium reliability (roughly 93%; the remainder needs a web lookup).
uv tree # dependency tree; --depth 1 for direct deps only
Do not use uv pip list — it reports the active environment and can silently target the wrong interpreter.
uv and pip surface no repository URL, so read the installed distribution metadata: scan Project-URL: lines in .venv/lib/python*/site-packages/<pkg>-<ver>.dist-info/METADATA.
Pick the first forge-host URL (github, gitlab, codeberg, bitbucket, sr.ht) by key priority: source code, then source, then repository, then code, then github, then homepage, then any.
For git dependencies, read uv.lock, where the source = { git = ... } entry carries the URL (strip ?.../#...).
On a gap, fall back to https://pypi.org/pypi/<pkg>/json .info.project_urls (the same declared fields, so it will not rescue a genuine gap), then a web or gh lookup.
Once the source is local, review the whole tree with rg, fd, and file reads rather than fetching individual files through the GitHub API.
Record nothing extra: ghq list is the catalog, so there is no manifest to maintain.
This skill is the canonical home for both lookup categories; the global context file's session protocol and the style skill both defer to it.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
repository-lookup, local-source, ghq, zoxide, source-acquisition
10 skills in this plugin
/butCommit, push, branch, and manage version control with GitButler. Use for: commit my changes, check what changed, create a PR, push my branch, view diff, create branches, stage files, edit commit history, squash commits, amend commits, undo commits, pull requests, merge, stash work. Replaces git - use 'but' instead of git commit, git status, git push, git checkout, git add, git diff, git branch, git rebase, git stash, git merge. Covers all git, version control, and source control operations./git-commit-promptGenerate optimal prompt for atomic git commits with conventional format. Use when preparing commits or cleaning up git history./github-browseOpen a GitHub issue or PR in browser and optionally manage subscriptions. Use when navigating to GitHub resources from the terminal./git-stacked-pr-integrationFirst-party queue authorization for ordinary trunk-based PRs and registered stacks, including worker/orchestrator roles, risk-based review timing, asynchronous handoff, CI warming, and fleet overrides of mergify-stack. Use when preparing or publishing stacked changes, authorizing an ordinary PR or stack, or reviewing VCS routing and landing evidence./jj-git-interactive-rebase-to-jjComplete reference for translating git interactive rebase operations to Jujutsu equivalents./jj-history-cleanupJujutsu history cleanup patterns for rewriting and reorganizing change history./version-control-and-forge:dependency-source-acquisitionfrom version-control-and-forge
npx claudepluginhub cameronraysmith/vanixiets --plugin version-control-and-forgeOther plugins' skills for the same job