# How can you index an entire codebase and what can I use it for?

**URL:** <https://forum.cursor.com/t/how-can-you-index-an-entire-codebase-and-what-can-i-use-it-for/164>\
**Category:** Help\
**Created:** [August 25, 2023, 7:26pm UTC](https://forum.cursor.com/t/how-can-you-index-an-entire-codebase-and-what-can-i-use-it-for/164 "2023-08-25T19:26:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karljohan](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@Karljohan](https://forum.cursor.com/u/Karljohan)\
**Post date:** [August 25, 2023, 7:26pm UTC](https://forum.cursor.com/t/how-can-you-index-an-entire-codebase-and-what-can-i-use-it-for/164/1 "2023-08-25T19:26:27Z")

</div>

GPT4 only provides around 8k tokens. How can you index an entire codebase and in which way is it indexed? I’m guessing that it’s not being kept in context when the codebase is much more than 8k tokens?

What exactly can I use it for? Let’s say I have a codebase with different games like backgammon and Yahtzee. Those games are written in the same framework/libraries/style. Could I use the codebase chat to get Cursor to write me another game in the same style as the two games already in the codebase?

---

<div class="post-metadata">

**Author:** ![borisprism](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@borisprism](https://forum.cursor.com/u/borisprism)\
**Post date:** [September 7, 2023, 7:52pm UTC](https://forum.cursor.com/t/how-can-you-index-an-entire-codebase-and-what-can-i-use-it-for/164/2 "2023-09-07T19:52:41Z")

</div>

Probably building vectors and/or compressing the code in some format that has some sort of pointers to search through using your prompt

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 18, 2026, 10:10am UTC](https://forum.cursor.com/t/how-can-you-index-an-entire-codebase-and-what-can-i-use-it-for/164/3 "2026-06-18T10:10:13Z")

</div>


