There was a phase where I treated the chat box like a trash chute for an entire codebase.
Select all. Copy. Paste. Pray. Watch the token counter cry. Watch the model confidently rearrange things it barely saw. Watch me pay for the privilege.
I stopped.
Not because context windows got smaller. Because dumping everything is lazy briefing dressed up as thoroughness.
What went wrong with the dump
Whole-repo pastes create three problems:
- Noise wins. The model spends attention on folders that do not matter for the bug.
- You hide the signal. The actual broken function gets buried under generated junk and lockfiles.
- You teach bad habits. If the agent can “see everything,” it starts rewriting everything.
Also, it is slow. You wait longer. You iterate less. You get worse outcomes and call it “AI being flaky.”
What do instead
I attach the smallest set that can possibly be enough:
- The file that fails
- The test that fails (or the log line)
- The interface it depends on
- The diff of what I already tried
- One example of a similar pattern elsewhere in the repo
That is usually five artifacts, not five hundred.
If the agent needs more, it can ask. Or I can pull the next file. Conversation is cheaper than carpet-bombing context.
Diffs beat archaeology
A good diff is a story.
It says: here is what changed, here is what I expected, here is what broke. Models are surprisingly good at reading that story. They are surprisingly bad at reconstructing your architecture from a zip of everything including node_modules vibes.
When I open a PR review with an agent, I paste:
- the PR diff
- the failing CI snippet
- the acceptance criteria in one paragraph
Do not paste the whole service map unless the bug is clearly cross-cutting.
Token burn is a smell
If a task needs a novel’s worth of context to start, either:
- the task is too big and should be split, or
- your repo lacks a map (README, architecture note, module boundaries)
Throwing tokens at a missing map does not create a map. It creates expensive guessing.
I would rather spend twenty minutes writing a better brief than spend two hours cleaning up a confident wrong rewrite.
A practical attach checklist
Before I hit send:
- Can I name the entry file in one breath?
- Did I include the failing output, not just “it broke”?
- Did I exclude secrets, credentials, and giant generated files?
- Is there a smaller example of the pattern I want copied?
- Did I say what not to touch?
If I cannot check those boxes, I am not ready to ask for help. You are ready to go find the file myself first.
Funny side effect
Once I stopped pasting whole repos, my prompts got clearer. My diffs got smaller. My trust in the agent went up, because the failures became understandable.
When it fails now, it usually fails on the thing I pointed at. That is progress. Failure with a flashlight beats failure in the dark.
When big context is actually justified
Sometimes you do need a wide view:
- migrating a shared type across packages
- hunting a race that spans services
- generating a first-pass architecture summary for a repo you just inherited
Even then I do not dump blindly. Start with a tree listing, key entrypoints, and a question: “What else do you need?” Let the agent request files. Treat it like a code walk with a junior, not a document dump into a black hole.
The habit that stuck
Attach files and diffs. Name the goal. Name the non-goals. Keep the rest out of the room.
Your wallet will notice. Your Saturday will notice. The model will still be plenty smart with less junk in its mouth.
A week where this saved me
I was debugging a flaky job that only failed in CI. Old me would have pasted half the monorepo into chat and asked the model to “find the race.”
New me attached the failing job YAML, the worker file, the last green diff, and the exact error line. The agent asked for one more file: the shared lock helper. I attached that. We fixed it in two iterations.
The fix was a twelve-line change. The discarded approach would have been a speculative rewrite of the queue layer. Same intelligence. Better framing.
Guardrails for teammates
If you work with other people, write this as a team habit:
- No whole-repo dumps in shared agent threads
- Prefer links to paths over giant pastes when the tool allows file attach
- Include the failing output every time
- Say the blast radius: “only touch package X”
Bottom line
You will spend less time unspooling each other’s context messes.





