·2 min read

The context window is everything

The context window is the most underrated constraint in AI-assisted development.

Every token you send competes for attention. Long files and dead code dilute the signal. The AI doesn't just read your context. It reasons within it. More noise means worse reasoning.

I learned this the hard way. Early on, I'd dump entire files into Claude and wonder why the output missed the point. I was feeding it everything instead of the right things.

What changed my results: keeping files small, one component per file. When a file does one thing, the AI grasps it immediately. When a file does five things, it guesses which one you care about.

Naming matters more than I expected. A function called calculateDepreciationForABFCategory gives the AI more context than calc ever could. Names are free documentation that fits in the context window without costing extra tokens.

I also started deleting aggressively. Dead code confuses AI the same way it confuses new team members. Unused functions, commented-out blocks, outdated TODOs: every line in the codebase competes for attention. And when choosing which files to include in a session, three relevant files beat ten tangentially related ones. I think of each session as a context budget, and the question is always "what's the minimum the AI needs to do this well?"

This sounds like normal code hygiene. It is. But AI raises the stakes. Messy code that a human navigates with patience becomes messy context that an AI navigates with confusion. The payoff for clean code doubled overnight.