Adding a New Project

Add a Project Folder

Stubs is similar to VS Code where you need to specify a folder for your project. Stubs reads your directory to generate embeddings and document your codebase but everything is stored locally.


  • Click the Add New Project button.

    Its on the left-top corner of the app.

  • A new window will pop up. Fill out the necessary fields:
    • Name: Provide a name for the project.
    • Project folder: Select the folder of the project from your computer.
    • Project Description:Enter a description of the project.
    • Rules for LLM: (Optional) Provide additional instructions for the LLM result for this project.
      Example Rule:
      Avoid using regex if possible. I prefer if you don't nest functions inside functions, or overly use recursion. Make sure to use existing CSS variables if they exist, and create new ones when it makes sense. Scope CSS to the section or area it's being applied rather than a generic classname that may conflict with another part of the application. Use modern ES6 javascript, fetch for ajax, and make sure to separate UI code from business logic.

  • Click Next
  • Specifying Which Project Files Should be Included: (VERY IMPORTANT)

    It is very important to prune unnecessary files not needed for coding using the .stubignore file. The less files you have to sift through the more likely Stubs will choose the correct files as context for your coding tasks. So if for example you are not working on the authentication part of the application, you can add your authentication folder to the .stubignore.

    • Stub Ignore

      The .stubignore is at the bottom of the panel, and if you add rules in this section, then the panel above with the folders/files will cross out more folders/files and the total count of files will go down. It is recommended to not have more than 200 total project files so try to add rules to reduce as many as you can.

    • Directory/File Listing Panel

      As you add more things to .stubignore things will be crossed out in this panel and the total count of files will go down.

    • Use LLM to Prune Unlikely Files
      • If you wish to automatically prune a bunch of files you can use an LLM
      • First press the "Use LLM to Prune Unlikely" which will ask chatgpt/claude etc to make rules for you to exclude unlikely project files needing editing
      • You can see the current file amount and the suggested file size after pruning. You can adjust the amount by using the slider control.
      • You can also provide more specific instructions for pruning.
        Example Rule:
        Keep any files related to the dashboard, homepage and login system

        In this sample, you let the LLM know that a specific folder or feature is important, so it won't exclude any related files. Otherwise, if you are reducing hundreds of files to 70, it might create rules that omit the files for the current thing you're working on.

      • If everything is set, click the Prune button. To cancel, click outside the panel. New rules will be added to bottom of the .stubignore and the file count should go down.
  • Once an acceptable amount of total files are included you can click the Next button
  • Final Settings
    Document Code Files by LLM for Better Indexing

    If the checkbox is checked, then an LLM will be used at startup of application to document some of your code files. This can enhance the likelihood Stubs chooses the right files for context but could increase API costs.

  • Finally click "Save Project".

Please wait for Stubs to sync your project. Once its done, you can start doing tasks for your project.