Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I have a custom agent located at .cursor/agents/a11y-agent.md, which is designed to execute accessibility-related tasks directly.
When I manually invoke the agent using:
/a11y-agent fix JIRA-1111
I expect Cursor to execute the request directly within the already active a11y-agent.
However, after inspecting the chat transcript, I found that Cursor automatically injects the following block into the user prompt before sending it to the model:
<subagent_delegation_context>
The user has indicated they want you to delegate work to the following subagent(s): a11y-agent
To delegate, call the Task tool with the subagent_type parameter. Example:
Task(subagent_type="a11y-agent", prompt="your detailed task description")
</subagent_delegation_context>
<timestamp>Tuesday, Jul 21, 2026, 11:27 PM (UTC+5:30)</timestamp>
<user_query>
/a11y-agent fix JIRA-13652
</user_query>
Because of this injected context, the active a11y-agent ends up invoking the Task tool to delegate the work to another instance of a11y-agent, even though the user has already explicitly selected that agent via the /a11y-agent command.
This results in an unnecessary self-delegation/context switch. The agent first gathers information, then packages that information into another Task invocation, causing duplicated context, additional token usage, increased latency, and behavior that is different from what is defined in the agent prompt. My agent definition does not instruct it to delegate to itself—the behavior is entirely caused by the automatically injected subagent_delegation_context.
Steps to Reproduce
- Create a custom agent:
.cursor/agents/a11y-agent.md - Ensure the agent performs work directly (without instructing it to delegate).
- Open Cursor Chat.
- Invoke the agent manually:
/a11y-agent fix JIRA-1111 - Inspect the chat transcript.
- Observe that Cursor automatically injects subagent_delegation_context.
- The model then delegates the work using the Task tool instead of executing it directly.
Expected Behavior
When a user explicitly invokes an agent using:
/a11y-agent ...
Cursor should treat that agent as the active execution context.
It should not inject:
<subagent_delegation_context>
...
</subagent_delegation_context>
unless the user explicitly asks for delegation or another agent decides delegation is necessary.
The manually invoked agent should simply execute the request.
Operating System
MacOS
Version Information
Cursor IDE: 3.12.17
For AI issues: which model did you use?
Model: composer-2.5
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor