ANSWERS · ANSWERS FOR CODING AGENTS

Ask questions about a GitHub repo without cloning it

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-10-19 · UPDATED · 2026-10-20

TL;DR — To ask questions about a GitHub repo without cloning it, run xerj ask "your question". If the repo is in the Corpus Hub catalogue, xerj pulls a signed, pre-indexed pack and answers with file:line, the pinned commit and the licence. Measured 2026-10-19: first answer 2,356 ms including the download, later answers 30 to 40 ms.

PASTE THIS TO YOUR AI AGENT — IT DOES THE REST Read https://xerj.org/llms.txt. Install xerj, then answer my question about the library with xerj ask (add --corpus and --def for an exact symbol). Quote the corpus, the pinned commit, the file:line and the licence line it prints, and say so when it exits 1 with no match.
RUN THIS XERJ COMMAND curl -fsSL https://xerj.org/get | sh Install the release binary into ~/.local/bin.
RUN THIS XERJ COMMAND xerj ask "how does snappy decompress a literal" Route the question to a corpus, pull its signed pack once and answer with file:line.
RUN THIS XERJ COMMAND xerj ask --corpus zstd --def ZSTD_CLEVEL_DEFAULT --json Exact definition lookup in one corpus, as JSON with the pin, licence class and hits.
RUN THIS XERJ COMMAND xerj hub status List cached packs, the automatic node and the hosted setting.

Run it

This ran in a fresh HOME with v1.0.0-rc.97. No node was running. xerj ask started a node on port 9300, pulled the snappy pack and answered.

curl -fsSL https://xerj.org/get | sh
xerj ask "how does snappy decompress a literal"
xerj hub: no node answers at http://127.0.0.1:9555; starting a local node on port 9300 (data: ~/.xerj/hub/node, log: ~/.xerj/hub/node.log)
xerj hub: node ready on port 9300 (pid 1822371)
xerj hub: pulling 'snappy' (10.8 MB) — one-time download, later questions answer locally
xerj hub: pulled snappy 9c28114a 11338487 → 4 indices, 382 definitions
snappy  pin 2026-10-02 (18 days old)  BSD-3-Clause  snappy/snappy.cc:1643
  DecompressAllTags(Writer* writer) {
    const char* ip = ip_;
    ResetLimit(ip);
    auto op = writer->GetOutputPtr();
    ...
    ... [method DecompressAllTags truncated at 800 chars]

Paths are shortened to ~ and the passage is cut for the page. The run set XERJ_URL to an unused port, because a test node was already on 9200. With nothing on 9200, the first line names that port.

Ask for one symbol and get one line back:

xerj ask --corpus zstd --def ZSTD_CLEVEL_DEFAULT --json
{
  "corpus": "zstd",
  "pin_sha": "01b7154f1172432f8abe9b3bb9909e14a1176b7d",
  "pin_date": "2026-10-02",
  "age_days": 18,
  "licence_spdx": "mixed: BSD-3 (lib) / GPL-2.0 (cli)",
  "licence_class": "approach-only",
  "answered_from": "local_pack",
  "mode": "def",
  "hits": [
    {
      "file": "zstd/lib/zstd.h",
      "line": 134,
      "kind": "const",
      "text": "#  define ZSTD_CLEVEL_DEFAULT 3",
      "value": "3",
      "score": 17.131968,
      "licence_warning": "approach-only licence (mixed: BSD-3 (lib) / GPL-2.0 (cli)): read, do not copy"
    }
  ],
  "truncated": false,
  "warnings": [
    "approach-only licence (mixed: BSD-3 (lib) / GPL-2.0 (cli)): read, do not copy"
  ]
}

xerj hub status shows what is cached and where the node runs:

pack: lz4 0774d055  18 days old  5.2 MB  last used today
pack: snappy 9c28114a  18 days old  11.5 MB  last used today
pack: zstd 01b7154f  18 days old  23.5 MB  last used today
node: running  pid 1822371  port 9300
hosted: auto
last sync: never
catalogue: 2 days old

The exit code tells an agent the result. 0 is answered, 1 is no match and 2 is an unknown corpus. 3 is a failed pack check and 4 is more than one matching corpus.

Measured on 2026-10-19

RunWhat happenedWall time
First question, fresh HOMEstart node on 9300, pull 10.8 MB snappy pack, answer2,356 ms
Second questionanswer from the local pack341 ms
Later questionsanswer from the local pack30 to 40 ms
First --def on zstdpull 20.1 MB pack (7,874 definitions), answer962 ms
Same --def, as JSONanswer from the local pack20 ms

The catalogue the client verified was signed with ed25519 and generated on 2026-10-18 with 14 corpora. Packs are downloaded from GitHub Releases of xerj-org/xerj, so the GitHub API is not involved.

How it compares

ApproachClone neededIndex on your machinefile:linePinned commitWorks for any repo
xerj asknono, pack is pre-indexedyesyesno, catalogue only (14 corpora)
Clone + xerj autoindexyesyesyesyour checkoutyes
Clone + ripgrepyesnoyesyour checkoutyes
GitHub code searchnonoyesdefault branchpublic repos, API rate limits
Ask a chat modelnonononowhatever it was trained on

When not to use xerj

FAQ

How can I ask questions about a GitHub repo without cloning it?

If the repo is in the Corpus Hub catalogue, run xerj ask "your question". xerj downloads a signed pack that is already indexed, at a pinned commit, and answers with file:line. Nothing is cloned or indexed on your machine.

Which repos can I ask about?

The signed catalogue generated on 2026-10-18 lists 14 corpora, including lz4, snappy, zstd, aiohttp and astro. hub.xerj.org lists 513 live corpora in its registry, but only catalogue entries have packs xerj ask can pull.

Can I search a GitHub repo without cloning if it is not in the catalogue?

Not with xerj today. Clone it and run xerj autoindex. Pointing xerj ask at any repository is tracked as issue #1800, which is open.

Does my question leave my machine?

It can. --hosted auto is the default: off inside a git repository, on elsewhere. Pass --offline or --hosted off to answer only from cached packs. Our runs printed answered from: local pack.

Can Claude Code or Cursor use this over MCP?

Yes. xerj mcp serves xerj_hub_find, xerj_hub_def and xerj_hub_ask. They answer from packs already on the machine and never download one; they name the xerj hub pull line instead.

Can I copy the code it shows?

Check the licence line. Each answer prints the SPDX licence and a class. zstd and lz4 are approach-only, and the output says read, do not copy.

Evidence

Related