This guide covers common tasks when interacting with Bolt. You should also review the Best practices guides, for tips on getting the most out of Bolt.

Automatically improve your prompts

Bolt helps you craft better prompts, which are key to building successfully.

  1. Write your prompt in the chatbox.
  2. Click Enhance prompt Star icon. Bolt generates a recommended prompt, which you can then edit.

Change the mode

When talking with Bolt in your project, you can switch between two modes:

  • Build Mode: Bolt takes your prompt and makes changes to your files immediately.
  • Discussion Mode: talk with Bolt, without it making changes. This is useful if you want to discuss ideas, plan work, or troubleshoot, without using a large amount of tokens. Refer to Discussion mode for more information on this feature.

To switch between modes: in the Bolt prompt box in your project, click Toggle Chat icons used as button to toggle between build mode and discussion mode to toggle between Discussion Mode and Build Mode.

Add files to inform Bolt

You can give Bolt extra information by uploading files.

You can upload files when creating a new project on the Bolt homepage, or in an existing project in your chat. To upload a file, either:

  • In the chatbox, click Upload files Upload file icon, then select the files you want to upload.
  • Drag and drop the file into the chatbox.

For example, you can:

  • Add an image as an example of the look and feel you want.
  • Work on defining your product features with your team in a separate document, then upload it to Bolt.

Guide Bolt’s focus

You’ll get more accurate results if you’re explicit about what Bolt should and shouldn’t change.

Limit Bolt to specific files

  1. Right-click the files you want to focus on in the Bolt Code editor.
  2. Select Target file.

Exclude specific files or directories

  1. Right-click the files or directories you want to exclude in the Bolt Code editor.
  2. Select Lock file (single file) or Lock all (directory).

Focus on a specific code section

  1. Make sure you’re in Code view.
  2. Highlight the code you want to discuss or change.
  3. Click the Ask Bolt button (if the button doesn’t appear immediately, try right-clicking). Bolt links the selection in the prompt box.
  4. Enter your question or request.

Focus on a specific UI element

  1. In Preview view, click Inspector Inspector icon.
  2. Click the element you want to focus on. Bolt links the selection in the prompt box.
  3. Enter your question or request.

Clean up unused files

Cleaning up unused files reduces the size of the context window, which means you use fewer tokens.

Bolt uses a tool called Knip to perform the cleanup. You can run this when prompted by Bolt, or run it manually at any time.

Before proceeding, back up your project using both of these methods:

  1. From the left-side panel, select your project. Then, click Export > Download located at the center top of the page.

  2. Now, from the drop-down, click Duplicate to create a fresh copy of your project in Bolt.

Automatic cleanup when prompted:

If your Bolt project exceeds the context window (200k tokens for free accounts, 500k for paid accounts), Bolt notifies you in the chat, saying Project size exceeded. Click Remove unused files to run the cleanup.

Manually run the cleanup:

In the Bolt terminal run the following command:

npx knip --production --fix --allow-remove-files

Check the output in the terminal to see if the command ran successfully. This command removes unnecessary files from the codebase, which reduces the project size.

Change individual lines rather than rewriting whole files

Bolt uses diff-based editing to identify the related parts of the code and make isolated updates.

Diff-based editing significantly increases:

  • Token efficiency: Bolt works smarter, not harder. Reading and writing less saves tokens.
  • Speed: Focused operations take less time.
  • Precision: Bolt makes precise changes without disturbing the surrounding code.