Generate compressed git repository context summaries, optimized for pasting into LLM prompts.
When you're working with Claude, Cursor, Copilot, or any LLM, you constantly need to give it context about your repo. git-context produces a clean summary — file tree, languages, dependencies, recent commits — in one command. Paste it into your prompt and go.
pip install git-contextOr run without installing:
python -m git_context .# Print a markdown summary of the current repo
git-context .
# Copy it to your clipboard
git-context . --copy
# Output as JSON
git-context . --json
# Just list files
git-context . --files-only
# Inline source code for small files (<4KB)
git-context . --include-source
# Trim output to fit a token budget
git-context . --max-tokens 50000
# Include more recent commits
git-context . --commits 20# Git Context: my-app
**Path:** `/home/user/projects/my-app`
**Remote:** https://github.com/user/my-app
**Branch:** `main`
**Files:** 42
## Languages
- Python: 28 files
- YAML: 5 files
- Markdown: 4 files
## Dependencies
### pip
- `fastapi` = `0.104.1`
- `httpx` = `0.25.2`
## File tree
src/
src/main.py
src/config.py
tests/
tests/test_main.py
...
## Recent commits
- `a1b2c3d` 2024-01-15 — Fix edge case in config loader
- `e4f5g6h` 2024-01-14 — Add retry logic for API calls
...- File tree — respects
.gitignoreand skips common dirs (node_modules,__pycache__,.venv, etc.) - Languages — by file extension
- Dependencies — parses
requirements.txt,pyproject.toml,package.json,go.mod,Cargo.toml - Recent commits — last N commits with hash, author, date, message
- Optional inline source — source code for small files (<4KB)
git-context uses only the Python standard library. No installs, no conflicts.
MIT