When developers ask for help from ChatGPT or other LLMs, they usually struggle to share their code effectively. Copy-pasting individual files loses important context: the project structure, related files, and the big picture.
Repo-Contextor solves this problem by scanning a local Git repository and producing a well-structured text file with the repository’s contents. This file can then be shared with an LLM for debugging, explanation, or collaboration.
Technical Details
Repo-Contextor is written in Python, structured as a CLI tool. The repo is organized under src/rcpack/ with separate modules for:
- cli.py – command-line interface using click.
- discover.py – logic to walk the file system and collect files.
- gitinfo.py – gathers repository metadata.
- treeview.py – builds the project tree structure.
- renderers/ – handles output formats (Markdown, JSON/YAML).
- This modular design makes it easier to add features in future releases.
Working on Release 0.1 taught me a lot about:
1.Project structure:
- How to lay out a Python CLI tool using pyproject.toml and src/ layout.
- Why separating concerns into modules makes code more maintainable.
2.Git and GitHub workflows
- How to set up a new repository properly (with README, LICENSE, etc.).
- How to manage issues, commits, and releases in GitHub.
- Packaging for LLMs
- The challenges of providing enough context without overwhelming the model.
- Why tree views and filtered file outputs are more useful than raw dumps.
In challenges, I faced merging issues, lots of conflict as well as some basic issues such as .vscode/ and rcpack.egg_info/ got checked in and had to re-read some basics of removing it while dealing with multiple folders.
Top comments (0)