Transform any GitHub repo or folder on your Mac into a simple text file so that you can upload it to an LLM (Claude, ChatGPT, etc.) to reason over the whole thing in the context window.

LLMs like ChatGPT and Claude let you upload files, but they limit how many you can upload at once. When you're dealing with large codebases that have tons of files, you can't just upload them directly to an LLM. You end up having to use RAG (retrieval augmented generation) techniques, which in my experience aren't as effective as uploading everything into the full context window - especially when you need to reason about architecture or understand the entire system.

Flatty is simple to use.

Navigate to your project directory in the Terminal and then type "flatty" - that's it.

The script will output your GitHub repo as a text file (or series of text files in case of large repos) into a folder called "flattened" in your home directory.

I hope you find this tool useful in your own work!

  • arnorhs 2 hours ago |
    I'm not an expert in this field, but won't you quickly exhaust most context windows with any reasonably sized repo?