Ability to view project context size (to help advanced users stay ahead of their .bolt/ignore file)

Ability to view project context size (to help advanced users stay ahead of their .bolt/ignore file).

A button or command that will read the current project files sans the directories and files set to ignore, and report the number of tokens the project has. So for example when the project size gets near 200k, the user can tweak their .bolt/ignore file to slim the project if needed.

A more fancy brief report that listed the project directories and their content’s “token count” would help users identify places to possibly set to ignore.

Isnt this the token usage we already got in the terminal output?

image

Actually token usage was added, but then there were changes that broken it(though initially it seems that it worked)

feat: in progress : add Token Usage Statistics by Stijnus · Pull Request #887 · stackblitz-labs/bolt.diy · GitHub(this one adds better UI though it went in weird direction of reporting global token usage, I think its better stop per chat and per message)

I was trying to take a look at why its not working today.
Hope to fix soon.

1 Like

Turns out it works with npm run dev but not with npm run preview

Hope we fix it soon.

I will clarify with an example.

Using the AI to code in a react project where I have (with the AI’s help) created a re-usable system for creating Widgets for my website and documentation on how to implement the widgets at new creation.

The AI does not need full access to the re-usable system in the project files, so I can set those directories to be left out of the ‘context window’ via .bolt/ignore. Then the ‘re-usable systems documentation file’ is like an API for the AI to navigate the project, create my new widgets with some or all of the features I built into the re-usable system, and so on.

I can then put the documentation for the re-usable system in the project files. Then tell bolt.diy to always review that folder before making any ‘thoughts’ about the codebase or how to do what I ask it to do in a given prompt.

This is the foundational, ultimate way to use AI to code in complex codebases.

Right now bolt.diy has decided to use the “chat history” approach. That makes it impossible to work with complex code bases, because I do not have a reliable way to tell the bot “this is ALWAYS the documented pattern & recipe for doing this-thing (i.e. create a widget using my re-usable system).”

So; I hope you guys will create a feature that lets me tell the AI to use the project files, and first of all, my “documentation” folder, before doing anything ‘thinking’ about the project!

The OP post about getting information about the current “context size” of the project files is so that Power Users can keep track of the current ‘context size’ of their un-.bolt/ignore’d codebase. And enable the user to manage the size of their project’s ‘context window size’ by adding and removing project files directories to the ignore file as necessary throughout development.

P.S. Additional example outside of my re-usable widget system:
The system of telling the bot to look at its ‘documentation’ instructions can be used to do things like make sure the bot covers all of the ‘bases’ when implementing a new user input form that needs to follow certain security protocols.

related thread where TheCodacus talks about a PR he has up on github to improve this critical aspect of bolt.diy Bolt.diy doesn't use project files for contextualizing its knowledge - #6 by traflagar

1 Like