Skip to content
Guide

ChatGPT file upload limit for code projects

ChatGPT limits how big each file can be, how many files you attach at once, and how many you upload over time, depending on your plan. For code, the file count is what you run into. Upload the project as one lean ZIP and it counts as a single file.

Get under the ChatGPT file upload limit by hand

OpenAI's help center has the current numbers. None of them can be raised from the chat, so send one small file instead of many. 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.

To trim further, add pathspecs to the end of the git ls-files command:

bash
git ls-files --cached --others --exclude-standard -- . ':!tests/' ':!*.lock' ':!package-lock.json' | zip ../my-app.zip -@

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 builds that ZIP from your stack's rules, so lockfiles, minified bundles, binaries and secret files stay out without a long exclude list. The report next to the ZIP lists exactly what went in and what didn't.

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

To send even less: cz --git-changes for only what you've changed, cz include src/ for one folder, or cz -p "fix the checkout total" to let Gemini pick the relevant files from their paths and sizes.

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

What is ChatGPT's file upload limit?
ChatGPT limits the size of each file, how many files you attach at once, and how many you upload over time, depending on your plan. OpenAI's help center has the current numbers. Code rarely hits the size limits. The file count is what gets in the way.
How many files can I upload to ChatGPT at once?
There's a limit per message, and a rolling upload cap on top of it. Rather than splitting a project across messages, upload one ZIP: it counts as one file however many are inside.
Can ChatGPT read ZIP files?
Yes. ChatGPT unpacks the ZIP with its Python tool and reads the files with their folder paths. If it only describes the archive, ask it to extract it and list what's inside.
Why did ChatGPT say I hit the upload limit when my files are small?
The upload cap counts files, not bytes. Uploading one ZIP instead of many separate files uses far less of it.