Skip to content
Guide

Upload a folder or codebase to ChatGPT

ChatGPT can't take a folder, but it can take a ZIP of one. Attach the ZIP and ChatGPT unpacks it with its Python tool and reads the files with their paths intact. Leave out dependencies, build output and secrets first so the upload stays small.

How to upload code to ChatGPT by hand

For a project in git, this zips the files git knows about and nothing it ignores. From the project root:

macOS / Linux
cd my-appgit ls-files --cached --others --exclude-standard | zip ../my-app.zip -@
Windows (PowerShell)
cd my-appgit ls-files --cached --others --exclude-standard | Where-Object { Test-Path $_ } | Set-Content files.txttar -a -cf ..\my-app.zip -T files.txtRemove-Item files.txt

git ls-files lists every file git tracks plus new files you haven't committed, and skips anything in .gitignore. So node_modules/, .venv/ and build output stay out, and the folder structure is kept. Windows 10 and 11 ship tar, which can write a ZIP; the list goes through a file because PowerShell 5.1 garbles paths piped straight into it.

Check for secrets before you upload

This takes whatever git sees. A .env that isn't in .gitignore, or a key committed by mistake, goes into the ZIP. List the contents first with unzip -l ../my-app.zip or tar -tf ..\my-app.zip.

Attach my-app.zip with the + button, or drag it into the message box. Start your message by asking ChatGPT to extract the ZIP and list what's inside, so you know it read the files rather than guessing from the name.

Then tell the AI how to answer. Most of the pain comes later, when changed files come back as bare names and you have to work out where each one goes. Ask for full paths up front:

Add to your prompt
For every file you change or create, give the complete file, not a snippet.Put its full path from the project root on the first line,for example: // src/lib/auth.tsKeep the same folder structure. Don't move files to the root.

The faster way: contextzip

contextzip does the packaging from your stack rather than from .gitignore alone. It knows a Next.js app doesn't need .next/ or lockfiles and a Django app doesn't need __pycache__/, and it keeps secret files out even when git tracks them. It packages the files on your disk, so private and uncommitted code works too.

1. Install it once. With Python 3.9 or newer, use pip (pipx and uv work too). Without Python, npm install -g @contextzip/cli, Homebrew or Scoop install the same tool.

bash
pip install contextzip

2. Package the project. Run cz from the project root. It detects your stack, leaves out dependencies, build output, caches, binaries and secret files, and puts the ZIP on your clipboard as a real file.

bash
cz

3. Paste it into ChatGPT. Click the message box and press Ctrl+V (⌘V on a Mac). The ZIP attaches like any file you copied in your file manager. It also carries a short CONTEXTZIP.md that tells the AI how to reply: complete files, the same paths, secrets left as [REDACTED].

4. Write the answer back. Ask for the changed files as a ZIP, download it, and point cz apply-zip at it. Or drop it in .contextzip/inbox/ and run cz apply-zip with no arguments.

bash
cz apply-zip ~/Downloads/reply.zip

AI replies rarely come back in the shape you sent. A ZIP can arrive wrapped in an extra folder, relative to a subfolder (src/… for frontend/src/…), or flattened to bare file names. apply-zip matches each file to your project by the longest stretch of its path that agrees, and new files follow their siblings. A name that fits several files, like three different page.tsx, is settled by comparing contents. If it's still unclear, you choose. Nothing is written on a guess.

It also compares three versions of every file: what you sent, what's on disk now and what came back. Edits you made in the meantime are merged, not overwritten, and anything that clashes waits for you. How apply-zip works

~/projects/my-app

$ contextzip apply-zip

✓ Resolved · .contextzip/inbox/fix.zip

✓ Compared with snapshot #14 (k3f9a2) · named in the reply's CONTEXTZIP.md

Paths in the zip were remapped: my-app-fixed/… → …

✓ Classified 6 files · 1 modified, 1 merged, 1 new, 1 unchanged

! 1 conflict, 1 partial — needs your call

FAQ

Can ChatGPT read ZIP files?
Yes. ChatGPT unpacks an uploaded ZIP with its Python tool and can list and read the files inside, with their folder paths. If it only describes the archive, ask it to extract the ZIP and read the files.
How do I upload multiple files to ChatGPT?
You can attach several files to one message, but there's a cap on how many, and they arrive without their folder paths. For a code project, one ZIP is simpler: it counts as one file and keeps the structure.
Can ChatGPT read a GitHub repo?
ChatGPT can connect to GitHub on some plans. A ZIP works on any plan, for private repositories, and for code you haven't committed or pushed yet, because it comes from the files on your disk.
What should I leave out?
Dependencies like node_modules and .venv, build output, caches, lockfiles, binaries and secrets. contextzip leaves all of these out by default. If you include a .env on purpose, every value in it is replaced with [REDACTED].
How do I apply ChatGPT's changes to my code?
Ask for the changed files as a ZIP, download it, and run cz apply-zip on it. It matches each file to its real place in your project, even if ChatGPT flattened the paths, and asks before overwriting anything you changed since.