Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-context

Generate compressed git repository context summaries, optimized for pasting into LLM prompts.

Why

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.

Install

pip install git-context

Or run without installing:

python -m git_context .

Usage

# 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

Example output

# 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
...

What it detects

  • File tree — respects .gitignore and 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)

Zero dependencies

git-context uses only the Python standard library. No installs, no conflicts.

License

MIT

About

Generate compressed git repo context summaries optimized for LLM prompts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages