What are your favourite cursor hacks?

Curious to know what are your hacks or workflows to get the best out of cursor?

1 Like

hack 1: create text files without extensions for easy @ response customisation

then use them in cmd+k, sidebar or composer

can be used for:

  1. different prompts, eg @brainstorm, @refactor, @unittest
  2. different roles, eg @suzie (the project manager) @jim (the designer)
  3. different responses, eg @brief, @bullet, @nocode

hack 2: host your own private knowledge base & index with cursor

This could be a simple blog or a github gist.

Then either add it as @docs in the index, or just paste the URL when you are entering your prompt.

For example - a gist:

https://gist.githubusercontent.com/paulana-microsoft/627bd11caed4ad91223f0556cc6962cf/raw/06b72158e797c259cbee99349164a42d6fa5623b/prompts.txt

Used with the @ url method:

Or add it as a indexed doc

and then use it with @ mention like this

hack 3: cursor ssh to replit

hack 4: use @web for trend/research then get cursor to output it all in a markdown doc

hack 5: set cursor rule to ensure cursor always appends the commands you need to run into a “runthis.sh” file in the root of your project. Then have a 2nd shell command that runs this file, and when fully completed without errors, empties it.

When you ask cursor to make changes - it will change the code - but it wont execute shell commands. Eg go get https://package or npm i package. And sometimes theres a few of these that are needed before the changed code will actually work.

So having cursor write the shell commands to a file which you then run - helps avoid you missing things.

Re your 2nd brain - I created my own Obsidian extension to quickly open a Obsidian doc in Cursor so I can use its AI. Have not tried indexing it - but obsidian has a Publish function so then adding it as a Doc (see Hack 2) shouldnt be hard.

hack 6: have cursor rule to include tasks like - [ ] image prompt filename TODOs in documents / htmls / css - then have a python script running that looks for outstanding todays, makes call to flux to generate the image, saves the file, and marks the todo as complete.

Theres probably more - but thats the top of my head what i use regularly.

I post new hacks and tricks regularly on my X profile x.com

I posted about this Cursor Hacks thread.

12 Likes

Wow! you really have cursor juiced! definitely trying out 1 and 2! how do you host your own knowledge base though?

1 Like

create a simple static site maybe?

1 Like

Wow, these are gold, you’re truly a power user!

Let’s chat and see how we can incorporate some of these to CursorLens

2 Likes

Thanks for sharing! Can’t wait to try these tricks.

1 Like

Ground up application design.

  1. Define requirements in a text file. Use IEEE standards or be simple. Can use composer.
  2. Save file as .txt or .md in a folder. Add the folder to the workspace
  3. Generate code based off of the requirements. If you need to edit requirements, do it on the fly with composer.
  4. Build assertions/tests at the end based on the requirements to ensure the code meets the requirements.
  5. ???
  6. Profit.
3 Likes

Exactly. For one off documents like a SPEC or a PRD - i use MD to help with formatting. For shorter prompts that i reuse regularly I use hack 1 above - eg no extension to make @ mentioning them easier / cleaner.

SQL Easy mode:

If you have the ability: Copy the metadata from a database (Just the field names, data types, any constraints), feed that in as a .txt or .md in the index.

You now never have to write any sql again yourself. With that metadata you can generate 99% accurate SQL queries with the appropriate ‘query’ to the ai models.

2 Likes

FOR WRITERS
Use this in your sys prompt or cursorrules:
“Treat markdown and plaintext as code”.

I believe you @cursor could have a derivative product… one targeting writers, that could compete with the sorts of Scrivener and alikes.

My experience writing text with multiple chapters’ files is awesome.

I haven’t tried, but probably it might work nicely with editing a local repo of an overleaf LaTeX repo, for writing academic articles. ( Local ↔ GitHub ↔ Overleaf)

5 Likes

When editing markdown, tell the agent “add a [somerandomcharstring] in every line”.

In this way the codeblock doesn’t become choopy. Then you just do find/replace for somerandomcharstring

Yep - ive been doing more writing in Cursor than anywhere else. Its great especially with the right prompts/cursorrules

2 Likes

Love these, thanks for sharing.

I’d add that one of the largest, foundational, impactful hacks in Cursor was learning to type far less and talk much more.

  1. Current transcription apps make “talk-and-send-without-review” possible (I’m using Superwhisper for Mac).
  2. LLMs are fantastic at taking a rambling bunch of info and making sense of it.
  3. Once you can provide instructions and feedback in a stream of thought manner, not only is it faster than typing – but the dev experience entirely shifts from carefully wording prompts to brainstorming / collaborating with a LLM as an assistant.

A bit more detail on this approach in this X post.

I also find this setup - and mindset - leans into the most effective way to use tools like Cursor’s Composer, which require an interesting mental shift from how we’re used to doing dev, even with LLM co-pilots over the last couple of years.

Bingo!

Writing and planning are real use cases that are actually more common for me than the coding aspect.

I could use Claude website (and I do) but its often more convenient and more conducive to my flow state to do edits within a code editor.

1 Like

@fvlr That’s clever. Can you do a post on your workflow. Great use case.