Skip to content

[bug] Cursor CLI never loads user agents from ~/.cursor/agents, and doctor reports them delivered #1218

Closed

Description

@SaulMoro

Problem

In user scope pull writes each team agent, and teamai-recall, to ~/.cursor/agents/<name>.md, and doctor reports ✔ Agents delivered to cursor. The Cursor IDE reads that directory. cursor-agent does not: it reads agents only from the workspace (<ws>/.cursor/agents, <ws>/.claude/agents, <ws>/.grok/agents). A CLI session gets no user-scope agent unless the workspace is $HOME itself.

That also breaks recall in the CLI. The recall block in ~/.cursor/rules/teamai-context.mdc tells the model to use the teamai-recall subagent, which the CLI does not have.

flowchart LR
    pull["teamai pull<br/>(user scope)"]:::teamai -- writes --> ua["~/.cursor/agents/*.md<br/>incl. teamai-recall"]
    doctor["doctor"]:::teamai -- "compares bytes ✔" --> ua
    ua -- "user agent service (homedir)" --> ide["Cursor IDE"]:::ok
    ua -. "never read" .-> cli["Cursor CLI"]:::broken
    ws["&lt;ws&gt;/.cursor/agents<br/>&lt;ws&gt;/.claude/agents<br/>&lt;ws&gt;/.grok/agents"] -- "computeAgentsDirs" --> cli
    block["~/.cursor/rules/teamai-context.mdc<br/>'use the teamai-recall subagent'"] --> cli
    classDef ok fill:#2f8f4f,stroke:#1f6b39,color:#fff;
    classDef broken fill:#a33a3a,stroke:#7a2a2a,color:#fff;
    classDef teamai fill:#2f5f8f,stroke:#1f4569,color:#fff;
Loading

Evidence

  • Cursor CLI 2026.09.21, 2026.09.22 and 2026.09.28: computeAgentsDirs, run out of each bundle on a temp tree, returns only the three workspace directories. Every subagent service the CLI builds is per workspace (new d.VzO(A,…,"workspace",…) in 8017.index.js, c.map(e=>new _.VzO(e,N,"workspace",I)) in 3306.index.js, r.map(e=>new N.VzO(e,$)) in 8830.index.js). None uses homedir.
  • Cursor IDE 3.16.29 reads the user directory (new k.Vz(we.homedir(),_e,"user",Qe) in cursor-agent-exec, and joinPath(userHome,".cursor","agents") in the workbench).
  • doctor compares the bytes at the path teamai wrote (src/doctor-delivery.ts:908).

Options

teamai keeps one tool id, cursor, for both surfaces, so it cannot write differently for each. What it can do:

  1. doctor says it. "Cursor IDE reads ~/.cursor/agents. The Cursor CLI reads agents only from the workspace."
  2. Recall does not depend on the subagent in Cursor. The Cursor recall block uses the direct form (teamai recall "<keywords>"), as Pi's does, so it works on both surfaces.
  3. Ask Cursor to read ~/.cursor/agents in the CLI, as the IDE does.

I'd do 1 and 2, and file 3 upstream.

Done when

  • doctor names the CLI limit next to the Cursor agents check.
  • A Cursor CLI session gets a recall instruction it can follow.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions