How to Feed a GitHub Repository Into ChatGPT or Claude
ChatGPT and Claude can't read GitHub URLs. Here's how to convert any repository to plain text and share it directly with an AI assistant.
ChatGPT and Claude can explain code, help you debug, and walk you through an unfamiliar codebase — but neither can read a GitHub URL. Paste a link into either assistant and it sees a string of characters, not a repository. To give an AI assistant access to your code, you need to convert the repository into plain text first.
Why You Can't Paste a GitHub URL Into ChatGPT
When you paste a GitHub link into ChatGPT or Claude, the model receives it as text — it doesn't visit the URL or fetch the files behind it. Even with web browsing enabled, following the link would retrieve the GitHub webpage, not the source files themselves.
The only way to share a codebase with an AI assistant is to include the actual file contents as text in the conversation. A repo-to-text converter flattens the entire repository — its folder structure and every file you select — into a single plain-text document you can paste directly into a chat.
How to Feed a GitHub Repository Into ChatGPT or Claude
The Repo to Text converter connects to the GitHub API and exports any repository as a plain-text document. The whole process takes under a minute.
- Paste the GitHub repository URL into the tool
- Click Fetch Files — the tool loads the complete file list from GitHub
- A checklist appears with every file in the repo. Text files (
.js,.ts,.py,.md,.json, and others) are pre-selected. Binary files like images and fonts are left unchecked. - Uncheck any files you don't need
- Click Generate Text File
- Click Copy to copy the output to your clipboard, or Download to save it as a
.txtfile - Open a new chat in ChatGPT or Claude, paste the text, and ask your question
The output has two clearly labeled sections: a directory listing showing the folder structure, followed by the full contents of every selected file, each one preceded by its file path.
Which Files to Include
The tool pre-selects text-based source files and leaves binary files unchecked. You'll usually want to uncheck a few more things before generating:
node_modules/ — third-party package source files. There can be tens of thousands of them, and the AI doesn't need them to understand your project.
Lock files (package-lock.json, yarn.lock, pnpm-lock.yaml) — often several megabytes of version resolution data with no meaningful code content.
Generated output (dist/, build/, .next/) — compiled versions of your source files. Including them duplicates content without adding anything useful.
.env files — never include these. They contain API keys and credentials.
If your question is about a specific part of the codebase, you'll get better answers by only selecting the relevant files. Debugging an authentication issue? Include the auth files and whatever they import. Asking about the payment flow? Select just those files. The more focused the selection, the more focused the answer.
What ChatGPT and Claude Can Do With a Codebase
Once you've pasted the converted repository into a chat, a few workflows work especially well.
Understanding an unfamiliar project. Paste the core source files and ask for an overview of how everything fits together. This is useful when you've inherited a codebase, are evaluating a project, or need to get up to speed quickly.
Debugging. Include the files involved in the problem and paste the exact error message. "Here are the relevant files — I'm seeing this error: [error]. What's causing it?" gives the assistant enough context to trace the issue through the dependency chain.
Code review. Paste the files that changed alongside the files they interact with, and ask for a review. The assistant can flag potential issues, explain what the changes do, and suggest improvements.
Generating documentation. Paste the public-facing parts of the project and ask for README-style documentation. The output reflects the actual code rather than a generic template — useful as a first draft you then edit. The repo to text tool for documentation exports is built for exactly this workflow.
Handing off a project. When you're sharing a codebase with a new developer or a contractor who needs to understand the structure before starting work, exporting the relevant files as text gives them something they can paste into their own AI session and explore independently. The repo to text tool for freelancer handoffs is built for exactly this workflow.
Private GitHub Repositories
The tool supports private repositories. Enter a GitHub Personal Access Token in the token field and the tool uses it to authenticate with the GitHub API. Tokens are never stored — everything runs in your browser.
To create a token: go to GitHub → Settings → Developer Settings → Personal Access Tokens and generate one with repo (read) access. Paste it into the token field before clicking Fetch Files.
What to Ask ChatGPT About Your Code
The quality of the answer depends heavily on how the question is framed. Specific questions consistently outperform broad ones.
Instead of: "Explain this codebase." Ask: "Explain how the authentication flow works, starting from the login endpoint through to how the session is stored."
Instead of: "Something is broken." Ask: "I'm seeing this error when a payment fails: [error message]. Which file is most likely responsible, and what's the likely cause?"
Instead of: "Review this code."
Ask: "The processOrder function was recently changed. Here are the files involved — are there any edge cases that aren't handled?"
If you know the name of the function, file, or module involved, include it in the question. The assistant will focus there rather than trying to summarise the whole codebase at once.
Frequently Asked Questions
Does this work with repositories on GitLab or Bitbucket?
The tool works with GitHub repositories only. It uses the GitHub API to fetch the file tree and contents, so the URL must be a github.com link.
What if the repository is very large? For large repositories, be selective about which files you include. The more you add, the larger the output — and very large inputs can cause AI assistants to give less precise answers. Focus on the files relevant to your question rather than trying to include everything.
Is my code sent to instantly.tools servers? No. The tool fetches files directly from the GitHub API in your browser. The code passes through your browser to the GitHub API and back — instantly.tools never sees it.
Can I use this for repositories I don't own? You can export any public repository. For private repositories, you need a Personal Access Token with read access to that repo.