GEMINI LABJP
ASSISTANT — Google Assistant begins shutting down on September 4, with Gemini taking over on Android phones and tablets, Wear OS, and Android AutoMIGRATION — The rollout is staged and may take several weeks to reach everyone. Once it lands, Assistant stops working and there is no way to switch backSURFACES — Wear OS and Android Auto are easy to overlook here. Voice control when you cannot look at a screen asks something rather different from talking to a phone at your deskDROP — The September Android Drop adds a Remembered list in Find Hub for items without a tracker tag, along with Motion Assist and Keep inside Google MessagesCODE — Gemini Advanced now accepts multiple code files in one upload, so you can hand over part of a repository instead of pasting a single file at a timeROLE — The framing around Gemini keeps shifting from chat tool toward a supervised digital worker that handles files, screens, documents, and codeASSISTANT — Google Assistant begins shutting down on September 4, with Gemini taking over on Android phones and tablets, Wear OS, and Android AutoMIGRATION — The rollout is staged and may take several weeks to reach everyone. Once it lands, Assistant stops working and there is no way to switch backSURFACES — Wear OS and Android Auto are easy to overlook here. Voice control when you cannot look at a screen asks something rather different from talking to a phone at your deskDROP — The September Android Drop adds a Remembered list in Find Hub for items without a tracker tag, along with Motion Assist and Keep inside Google MessagesCODE — Gemini Advanced now accepts multiple code files in one upload, so you can hand over part of a repository instead of pasting a single file at a timeROLE — The framing around Gemini keeps shifting from chat tool toward a supervised digital worker that handles files, screens, documents, and code
Articles/Dev Tools
Dev Tools/2026-09-03Intermediate

When Gemini Let Me Upload Several Code Files at Once, I Stopped Selecting by Folder

Once you can hand Gemini a slice of a repository, the hard part moves from pasting to choosing. I measured the dependency graph of my own Next.js repo, found that folder-based selection caught zero callers, and wrote down the selection routine I use now.

gemini111gemini-advanced6code-review3dependency-graphtypescript16

Premium Article

The morning I read that several code files could be uploaded together, the first thing I opened was not Gemini. It was the folder tree of my own repository.

Back when I pasted one file at a time, there was almost nothing to decide. Pasting by hand caps you at two or three files, and that narrowness quietly stood in for judgement. The moment I could send a set, the substitute disappeared.

For a while I selected by folder. I wanted to fix something in src/lib, so I handed over src/lib whole. That did not work well. The comments that came back were correct as prose and never once touched the place that actually broke.

I only understood why after I stopped guessing and started counting. Select the files that call the one you want to change, not the neighbours of the one you want to change. It took me three rounds of the same question to arrive at that sentence.

The day pasting turned into choosing

When the attachment limit rises, the difficulty moves. I used to ask whether one file contained everything. Now I ask whether the one file that decides the answer is somewhere inside these ten.

The awkward part is that an answer arrives either way. Within whatever slice you provided, a coherent explanation can usually be assembled. From the reader's side, a missing file and a wrong conclusion look identical — a trap that simply did not exist in the paste-one-file era.

The Lab sites I run are Next.js on Cloudflare Workers, and article retrieval is concentrated in one thin module. That module is always what I want to change. What breaks is always the code calling it.

How many callers a folder actually catches

Rather than argue from feeling, I counted on the real repository: everything under src in Gemini Lab, 68 TypeScript and TSX files, about 450 KB.

I measured two sets. One is "other files in the same folder." The other is "files that import this one" — the callers.

Target fileOther files in same folderCallersCallers in that folder
src/lib/content.ts2190
src/config/pricing.ts190
src/lib/premium.ts230
src/config/gone-slugs.ts110

Across those four targets there are 32 callers, and zero of them live in the target's folder. In this repository, selecting by folder caught not a single caller.

The 19 callers of src/lib/content.ts are spread across 17 separate directories: article listings, tags, level pages, feeds, the sitemap, a search API route. They share exactly one thing, which is that they fetch articles. The more carefully you split folders by role, the further your callers scatter.

That also explains my three rounds. I was forgetting to attach the one file that decided the answer, every single time.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
You can list, mechanically, which files break when you touch one file, and defend the attachment set you hand to Gemini
You can spot the folder-shaped blind spot that leaves every caller out, before you spend several rounds on confident but irrelevant answers
You can decide where to stop expanding the dependency graph before the attachment size doubles on you
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

Dev Tools2026-04-30
Ship a Production Gemini Agent in 30 Minutes with Mastra and TypeScript
Mastra keeps the lightness of Vercel AI SDK while adding the agent primitives you actually need in production. This guide walks through building, debugging, and deploying a Gemini-powered Mastra agent end-to-end, including the Cloudflare Workers gotchas that bit me first.
Dev Tools2026-03-31
Building Custom MCP Servers for Gemini API — Extending AI Agents with TypeScript
Learn how to build custom Model Context Protocol (MCP) servers in TypeScript and integrate them with Gemini API. Covers architecture, authentication, error handling, and production deployment patterns.
Dev Tools2026-08-21
Why My Length Limit Only Failed on the English Notifications, and the Width-Based Fit That Replaced It
I had Gemini write push notifications in Japanese and English, and only the English ones came out truncated on real devices. The culprit was measuring length in characters. Here are the measured widths and the post-generation fitting code that fixed it.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →