Agent

Agent, Chat, Manual

Sweep is the fastest and highest quality agent in JetBrains. We support three modes: Chat, Manual, and Agent.

Sweep automatically implements unit tests, boilerplate code, prototypes, and well-specified features.

Using Agent

Press ⌘/ctrl J or click the Sweep icon to open our sidebar.

Use @ to mention files in your chat. For example, @auth.py will add the file auth.py to the context of the chat.

Accept/Reject changes

In each Agent chat, Sweep automatically applies changes to the files. You can click "Accept/Reject" on each change, or click "Accept All/Reject All".

Checkpoints

One of the core features of Sweep is the ability to "checkpoint" and rollback to previous states. This gives you the freedom to experiment without losing your progress.

To do this, you can click "Restore Checkpoint," and either revert changes in bulk or one at a time. We track all changes since the chat was sent.

Restore Checkpoint

Chat Mode / Manual Mode

  • Chat Mode: This searches the codebase for context and doesn't automatically edit your code. Use this if you're asking questions or don't know the exact implementation you want yet.
  • Manual Mode: This does not search the codebase and doesn't automatically edit your code. Use this if the task you're working on needs very specific context, and you want to tailor it heavily.

You can toggle between modes using ⌘ . or ctrl ..

Tips & best practices

Sweep won't always get what you want. If you're not getting good results, here are things you can do:

One chat per task

It's best to keep the conversation focused on one task at a time. Otherwise, the previous messages in the thread can hurt the intelligence of the model.
To create a new chat, you can press (⌘/ctrl N) or click "+ New Chat."

Describe the current and expected state

  1. Start by describing the current state:
    currently, our app does xyz. I believe this happens in foo.py and it uses utils from bar.py. please confirm you understand.
  2. Ask Sweep to confirm it sees all relevant files for this. If not, work with Sweep to give it the relevant files using @-mentions.
  3. Finally, ask it to implement what you want.
    if the user clicks submit, we should save their data to disk. if this fails i want you to show an error screen, similar to the error screen from in auth.tsx.

Use Manual mode and point out the relevant files

Having more than 10 files or files that are over 2k lines of code in context can hurt performance. You can avoid this by switching to manual mode and specify exactly the files you want the agent to look at.

You can also select specific lines of code by highlighting them and pressing ⌘/ctrl j. This will help the AI make the change in the exact location you want.

Aggressively checkpoint and retry

Sometimes it's hard to know what will work. If your code change can be tested fairly quickly, we recommend having the AI try one of your ideas and click "restore checkpoint" if it's not working.
After each attempt, you can edit your previous message or follow up to tell Sweep to try something else.

Keyboard Shortcuts

You can open Sweep using ⌘ J or Ctrl J or by clicking the Sweep icon in the sidebar.

ActionMacWindows/Linux
Open/Close Chat/Add Code to Context⌘ JCtrl J
New Chat⌘ NCtrl N
Toggle Normal/Search⌘ .Ctrl .