How RepoGrasp works: from a GitHub link to a cited answer
What happens when you ask RepoGrasp a question: downloading and filtering the repository, numbering lines, the model's instructions, citations, caching and limits.
RepoGrasp turns a public GitHub link and a question into an explanation with file:line citations. Here's exactly what happens in between, including the limits, because knowing how a tool works is the best way to know when to trust it.
1. Parse the link
You can link a repository (github.com/owner/repo), a branch (/tree/branch-name) or a folder (/tree/main/packages/core). RepoGrasp only accepts github.com links in the preview.
2. Download the archive
The server downloads the public source archive GitHub provides for that branch, as a .tar.gz file. Downloads are capped in size and time so one huge repository can't slow the service for everyone.
3. Filter to the code that explains behaviour
RepoGrasp keeps:
- Source files: TypeScript, JavaScript (including
.mjs,.cjsand.tsx/.jsx), Vue, Svelte and Astro - Schemas: Prisma and GraphQL
- JSON files, such as
package.jsonand configs - README files
It skips:
node_modules,vendor, build output (dist,build,out,.next), coverage and CI folders- Lockfiles, minified files, source maps and generated
.d.tsdeclarations .envfiles, private keys and certificates, and anything whose path mentions secrets or credentials- Individual files over 100 KB
4. Check the size
The kept files must total under about 800,000 characters, roughly 200,000 tokens. If a repository is bigger, RepoGrasp tells you rather than silently dropping files, and suggests linking a subfolder. See context windows and repository size.
5. Number every line
Each line of each file is prefixed with its line number, like 42| const total = .... That gives the model exact positions to cite, and gives you exact positions to check.
6. Instruct the model to stay grounded
The model receives the whole filtered repository with instructions that include:
- Answer only from this source.
- Cite every claim inline as
path/to/file.ts:12-30. - Lead with a direct answer, then walk through the actual call path across files.
- Keep code snippets short.
- If the repository doesn't contain the answer, say so plainly and point to the closest relevant code. Never invent files, functions or behaviour.
7. Stream the answer
The answer streams back as it's generated. Citations are highlighted so they're easy to spot.
8. Follow-ups reuse the context
Within the same repository, follow-up questions reuse the downloaded files (kept in server memory for up to 10 minutes) and include recent turns of the conversation. Where the model provider supports prompt caching, the repeated repository context is cached, which makes follow-ups faster and cheaper.
What's not stored
Questions and answers aren't stored on our servers. Downloaded repository files are discarded from memory after 10 minutes. Details are in the privacy policy.
Limits to keep in mind
- Public GitHub repositories only, for now.
- JavaScript and TypeScript ecosystems; other languages aren't read yet.
- Anything outside the repository (infrastructure, environment values, other services) is invisible.
- Highly dynamic code (runtime registration, string-built names) is harder to explain from source alone.
- Models can still make mistakes. Check the citations.
Try the sample demo, or read why citations matter.