---
title: "Discussion on \"Stop Wasting 50K Tokens Per Conversation & Pre-Index Your Codebase for AI Assistants\" | Hashnode"
description: "Discussion on \"Stop Wasting 50K Tokens Per Conversation & Pre-Index Your Codebase for AI Assistants\". CLI tool that scans codebases and generates compact markdown index files for AI assistants. Supports Flutter, NestJS, Next.js, Bun, TypeScript."
url: "https://hashnode.com/posts/stack-shared-ai/69d9d5afc8e5007ddb4ba381"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Stop Wasting 50K Tokens Per Conversation & Pre-Index Your Codebase for AI Assistants](https://axat.hashnode.dev/stack-shared-ai?utm_source=hashnode&utm_medium=feed)

CLI tool that scans codebases and generates compact markdown index files for AI assistants. Supports Flutter, NestJS, Next.js, Bun, TypeScript.

Apr 11 · 4 min read · axat.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#ai-tools](https://hashnode.com/tag/ai-tools)
-   [#developer-tools](https://hashnode.com/tag/developer-tools)
-   [#developer](https://hashnode.com/tag/developer)
-   [#cli](https://hashnode.com/tag/cli)
-   [#claudeai](https://hashnode.com/tag/claudeai)
-   [#cursor](https://hashnode.com/tag/cursor)
-   [#gemini](https://hashnode.com/tag/gemini)
-   [#copilot](https://hashnode.com/tag/copilot)
-   [#flutter](https://hashnode.com/tag/flutter)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#express](https://hashnode.com/tag/express)
-   [#next-js](https://hashnode.com/tag/next-js)
-   [#bun](https://hashnode.com/tag/bun)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#opensource](https://hashnode.com/tag/opensource)
-   [#nestjs](https://hashnode.com/tag/nestjs)

## Written by

[Akshat Bhuhagal](https://hashnode.com/@Axat)

@Axat

  
[View profile](https://hashnode.com/@Axat)

I am a Software Engineer focused on user‑friendly experiences &amp; passionate about building excellent software that improves the lives of those around me.

## Responses 2

Markdown supported · ⌘↵ to post

[Ethan Frost](https://hashnode.com/@ethanfrost)

[Apr 12](https://hashnode.com/posts/stack-shared-ai/69d9d5afc8e5007ddb4ba381/comment/69db4e28aadf1107e2a50e88)

Pre-indexing is the right approach. The default behavior of most agent frameworks is to re-read the entire codebase context on every turn, which is wildly wasteful. A pre-built index that the agent can query selectively — like a codebase-aware RAG layer — cuts token usage dramatically. The key insight: most agent turns only need 2-3 files of context, not the full repo. If you can pre-index with embeddings and let the agent pull just what's relevant, you save 80%+ on tokens without losing quality. This is especially critical for teams tracking cost per session.

[Akshat Bhuhagal](https://hashnode.com/@Axat)

[Apr 15](https://hashnode.com/posts/stack-shared-ai/69d9d5afc8e5007ddb4ba381/comment/69db4e28aadf1107e2a50e88#reply-69df1ff291716f3cfba9d9aa)

Thanks & totally agree, this just make so much more sense both from a cost and performance perspective
