Adding context to Cursor AI IDE prompts

I'm prompting the Cursor AI IDE with a hundred-ish similar prompts, and I want to automate adding a bunch of files as context to the prompts. The UI for adding a file as context to a prompt is very interactive, e.g. type "@", type or paste the path to the file, hit return. I was wondering if anyone had come up with a macro that did this reliably. My attempts, with a bunch of arbitrary delays, have so far been very flakey. Thanks!

1 Like

You might not need a macro for this. You can add files to a folder in your workspace and include them in your gitignore (so they don't get added to your commits). You can also add docs in the Cursor Feature prefs and as well as rules that the assistant should adhere to.

Thanks for those suggestions. I want to add a different group of files as context to each prompt, and from what I can tell the interactive UI (triggered by typing "@" in the prompt field or clicking on the "@" "Add context" icon) is the only way to do that.

Drag and drop also works, but yeah, pasting paths would be easier to automate.