Claude file upload limit for code projects
Claude limits how many files you can attach to a chat and how big each one can be, and what you attach has to fit in the context window. For a code project the file count is usually the limit you hit first. Packing the project into one lean ZIP turns hundreds of files into a single attachment.
Get under the Claude upload limit by hand
Claude limits the number of files per chat, the size of each file, and the total, which has to fit in the context window. Anthropic's help center has the current numbers. You can't raise any of them, so the fix is to send fewer, smaller files. Zip only what git knows about, from the project root:
cd my-appgit ls-files --cached --others --exclude-standard | zip ../my-app.zip -@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.txtgit 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.Still too big? Add pathspecs to the end of the git ls-files command to drop folders the AI doesn't need for this task:
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:
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 makes the lean ZIP for you. It detects your stack and leaves out dependencies, build output, caches, lockfiles, binaries and secrets, then tells you how many files went in and how small the ZIP is. On this website's own repository that's 44 files out of 36,220 on disk.
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.
pip install contextzip2. 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.
cz3. Paste it into Claude. 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.
cz apply-zip ~/Downloads/reply.zipWhen the whole project is still too much for one chat, send less. cz --git-changes packages only staged, modified and untracked files. cz include src/ app/ packages only those folders. cz -p "add rate limiting to the login endpoint" lets Gemini pick the files that matter, from their paths and sizes only.
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
- How many files can I upload to Claude at once?
- Claude caps the number of files per chat, and Anthropic's help center has the current number. A code project is usually far more than that, which is why one ZIP of the project works better: it counts as a single file.
- What is Claude's file size limit?
- Each file has a size cap, set out in Anthropic's help center. For code it rarely matters once dependencies and build output are left out: this website's own repository packs into a 63 KB ZIP.
- Does a ZIP count as one file?
- Yes. It's one attachment however many files are inside. Claude opens it with its code execution tool and reads the files it needs, with their folder paths.
- Why does Claude say the chat is too long even though the upload worked?
- Uploads also have to fit in the context window along with the conversation. Send less: cz --git-changes packages only what you've changed, and cz -p "your task" picks only the files relevant to a task.