ScriptsApr 7, 2026·2 min read

Gitingest — Feed Git Repos to AI Agents

Convert any GitHub repository into a single text file optimized for LLM consumption. Paste a URL, get clean context for Claude Code, ChatGPT, or any AI coding tool.

SC
Script Depot · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install gitingest
from gitingest import ingest

summary, tree, content = ingest("https://github.com/cyclotruc/gitingest")
print(tree)      # File tree
print(content)   # All source code as one text

Or use the web UI at gitingest.com.

What is Gitingest?

Gitingest converts any GitHub repository into a single, LLM-optimized text file. It extracts the file tree and source code, filters out binaries and generated files, and produces clean context that fits into an AI conversation — perfect for code review, migration planning, or asking an AI to understand an entire codebase.

Answer-Ready: Gitingest converts GitHub repositories into single text files optimized for LLM consumption. Extract file trees and source code from any repo, ready for Claude Code, ChatGPT, or any AI coding tool. Free web UI at gitingest.com. 8k+ GitHub stars.

Best for: Developers who need to feed entire codebases into AI tools. Works with: Any LLM (Claude, GPT, Gemini), any GitHub repo. Setup time: Zero (web UI) or 1 minute (pip install).

Core Features

1. Web UI

Visit gitingest.com:

  1. Paste any GitHub URL
  2. Click "Ingest"
  3. Copy the output into your AI conversation

2. Python API

from gitingest import ingest

# Basic usage
summary, tree, content = ingest("https://github.com/user/repo")

# With filters
summary, tree, content = ingest(
    "https://github.com/user/repo",
    include_patterns=["*.py", "*.ts"],
    exclude_patterns=["tests/*", "node_modules/*"],
    max_file_size=100000,  # Skip files > 100KB
)

3. CLI

gitingest https://github.com/user/repo > repo_context.txt

# With filters
gitingest https://github.com/user/repo \
  --include "*.py" \
  --exclude "tests/*" \
  --output context.txt

4. Smart Filtering

Automatically excludes:

  • Binary files (images, compiled code)
  • Lock files (package-lock.json, yarn.lock)
  • Generated code (dist/, build/)
  • Large files (configurable threshold)
  • Hidden files (.git/, .env)

5. Output Format

Repository: user/repo
Files: 47
Total size: 125 KB

Directory Structure:
├── src/
│   ├── main.py
│   ├── utils.py
│   └── models/
│       ├── user.py
│       └── order.py
├── tests/
│   └── test_main.py
└── README.md

--- File: src/main.py ---
[full file contents]

--- File: src/utils.py ---
[full file contents]
...

Use Cases

Use Case How
Code review Feed repo to AI for review
Migration "Convert this Flask app to FastAPI"
Documentation "Generate docs for this codebase"
Learning "Explain this project's architecture"
Bug hunting "Find potential bugs in this code"

FAQ

Q: Is the web UI free? A: Yes, gitingest.com is free with no sign-up required.

Q: Does it work with private repos? A: The Python library works with any git URL you have access to. The web UI requires public repos.

Q: How does it handle large repos? A: Smart filtering reduces context size. You can also use include/exclude patterns to focus on specific directories.

🙏

Source & Thanks

Created by Cyclotruc. Licensed under MIT.

cyclotruc/gitingest — 8k+ stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets