Workflow for running the same prompt on multiple pages (scripting

anyone have an idea of how i can accomplish this with cursor?

my idea is to ask cursor to identify blog posts on my website that are similar to the current page.

so the workflow would be:

  1. for all pages in /works/
  2. run the same prompt
    • “suggest 5 other works on that are the most relevant to this page”
    • …some additional prompting to edit each file accordingly, adding the links formatted in a certain way.

basically, i want a way to “script” cursor into executing the same prompt recursively.

Cursor doesn’t have a feature that lets you automate sending prompts.

However, you might be able to make this work with just a single prompt. Depending on how many blogs you have, you could add every blog with the @-reference to your chat message or use the codebase context feature (make sure to enable the “Reasoning step” in the advanced codebase context settings to improve the results). Then, you could ask for what you want, and it might give you all suggestions for every page in one go.

Regarding actually editing the files, you can use the /edit slash command in Chat. However, it doesn’t support editing multiple files at once yet. So, you would need to focus on one blog file, have the chat opened that has the suggestions (/edit sees your conversation history), and say something like “Apply the changes for this blog.”.

cool, thanks for the clarification.

follow-up questions / feature requests:

  • is editing multiple files on the roadmap?
  • can i @ a directory? (where cursor would recursively @ every file in a directory)

Both are on our roadmap.


is there a ballpark timeline on (re)adding the ability to edit multiple files? this will dramatically increase my use cases for cursor.