
Lesson Description
The "Background Agents" Lesson is part of the full, Cursor & Claude Code: Professional AI Setup course featured in this preview video. Here's what you'd learn in this lesson:
Steve introduces background agents in Cursor, which operate in a remote environment. They allow developers to spawn tasks that edit and run code independently in the background by cloning a repo and working in a separate branch. A PR is submitted to the repo when a background agent completes a task.
Transcript from the "Background Agents" Lesson
[00:00:00]
>> Steve Kinney: The idea of background agents is asynchronous remote agents and cursor that can operate in a remote environment. So they're not running on your machine, right? Which does give us a few prerequisites, which is in order for them then to read and update your code. Your code needs to be somewhere it can read and update it, right?
[00:00:20]
Generally speaking, that place is GitHub. How do they do what they do? You clone a repository, they clone the repository. They work on a separate branch. You can define stuff like the environment and stuff along those lines, which you can do in all these tools. They work without direct supervision, but they generate a pull request.
[00:00:38]
You can check in on them via a web app, which you can also do. All this stuff applies also to OpenAI's codecs as well. And because they're using a very traditional git workflow, you can very easily spin up multiple of these, right? Because they're just going to clone the repo in their own separate environment, do their thing and open up a pr, right?
[00:01:05]
So you can imagine if I opened up four different chats in cursor in my editor on one branch and said go for it, they are going to crash into each other. There's a science to this if one is surgical about where you point them, but it's not a good science.
[00:01:23]
Some use cases like I have predominantly done it for this code based analysis and documentation, particularly full disclosure and honesty. There are some days where I get into the vibe and then I have to go, what happened here, right? As it has created a lot of abstractions. Even that one little demo we saw of the agent earlier, it was subclassing errors, which is actually really great and something I didn't do all that often until I actually saw it do it a bunch of times because then you can say instanceof it's great, you should do it.
[00:02:02]
But you can imagine on a large enough feature, small things, it's like over time, it's little like proactive, I'm gonna do this extra thing or this little judgment calls tend to compound. And I have definitely found myself in places where I am laser focused on one thing and I'm looking at that very closely and I am not paying nearly good enough attention to the little ad libs it's doing on the side.
[00:02:33]
Like I had one situation where I was just trying. There's not great testing support for Chrome extensions with Playwright. And so I was very focused on getting that working and did not realize and I should have, if I followed my own advice, which I Learned about that advice through messing things up royally, like repeatedly.
[00:02:57]
So I guess it's a chicken or the egg issue, realized that I had to blow everything away and start fresh, right? And like sometimes that was useful too because like I did it all by hand after that, but I knew the shape of what I was doing and so I knocked it all out arguably in the same amount of time it took me to vibe it, right?
[00:03:16]
With like 10th of the line of code that I completely understood. And so do I regret that? Cuz I've spent longer handcrafting throwaway code before in my life too. So yeah, the code analysis and documentation though even. And there were some patterns that I still kept that branch around because there are some things that I'm like, I'm gonna take a few of those ideas, right?
[00:03:38]
And so like sometimes having to explain to you, like I will say this, I've said it before, I'll say it again. Using it as a learning tool for either a code basis that you want to figure out how they work or sometimes, especially if it's not your own, solely written by you.
[00:03:53]
Using any of these tools to just go explain this to me is an incredibly powerful tool. Any kind of code wide chores and maintenance of hey, we're going to refactor this or honestly I. At temporal, we did this partially with I think it was Claude code Tailwind three to tailwind four.
[00:04:21]
You know what I mean? Alex had to have hand on keyboard for a lot of that but large swaths of just the tedium. Right? He was able to like find a way to express what he wanted to do and have done across the code base. Predictable bug fixes or design tweaks like hey, my favorite joke.
[00:04:44]
Because it's not really a joke. I see it all the time. Every time I hear a war story from a front end team. It took 25 pull requests to change the color of a button. I was like micro front ends? And so for those things, I guess automating all of those with these agents would be good and stuff along those lines I think are great use cases for this limits and considerations.
[00:05:10]
Again they use these max mode compatible models so they are going to cost you. You are not in the loop to hit the escape key or cancel and give it feedback and guidance. You do need to turn off privacy mode which I have the advantage of previously working on an open source project.
[00:05:30]
So there was no privacy anyway. So I was never concerned about those things other than triggering it from either Git or Slack. There is no API. There's promises and illusions APIs. But as an engineer, I know never to trust estimates from engineers or product managers because they're trusting estimates from engineers.
[00:05:58]
So that's just a delusion of that.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops