Linear @Cursor cloud agent (Sonnet 4.5) makes overly broad edits — touches ~18 files when only 1-2 expected

Where does the bug appear (feature/product)?

Cloud Agent (GitHub, Slack, Web, Linear)

Describe the Bug

When triggering the cloud agent from a Linear task via an @cursor comment, the agent makes far broader code changes than the task requires. It modifies many unrelated files, removes comments, reformats code, and fixes issues that were never part of the request. This behavior seems to be getting worse over time despite no changes on our end.

For example, I asked the agent to add a copy-to-clipboard button. Instead of touching 1-2 files, it ended up modifying ~18 files, fixing unrelated TypeScript errors, removing comments, and doing general cleanup that was never requested.

PR with the oversized diff: https://github.com/heylibby/HeyLibbyAmplify/pull/3017/changes

The same model (Sonnet 4.5) behaves much more precisely and conservatively when used in the Cursor IDE. The Linear cloud agent flow seems to have very different (and more aggressive) edit-scoping behavior.

Steps to Reproduce

  1. Create a Linear task with a narrow, well-scoped request (e.g. “add a copy-to-clipboard button to component X”)
  2. Tag @cursor in a comment on that Linear task
  3. The cloud agent picks up the task and opens a PR
  4. Review the PR diff — it will contain many more file changes than expected

This happens consistently across multiple tasks. The agent routinely touches unrelated files, removes comments, fixes unrelated TypeScript errors, and applies formatting changes that were never requested.

Expected Behavior

The cloud agent should only modify the files directly relevant to the requested task. For a request like “add a copy-to-clipboard button,” it should change 1-2 component files at most — not reformat unrelated files, remove comments, or fix TypeScript errors that were never mentioned. The IDE agent with the same model handles this correctly and stays focused on the task scope.

Operating System

MacOS

Version Information

Cloud Agent (Linear integration) — no IDE version applicable

For AI issues: which model did you use?

claude-sonnet-4-5 (Sonnet 4.5)

Additional Information

  • Trigger method: @cursor comment in a Linear task
  • This has happened across multiple tasks, not just once
  • The IDE agent with the same model is noticeably better scoped
  • No changes were made to our setup or Cursor configuration before this started
  • Concrete example PR (18 files changed for a 1-2 file task): https://github.com/heylibby/HeyLibbyAmplify/pull/3017/changes
  • Questions for the team: What is different between the Linear cloud agent flow and the IDE agent flow in terms of system prompt, context window, file-scoping, or edit constraints? Has anything changed recently?

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

I asked it to remove the extra changes, so it rebased the commits, so the initial wrong work is missing. Hopefully the agent session is useful: https://cursor.com/agents/bc-c1245af5-ee00-403e-a575-31c8c4c43f7a

Hey, thanks for the detailed report and the PR example, that really helps.

In short: the difference you’re seeing between the Linear cloud agent and the IDE agent on the same Sonnet 4.5 is expected behavior, not a Linear integration bug. Cloud and background agents GitHub, Slack, Web, Linear are intentionally more autonomous. They’re set up to finish the task end to end without interactive follow-ups, run lint and tests, get the branch into a working state, and commit on their own. Because they optimize for completeness, they’re more likely to touch nearby code, like fixing unrelated TS errors, cleaning up, or reformatting. The IDE agent is interactive and naturally sticks closer to what you asked, so it tends to be more careful on small tasks.

To keep the cloud agent in scope, it helps to set explicit limits:

  • Write boundaries directly in the task: “modify only <file>; do not touch unrelated files, do not fix unrelated lint/TS errors, do not reformat, do not remove comments”.
  • For the cloud agent, .cursor/CLOUD.md is usually best. It’s read only by cloud runs, and the IDE chat ignores it. You can put an explicit rule there to not touch unrelated files without changing local behavior. AGENTS.md is read in both environments. For individual .mdc rules, you can set metadata.environments: cloud for cloud-only. Details and examples: Is there a way to add rule or agent md only for cloud agent?
  • For very small targeted edits, the IDE agent will predictably stay more focused.

On “it gets worse over time”: prompting for cloud verification is tuned from time to time, so some behavior changes are possible. There’s no single regression, but we’re aware that it can be over-eager on small tasks and it’s on our radar. I can’t share an ETA for changes.

I see you already asked the agent to remove the extra changes and it rebased the commits, that’s a solid way to handle it. Let me know if it still drifts after you add explicit scope and rules.

awesome! thanks @deanrie that’s what I was thinking too, wanted to confirm!

I wasn’t aware of the Cloud.md file, very useful! Thank you!