How do you keep the agent focused?

I find that the agent spontaneously decides to go off and change more things. I’ve create a memory to tell the agent to only make “surgical changes” according to the “specified task” but it ignores it anyways.

Is there some kind of mechanism that will follow the agent’s actions and bring it back on the right path?

1 Like

It depends. For example, are those changes linter related? Turn the “auto-fix lints” setting off.

If you asked me to only do “surgical changes”, I probably wouldn’t know what to do. It’s not a clear prompt.

good point, I agree. This “surgical change” prompt is to hint to the agent that when I do submit a specific task - that it stays on target. For example, I asked the agent to update the follow button and it went and address linting issues and started to refactor prisma database connection implementation (even when this was not a useful thing to do in the context of the work, it just thought it was a “smart thing to do at the time”)

I see these memories as a potential way to constrain the on-going behavior of the agent. However, if these are ignored - this not a good use case for these memories.

Perhaps I need to frame every single task with the constraints I want to impose. This is a lot of duplication and I don’t see any Cursor method to do this at scale.

There is an app called grooving.xyz that allows for prompt macros via custom MCP tools - I will try with this service and see if this will do the trick. I know about a project called task master that allows for tasks, sub-tasks. Are there other methods that will work with Cursor that people use ?