One-Click Codebase Flattening for ChatGPT / Claude

This Python script scans your entire project folder, detects used technologies, excludes non-code folders (like .git, node_modules, venv, dist, etc.), and compiles all relevant source files into one readable text file (source_dump.txt).
It also generates a directory tree, so GPT can understand the structure of your project.

This is super helpful when:

  • You want to copy/paste your project into ChatGPT or Playground
  • You need back-and-forth discussion about architecture, bugs, or refactoring
  • GitHub Copilot or IDE integration isn’t an option (or overkill)

Link repo: github. com/liamhnam/ProjectDump

:test_tube: Output sample (simplified):

project/
β”œβ”€β”€ source_dump.txt
β”œβ”€β”€ app/
β”‚   └── main.py
β”œβ”€β”€ utils/
β”‚   └── helpers.js

# ==============
# Path: /path/to/your/project
# Detected tech: python
# ==============

## DIRECTORY STRUCTURE

New folder/
β”œβ”€β”€ __pycache__/
β”œβ”€β”€ __main__.py
β”œβ”€β”€ aggregator.py
β”œβ”€β”€ constants.py
β”œβ”€β”€ detector.py
β”œβ”€β”€ filters.py
β”œβ”€β”€ one_file_version.py
β”œβ”€β”€ source_dump.txt
└── tree_generator.py

## FILE CONTENTS

### __main__.py

import os


:white_check_mark: Why it works well with ChatGPT:

  • You only paste one file, instead of uploading or pasting many
  • GPT sees the full context and file relationships
  • Cleaner debugging and faster iteration
1 Like