Skip to main content
1min read
Dev Notes

How to stop Claude from scanning your entire codebase every session

WebDNA generates a single manifest file at build time. Claude reads that instead of crawling your files. Here is how to set it up.
Published
Reading time
1 min
Length
190 words
Filed under
claude, webdna, ai, context, nextjs

TL;DR

  1. AI coding tools scan the whole codebase at the start of every session because they have no other way to get context, and that scan costs tokens each time.

  2. WebDNA builds a JSON map of your routes, components, API endpoints, and brand tokens at build time, so an agent reads one file first.

  3. Since the first post it has a two-tier manifest for hiding private routes, a fallback route at /api/webdna, and a linter for missing descriptions and auth scopes.

If you use Claude or Cursor on a real project, you have probably hit the point where it starts reading every file just to understand what the codebase looks like. It is not doing anything wrong. It just has no other way to get context. So it scans, and that scan costs tokens every single session.

I wrote about WebDNA a while back. The short version is that it is a Next.js plugin that generates a JSON file at build time describing your routes, components, API endpoints, and brand tokens. AI agents read that file first instead of crawling your source.

Since the first post I have added a two-tier manifest system so you can exclude private routes and sensitive components from what the AI sees, a fallback API route at /api/webdna for agents that cannot access .well-known directories, and a linter that catches missing descriptions and undeclared auth scopes before they become a problem.

If you want to try it on your project, the full setup guide is at webdna.omraj.guru. It takes about five minutes and works with any Next.js project using App Router or Pages Router.