Skip to main content

Problems with agent behavior

Symptoms

  • the agent stops before the task is finished;
  • it invents files or behavior that do not exist in the project;
  • it gets confused in a large project;
  • it goes back to a cancelled task;
  • it makes unnecessary changes or adds unwanted comments;
  • it handles a recurring task poorly.

What to check

  1. Whether the request states a concrete result and a way to verify it.
  2. Whether the necessary files are attached through @file, #file, or a selection in the editor.
  3. Whether you are continuing in an old chat that was about a different task.
  4. Whether the selected agent mode fits the task.
  5. Whether the agent has access to the tools it needs and whether conflicting Rules or Skills get in the way.

Fix

The agent does not finish the task

Split large work into subtasks. First prepare a plan in Plan mode, then run the steps one by one in a new chat. For each step, state a completion criterion, for example that a specific set of tests passes.

To keep tests from being adjusted to fit the implementation, forbid changing them through .writeignore or narrow the area through Edit Scope.

The agent makes facts up

Attach an entry point and ask it to name the file and symbol behind every conclusion. For an unfamiliar project, go through onboarding or add persistent context to AGENTS.md.

The agent went back to an old task

Create a new chat with + New Chat. Do not continue unrelated work in the history of a cancelled task.

The agent does more than asked

State the boundaries in the request and set technical limits through Edit Scope and Tools. Turn a recurring requirement into a Rule, for example: "Do not add comments unless I ask for them".

The agent handles a recurring type of task poorly

Create a Skill with a proven sequence of steps and result criteria.