For vibe coders
Vibe-code more without wasting your AI budget
The short answer
Vibe coding can become more expensive as a project grows because AI coding agents repeatedly need to understand an increasingly large repository. Context optimization can reduce unnecessary repository discovery so more of the AI budget is spent on reasoning, building and modifying software rather than repeatedly locating relevant code.
Momentum, without the rediscovery
The pause where the agent goes off to read the repository again is what breaks the flow. This is the same work without it: ask, get the spans, keep going.
Why vibe coding gets more expensive as your project grows
Vibe coding usually starts cheap. A brand-new project has few files, a simple structure, and an agent can read most of it in a single pass. The cost doesn't show up on day one. It creeps in gradually, as the same kind of question becomes more expensive to answer simply because there's more repository for the agent to search through first.
The same question gets more expensive to answer as your project gets bigger.
That's not a flaw in any particular tool: it's a natural consequence of how AI coding agents work. To make a safe change, an agent generally needs to search for relevant code, open candidate files, read them, follow imports or references, and re-read things it already saw earlier in the session just to stay oriented. Every one of those steps costs tokens before any actual reasoning or code generation happens.
How discovery cost grows with repository size
Consider the same conceptual question, say, “where does user data get validated?”, asked at three different points in a project's life:
- Early project (~10 files): there are only a few plausible places to look. An agent can search, open two or three files, and be confident it found everything relevant.
- Growing project (~300 files): validation logic may now be spread across several modules and layers. The agent has more candidate locations to search, more files to open that turn out to be irrelevant, and more code to re-read to stay confident it hasn't missed anything.
- Larger project (~2,000 files): the same question can require searching many candidate locations, opening files that don't pan out, and repeatedly re-reading code already seen earlier in the session just to keep track of what's relevant.
None of this is fixed: it depends on how the code is organized, how the question is phrased, and how thoroughly the agent searches. But directionally, broad, file-by-file discovery tends to require more tokens to reach the same kind of answer as a repository grows.
This is illustrative, not a measured benchmark curve. The point is conceptual: broad discovery has more places to search as a repository grows, while retrieving only the structurally relevant pieces doesn't necessarily grow the same way. Actual token cost for any specific question still depends on the repository, the question, and the agent.
Ways to cut wasted AI spend, with or without CodeMesh
Some of the most effective fixes here have nothing to do with any particular product; they're just good habits for working with an AI coding agent as a project grows:
- Scope prompts narrowly. Point the agent at specific files or folders instead of asking it to “look through the project”: a narrower starting point means less exploratory searching.
- Close unrelated files and tabs. Several coding agents automatically pull open editor tabs into context; unrelated open files can add tokens the task doesn't need.
- Use project-level ignore rules. Tool-specific ignore files (similar in spirit to
.gitignore) can exclude build output, vendored dependencies and generated code from what the agent searches, so it isn't re-discovering files it will never need to edit. - Batch related questions. Asking several related things in one exchange can reuse context the agent already gathered, instead of re-establishing it from scratch for each separate prompt.
- Keep a running note of key paths and conventions. A short scratch file listing where important logic lives can save an agent from re-discovering your project's layout every session.
- Prefer smaller, focused modules where practical. Code that's easier for a human to scope by hand is usually easier for an agent to scope automatically too.
Where CodeMesh fits in
CodeMesh is a context optimization layer for AI coding agents. It helps agents understand a codebase without repeatedly searching, opening and reading large amounts of source code, allowing them to work with more precise repository context and dramatically fewer unnecessary tokens.
Applied to vibe coding specifically, that means the searching, opening and re-reading part of each request is what gets targeted, not the reasoning or the code generation. The aim is that more of your existing usage limits and API budget goes toward building features rather than repeatedly rediscovering a repository you've already built.