Cursor running and fixing code
23 Apr 2025
I've recently started expanding my usage of Cursor to let it run commands, tests, etc and fix it's own issues. Here's my experience.
AI running and fixing it's own code

As mentioned before, I do most of my development around a base laravel + filament app that takes care of all the SAASy stuff (user registration/authentication, content management, billing, etc), and I just deploy that to very site along with a site-specific package to handle the "jobs to be done" for that site.

As such, I have a very bespoke development environment, where everything is done in one folder (where the base app is).

So to save me time, when I log into WSL and bash, it automatically changes me to that folder.

But in cursor, that causes problems if I'm working on a standalone tool (which I write as a standard laravel app as it's fast for me to do, and I don't need the SAASy stuff). For example, I'm currently working on a Twitter analytical tool for my own use, and it's written as a Laravel app with some CLI commands.

So, when cursor tries to run a command, it runs it in the base application folder, which is where my user profile says to run it. But I want it run in the standalone tool folder.

So, I never let cursor run commands in case it broke my base application.

Now though, I add "when you run any commands, prefix with with 'cd folder/path/here'"

And that's it fixed. It adds that prefix, changes to the proper folder, runs the command, analyses the output, fixes the code, runs the commands again, etc.

Beautiful.

Get Updates

I don't post here frequently. So if you'd like me to let you know when I post something, subscribe below.

    I won't send you spam. You can unsubscribe at any time.

    RECENT POSTS