Your AI agent is flying blind. Fix it in one command.
gitcontext
Generate CLAUDE.md / AGENTS.md files for any codebase in seconds. Static analysis detects your stack, architecture, commands, and conventions. --deep mode uses Gemini or Claude to produce a rich context doc from actual source code.
The Problem
AI coding agents (Claude Code, Cursor, Copilot) work better with context files. Writing them manually is tedious and they go stale. Most repos have nothing, so your agent guesses wrong about your build system, test commands, and architecture.
Before: Agent hallucinates your project structure, runs wrong commands, misses conventions.
After: One command generates a context doc. Your agent knows your stack instantly.
$ gitcontext . --output CLAUDE.md
Quick Start
Run on your repo in 10 seconds:
pip install gitcontext
gitcontext . --output CLAUDE.md
That's it. Commit the file and your AI agent instantly knows your stack, commands, and architecture.
Install
pip install gitcontext
For AI-enhanced deep analysis:
pip install 'gitcontext[all]' # Gemini + Claude support
Usage
# Analyze current directory
gitcontext .
# Analyze any local repo
gitcontext /path/to/repo
# Analyze a GitHub repo directly (shallow clones it)
gitcontext https://github.com/huggingface/lerobot
# Write output to file
gitcontext . --output CLAUDE.md
# AGENTS.md format (slightly different structure)
gitcontext . --format agents
# Deep mode: LLM reads your source code for richer output
export GEMINI_API_KEY=... # or ANTHROPIC_API_KEY
gitcontext . --deep --output CLAUDE.md
# Choose model for deep analysis
gitcontext . --deep --model gemini-2.5-pro
Example Output (Static)
Running gitcontext . on huggingface/lerobot:
## Project Overview
lerobot — State-of-the-art Machine Learning for Real-World Robotics in Pytorch
## Tech Stack
Python · PyTorch · Hugging Face Transformers · Hugging Face Datasets · Gymnasium · uv
## Development Setup
uv sync --locked
## Key Commands
uv run pytest tests
pre-commit run --all-files
## Architecture
- benchmarks/ — Performance benchmarks
- docker/ — Docker configuration
- docs/ — Documentation
- examples/ — Example scripts and tutorials
- src/ — Source code
- tests/ — Test suite
## Entry Points
- lerobot-calibrate = lerobot.scripts.lerobot_calibrate:main
- lerobot-record = lerobot.scripts.lerobot_record:main
- lerobot-train = lerobot.scripts.lerobot_train:main
- ... and 14 more (see pyproject.toml)
## CI/CD
CI: GitHub Actions (benchmark_tests, docker_publish, documentation, fast_tests, full_tests)
Generated in ~2 seconds. No API key needed.
Deep Mode (--deep)
Deep mode sends your key source files (configs, entry points, core modules) to an LLM and generates a comprehensive context doc with:
- Architecture explanations (the why, not just file names)
- Conventions and patterns (naming, config systems, inheritance)
- Common gotchas and non-obvious behaviors
- Exact setup and contribution workflows
export GEMINI_API_KEY=your-key # Free tier works fine
gitcontext . --deep --output CLAUDE.md
Auto-detects provider from environment variables. Set GEMINI_API_KEY or GOOGLE_API_KEY for Gemini, ANTHROPIC_API_KEY for Claude.
See examples/output-deep-lerobot.md for sample deep output.
Supported Languages & Frameworks
| Category | Detected |
|---|---|
| Languages | Python, TypeScript, JavaScript, Rust, Go, Java, C/C++, Ruby, Kotlin |
| Python Frameworks | FastAPI, Flask, Django, PyTorch, TensorFlow, Click, Pydantic |
| JS/TS Frameworks | React, Next.js, Express, Vite, Svelte |
| Build Systems | pip, uv, poetry, npm, yarn, pnpm, cargo, go mod, cmake, make |
| CI/CD | GitHub Actions, GitLab CI, CircleCI, Jenkins |
| Test Frameworks | pytest, unittest, jest, vitest, cargo test, go test |
How It Works
- Walk the repo file tree (respects
.gitignorepatterns, skips binaries) - Detect languages by extension ratio, frameworks by dependency files, build/test/CI by config files
- Generate structured markdown from detections
With --deep:
- Select the ~15-20 most important files (configs, entry points, largest source modules)
- Send to Gemini/Claude with a prompt tuned for generating contributor-facing docs
- Output the LLM-generated CLAUDE.md
Total context sent to the LLM is capped at ~80K characters to stay within free tier limits.
Comparison
| gitcontext | gitingest | Manual | Nothing | |
|---|---|---|---|---|
| Auto-detects stack | Yes | No (dumps raw files) | N/A | N/A |
| Structured output | Yes | No | Yes | No |
| Works on any repo | Yes | Yes | No (per-repo effort) | N/A |
| AI-enhanced mode | Yes | No | No | No |
| Speed | ~2s static, ~15s deep | Varies | Hours | 0s |
| Output quality | High (targeted) | Raw dump | Highest | None |
gitingest gives you a raw file dump to paste into an LLM. gitcontext gives you a finished, structured context doc ready to commit.
GitHub Action
Keep your context doc up to date automatically. Add this to .github/workflows/update-context.yml:
name: Update CLAUDE.md
on:
push:
branches: [main]
paths:
- 'src/**'
- 'pyproject.toml'
- 'package.json'
- 'Cargo.toml'
jobs:
update-context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jashshah999/gitcontext@main
with:
deep: false
output: CLAUDE.md
commit: true
For deep mode, add your API key as a repository secret and set deep: true:
- uses: jashshah999/gitcontext@main
with:
deep: true
output: CLAUDE.md
commit: true
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
See examples/workflow.yml for the full example.
Contributing
git clone https://github.com/jashshah999/gitcontext.git
cd gitcontext
pip install -e '.[all]'
pytest tests
PRs welcome. Keep it simple — the goal is a tool that works on any repo without configuration.
License
MIT
Metadata
Release files for gitcontext-ai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gitcontext_ai-0.1.0.tar.gz | 21.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitcontext_ai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / gitcontext_ai-0.1.0.tar.gz
| Download URL | gitcontext_ai-0.1.0.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f371bdf262f70e6ee3af42cf2cd45aad763e6fb8e2828776a2c8472743df2e3
|
|
BLAKE2b-256 checksum How to use checksums |
804f8646486e17f9d9426f55f93b37d62ad4b04630323c34f397756cd9a6d73e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / gitcontext_ai-0.1.0-py3-none-any.whl
| Download URL | gitcontext_ai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f67db5d56497c0c8aaff5abb12cb242d58f50319bd532fa5bb12a3b0d5f6ab51
|
|
BLAKE2b-256 checksum How to use checksums |
5b9c93edfde2ae46825061c318539ffdf24d5ebe4e605659e5ac3b7c38d49e21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for gitcontext-ai 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.