Skip to content

🤖 feat: merged Cursor and Claude marketplace list in Settings > Plugins - #7844

Merged
ThomasK33 merged 22 commits into
cursor-plugins/fast-agentsfrom
cursor-plugins/marketplace
Oct 31, 2026
Merged

ThomasK33 merged 22 commits into
cursor-plugins/fast-agentsfrom
cursor-plugins/marketplace

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Settings > Plugins now reads .cursor-plugin/marketplace.json beside .claude-plugin/marketplace.json and shows one merged list. A name in both files appears once, with "Preview Cursor build" and "Preview Claude build". A Cursor entry installs through its own folder's manifest with the new cursor-plugin method. The install preview, the update review and the installed plugin card list every part Xum does not apply. Adding github.com/cursor/plugins goes from 2 listed plugins to 128, and all 128 Cursor builds can install.

Background

PR 2 of the Cursor plugin RFC (rfc/20261030_cursor-plugin-support.md, docs PR #7829): section "PR 2", Technical Plan section 3, decisions D20 and D23. It sits on PR 4 (#7841) in the Cursor stack. PR 1 (#7837) reads the Cursor manifest, rules and agents; this PR makes such plugins reachable from the marketplace and shows what they do not apply.

Implementation

  • Parser (claudeMarketplace.ts): one reader for both files (parseClaudeMarketplace(content, file)), per-file caps (8 MiB, 500 entries), and diagnostics that name the file. mergeMarketplaces lists the Cursor entries in file order, then each Claude name the Cursor file lacks; a shared name gets both builds, Cursor first. Entries with a shape problem never merge. A Cursor path source starts at the marketplace root with or without ./ (cursor/plugins lists third_party/attio), under the same containment checks; the Claude rule is unchanged.
  • Install service: the listing reads both files. A broken file beside a good one becomes a warning; a read error waits for the manifest guard, so a root plugin still previews. The guard also covers cursor-plugin (a root .cursor-plugin/plugin.json previews the plugin, not a listing). Each build keeps its own status and skill count. One {file, entry} value flows through read, stage, install and update.
  • Install methods: detectInstallMethods returns cursor-plugin for a Cursor-only folder (a Claude manifest still wins, and a schema-less root plugin.json yields, D21). A Cursor entry whose folder has no manifest is refused. cursor-marketplace is a preview selector only; install never gets it back, and no install record stores a method.
  • Payloads (agentPlugins.ts): per-file builds on listing rows, notApplied on the preview, update review and list item, ruleType on rule skills, readonlyAgents on the preview.
  • Renderer: one row per name with per-build lines and actions; a shared not-applied list in the preview, update review and plugin card; rule-skill labels; "edit tools removed, shell still available" for agents that Xum maps to Explore.

Validation

  • Dev-server sandbox, oRPC and agent-browser against github.com/cursor/plugins at 4dd1d05818 (re-checked on this head after merging cursor-plugins/fast-agents): 128 rows, 0 warnings; pstack and origin-apps have two builds; all 128 Cursor folders have a manifest and none is refused; attio (third_party/attio) and cursor-team-kit install through their Cursor builds. cursor-team-kit's review lists 18 skills, 2 rule skills labeled "always-apply rule, loaded on request in Xum", 2 agents and 4 not-applied fields. At 390 px the Plugins tab and the review have no horizontal scroll. Screenshots follow in a comment.
  • tests/bugbash/repros/cursorMarketplaceMerge.e2e.ts (BUGBASH_AI=mock) passes on web and phone, and fails with ASSERTION_FAILED on "Preview Claude build" when the Cursor file is ignored.
  • New unit and service tests cover the merge order, caps, diagnostics, Cursor path rule, install methods, update through the folder's own manifest, collision refusal, notApplied, rule types, readonly labels and invisible-character marks.

Risks

  • Behavior change for every user of the Plugins tab: a repository with both marketplace files now lists both (release note below). Repositories with only a Claude file list as before.
  • The merged listing reads one more file per marketplace preview. A broken Cursor file beside a good Claude file only adds a warning.
  • Medium area of risk: install, preview and update of marketplace entries. Claude marketplace behavior is unchanged and covered by the existing marketplace tests.

Release note

Adding a repository with both marketplace files shows one merged list. cursor/plugins goes from 2 entries to 128. (Users of the Plugins tab, D20.)

Deviations from the RFC

  1. chooseUpdateMethod changed although RFC 2.3 says it needs no change (Codex RFC round 4 finding 3): with no marker, an update accepts claude-plugin or cursor-plugin; with a claude-marketplace marker it also accepts cursor-plugin, because this PR makes cursor-plugin an own method.
  2. RFC 2.5 asks for a per-agent readonly label but 2.4 adds no field: the preview gains readonlyAgents. Only an agent that the Claude Code or Cursor mapping runs on Explore for readonly: true gets the label; a Xum-format agent never does.
  3. A Cursor entry whose folder has only a Claude manifest installs as claude-plugin (RFC 2.3 lists three own methods; 2.2's refusal text names two). None of the 128 entries has this shape.
  4. Cursor path sources resolve from the marketplace root without ./, and a Cursor file ignores metadata.pluginRoot. The RFC said the Cursor file uses the Claude format; the real file needs Cursor's own path rule.
  5. parseClaudeMarketplace takes the file kind instead of a relative path, and marketplaceListing takes the parsed files; a read error of one file counts like a parse error.

Follow-ups

  • The plugin card does not show component warnings (for example an MCP server refused for a reason other than a not-applied one). The install preview and the update review show them.
  • Entries with minClientVersions.cursor: "never" are listed; Cursor hides them.
  • An update review with no capability change but a non-empty not-applied list applies at once, as today; the parts then show only on the card.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh • Cost: $28.91

Add the cursor-plugin and cursor-marketplace methods, per-file marketplace builds, the
notApplied list on the preview, update review and list item, the rule type of a rule skill,
and the readonly agents of a preview (Cursor plugin RFC, PR 2).

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$3.74`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=3.74 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$6.25`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=6.25 -->
… file

The Cursor marketplace (.cursor-plugin/marketplace.json) uses the Claude format, so
parseClaudeMarketplace reads both and names the file it read in its diagnostics. Each file keeps
its own caps. mergeMarketplaces lists the Cursor entries, then the Claude names Cursor lacks; a
name in both files becomes one row with a Cursor and a Claude build. Entries with a problem never
merge. parseMarketplaces turns a broken file beside a good one into a listing warning.
Both files of mergeMarketplaces may be missing; one helper reads either one's entries, which
keeps the new function under the CRAP gate's new-function limit.
detectInstallMethods offers cursor-plugin for a folder whose .cursor-plugin/plugin.json
discovery loads (after a Claude manifest, and over a schema-less root plugin.json). A Cursor
marketplace entry installs only through its folder's own manifest: Xum generates no manifest and
offers no Skills fallback for it. cursor-marketplace compares by entry. An update with no marker,
or with a claude-marketplace marker, now accepts a Cursor manifest too, so a Claude entry whose
folder gains a Cursor manifest still updates.
…ly plugin agents

AgentPluginNotApplied and CursorRuleType are now the schema types, so discovery and the
review payloads share one definition. A plugin agent file carries whether its Cursor
readonly: true made it an Explore agent: the parse keeps the raw flag the schema strips.
The Plugins preview reads .cursor-plugin/marketplace.json beside the Claude file and lists one
merged row per name, each build with its own status and skill count. A broken file beside a good
one becomes a listing warning. A root with its own Cursor manifest previews that plugin instead.
A cursor-marketplace preview stages the entry's folder from the Cursor file and returns the
folder's own method, so install never takes a Cursor entry. Install previews carry the plugin's
not-applied parts and readonly agents, update reviews and list rows carry not-applied parts when
there are any, and rule skills carry their rule type. Tests use real git fixtures, plus the
cursor/plugins clone when this machine has it (128 rows).
…lugins

The Plugins tab lists a repository's Cursor and Claude Code marketplace files as one list. A
name in both files is one row with a line per build ("Cursor build", "Claude build"), and the
picked row offers "Preview Cursor build" and "Preview Claude build". Each action previews its
own file's entry and is enabled only when that build installs. A row can be picked when any
build installs, and Back returns to the same row for both selector kinds.

The install preview, the update review and the installed plugin card list the parts Xum does
not apply ("<part> <name>: <reason>"). A skill made from a Cursor rule shows how the rule loads
in Xum, and a readonly agent says its edit tools are removed and the shell stays (Cursor plugin
RFC, PR 2, sections 2.5 and 2.6).
…n review

AddPluginCursorMarketplace lists a cursor/plugins-shaped repository: pstack in both files (two
Preview actions, each previewing its own build), a Cursor-only entry, and an entry whose Cursor
build is an npm package. AddPluginCursorReview shows a Cursor plugin's rule skill labels, its
readonly agent and its not-applied list. Each has a phone variant pinned to 390 px with an
overflow check.
The seed gains cursor-market, shaped like cursor/plugins: a Cursor and a Claude Code
marketplace file that both list pstack, each at its own folder with its own skill. The repro
expects one pstack row with two Preview actions, previews and installs the Cursor build, and
expects the installed plugin to hold the Cursor build's skill only (tags bugbash,
cursor-marketplace-merge). The fixture test pins the fixture's merged row.
The play now checks the refused and the Cursor-only rows first and ends on the list with pstack
picked, so the Pixel snapshot shows the "Preview Cursor build" and "Preview Claude build" pair.
Read errors of a marketplace file wait for the manifest guard and count like parse errors, so a
root plugin beside a symlinked Cursor marketplace file still previews. Drop the test that needs
a clone at a machine path.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$6.25`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=6.25 -->
Remove 20 comments that the marketplace diff added or reworded and that only
restate the code next to them. Why-comments and schema field docs stay.
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$13.03`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=13.03 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
cursor/plugins lists 111 of its 128 entries as nested paths without "./" (third_party/attio).
The Claude source rule refused them. A path in the Cursor file now starts at the marketplace
root, with or without "./", under the same containment checks, and ignores metadata.pluginRoot
(the Cursor format has none). The Claude rule is unchanged. Tests also cover a name that the
Claude file lists twice beside a Cursor name, and a Cursor entry with its own skills list.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
…ools

A Xum-format agent keeps its own base and tools.add, so readonly: true plus base: explore
could still add file_edit_* back while the review said the edit tools were removed. The label
now follows the mapping itself (isReadonlyForeignPluginAgent): a Claude Code or Cursor format
file with readonly: true, whose mapped tool list can only remove tools.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
Not-applied names come from the plugin files (rule file names, manifest values), so the
preview, the update review and the plugin card now show their invisible and bidi controls as
<U+XXXX> marks, as agent and workflow names already do (#6629).

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$15.31`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=15.31 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$28.91`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=28.91 -->
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh` • Cost: `$28.91`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh costs=28.91 -->
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T17:23:32.475920Z 31b3080 Manual request
🔒 Security Review ✅ Completed 2026-10-31T17:25:32.151883Z 31b3080 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33
ThomasK33 added this pull request to stack #7836 October 31, 2026 17:17
@ThomasK33

Copy link
Copy Markdown
Member Author

Dogfood evidence (dev-server sandbox, github.com/cursor/plugins at 4dd1d05818). The listing and review screenshots come from earlier heads of this branch (6d29ce7 and be6ec0f); the renderer has not changed since. The 128-row counts were re-checked on this head (31b3080): 128 rows, 128 Cursor builds and 2 Claude builds, 0 refused, 111 nested third_party/<name> sources installable.

Merged list: pstack has a Cursor build and a Claude build

Plugins tab: pstack with two builds and two preview actions

Nested Cursor sources install (attio at third_party/attio)

Plugins tab: attio picked, Preview attio enabled, installed attio card with its not-applied list

Install review of cursor-team-kit (Cursor build): rule labels, agents, not-applied list

cursor-team-kit install review: always-apply rule labels and Not applied in Xum (4)

At 390 px: no horizontal scroll; each not-applied row on its own line

cursor-team-kit review at 390 px

pstack row and its two actions at 390 px

Installed plugin card

Installed cursor-team-kit card with the not-applied list

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

Head: 31b3080

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 46.5k tokens (24% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 a chat survives a restart of the server 1 step · 1 call 5.6s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.3s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.3s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.4s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.4s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.5s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.5s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.0s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.0s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.4s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.4s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.8s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.8s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 2.6s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 2.6s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 25.3s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.5s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.4s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.7s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.2s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.1s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 6.5s

e2e 0.20.0 · 1m 12s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.0k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 5.1s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 5.1s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.8s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.8s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 4.6s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 4.6s

e2e 0.20.0 · 17.7s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 31b3080a90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 31b3080a90

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 06afb22 Oct 31, 2026
38 of 39 checks passed
@ThomasK33
ThomasK33 deleted the cursor-plugins/marketplace branch October 31, 2026 23:09
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Nov 1, 2026
## Summary

Cursor plugins can now run their `stop`, `afterAgentResponse` and
`afterFileEdit` command hooks in local and worktree workspaces. A hook
runs only after the user trusts its exact `hooks.json` entry in Settings
→ Plugins. The consent boundary for the files a hook runs is a new file
review: the install preview lists every plugin file, and an update lists
every changed file and does not apply until the user approves it. A
`stop` hook's `followup_message` continues the turn under the per-hook
limits of PR 7.

## Background

ThomasK33 asked for the Cursor plugin RFC as a reviewed, mergeable PR
stack. This is PR 8 of that RFC:
[`rfc/20261030_cursor-plugin-support.md`](https://github.com/coder/xum/blob/cursor-plugins/rfc/rfc/20261030_cursor-plugin-support.md),
"PR 8: Cursor hooks: parse, trust, update review and runner (security
review)". Section 5 (Hooks) is its contract, with decisions D1, D5–D7,
D25, D28 and D30.

This PR is stacked on coder#7844 (PR 2, the Cursor marketplace and the
`cursor-plugin` install method). Before this PR, Xum listed a Cursor
package's hooks as "not applied". Cursor plugins such as ralph-loop need
a `stop` hook to loop a turn (CUJ 3).

## Implementation

- **Parse (`cursorHooks.ts`).** Discovery reads the hooks source the
Cursor manifest names (a path inside the plugin folder, default
`hooks/hooks.json`, or an inline object). Each entry becomes an
`AgentPluginHookSchema` hook with a `cursor-command` handler, or
`cursor-prompt` for `type: "prompt"`. `key`, `hash` and `declared`
follow RFC 5.1. A hook that does not run (a prompt hook, an unmapped
event, a matcher) gets a `notApplied` row with one reason, and so does
an entry the parser drops (at most 50 such rows).
- **Trust.** Trust is per hash of the event, the matcher and the raw
entry, unknown fields included. The hooks panel shows `declared` with
control characters marked, and Trust waits until a cut definition is
expanded. A hook that does not run cannot be trusted.
- **File review (D30, `installService.ts`, `treeHash.ts`).** The install
preview gains `fileChanges`, one row per file or symlink of the plugin
tree. An update's review lists each changed file with its before and
after text. Any row blocks an update without consent. Only plugins with
a runnable Cursor command hook get rows. While no Cursor command hook of
a plugin is trusted, the hooks panel shows the same review of every
file, and the first trust needs a digest of those rows (a plugin
installed by a build without the file review never showed its files).
- **Runner (`cursorHookRunner.ts`).** It registers on `turn.stop`
(`afterAgentResponse`, then `stop`) and on `tool.execute` after the edit
tools (`afterFileEdit`). Every call checks the start conditions again
(see Security decisions) and runs the command through `runtime.exec`.
- **Cancellation.** The `turn.stop` context gains an abort signal
through `eventSpine.ts`, `promptHooks.ts` and `agentSession.ts`. A user
Stop aborts running hooks, and a Stop before the chain starts gives it
an aborted signal. `LocalBaseRuntime.exec` checks the abort again after
its working-folder check.
- **Wiring (`requestHooks.ts`, `codexHookService.ts`).** The hook
service registers Cursor hooks next to Codex hooks, with its own gate: a
Cursor command hook needs no plugin MCP, so a local workspace with
several projects runs it. There, `workspace_roots` lists each project's
folder in the workspace container.

## Security decisions

1. **Trust:** per hash of the event, the matcher and the raw entry
(unknown fields included). An edit to the entry drops trust and the
panel shows the hook as changed.
2. **File review rows:** every file at install, and again at the first
trust of a Cursor command hook while no hook of the plugin is trusted
(no new persisted field: that is the trigger). At update, every changed
file, or every file when the installed plugin had no runnable hook. A
row has no component field, so any row blocks an update without consent.
3. **File review reads:** each file is read once, without following
symlinks, and the shown text is the hashed bytes. A symlink shows only
its link text, and a row names a symlink and a file's mode change. The
first-trust digest covers each entry's content hash, so a hidden file
that changes after the review voids it. A file over 64 KiB or not UTF-8
says "contents not shown: binary or larger than 64 KiB". The review
keeps the staged-tree quota and the size cap, and stops with the
existing "too large" message once its kept text passes 3 MB per tree.
4. **Marked text:** file names, link targets, hook events, matchers, the
hooks file path, warnings (hooks panel, install preview and update
review) and the command in the exit 127 notice go through
`showOneLineControls`, so a bidi or newline character shows as
`<U+XXXX>`.
5. **Checked on every call, after the plugin reads:** the three kill
switches (`XUM_DISABLE_AGENT_TOOLS`, `XUM_DISABLE_TERMINALS`,
`XUM_DISABLE_PROJECT_AUTOMATION`), a local runtime (registration only
for local and worktree workspaces, never in a `/side` chat), project
trust, hash trust, a fresh reread of the plugin's own hooks, input up to
64 × 1024 characters, and no user Stop.
6. **Process:** the minimal host environment plus the Cursor variables,
`PATH` and `HOME`. Xum never sets `CURSOR_USER_EMAIL` or
`CURSOR_CODE_REMOTE`, and runs the command as written. The timeout is at
most 30 s. Stdout is capped at 64 KiB, stderr is discarded, and both
pipes are read while the hook runs. A call ends at its timeout plus 2 s
even when a process that left its group holds stdout open, and it then
lets go of the hook's three pipes.
7. **Failures:** no failure blocks anything. A failure shows one chat
notice per workspace and hook. `failClosed` is parsed and hashed only.
An unreadable trust store skips the call with a notice. Codex hooks keep
their old silent behavior.
8. **Trust names the reviewed commit:** a Cursor command hook's trust
records `reviewedSha`, the installed commit when the user trusted it. An
update this build applies (it reviewed the changed files) moves the
binding to the new commit. A binding that does not match the registry's
`lockedSha` is dropped, and a trusted Cursor command hook without a
binding reads as "changed": it does not run, and the hooks panel shows
the full file review again. This covers an update that a build without
this PR applied after a downgrade. `reviewedSha` is a new optional field
of the trust record. No other record tells this build that an older
build changed the plugin.
9. **Accepted risks (RFC D1):** a script edited on disk outside an
update runs unreviewed. A plugin installed before this PR never got the
first file review.

## Deviations from the RFC

1. A `cursor-prompt` handler variant sits beside `cursor-command`, so a
prompt hook also carries `declared` and shows its Cursor reason.
2. One function, `cursorHookNotAppliedReason`
(`src/constants/pluginHooks.ts`), gives the reason to the loader and to
the panel. No schema field was added for it.
3. Discovery parses Cursor hooks through its own file reader into
`AgentPluginInfo.cursorHooks`. A new `loadPluginHooks` picks the Cursor
or the Codex loader by plugin format. The hash and the per-plugin caps
moved to a new `hookDefinition.ts` to avoid an import cycle.
4. The Cursor hook gate is separate from the Codex one (see
Implementation). The Cursor runtime comes from
`createRuntimeForWorkspace` for local and worktree workspaces.
5. The file review skips only the top-level `.git`, as the staged-tree
quota check does.
6. Three guards the RFC does not ask for: the timeout + 2 s pipe
deadline, a throw in the trust check or the spawn becomes one failed
call with a notice, and the 3 MB kept-text limit of the file review.
7. `FakeRuntime` gained an optional `location`. Two PR 1 tests changed,
because inline hooks and `hooks/hooks.json` no longer get the "runs in a
later Xum build" row.
8. The chat notice reads "Plugin <name>: hook stop failed …". The
leading "Plugin " comes from the existing shared notice code.

## Validation

- An independent security verifier checked three heads and found each
clean: `4ca374abcb` (82 mutants, the real install, update and trust path
in-process, a live dev server), `5eb136a80e` after the first marketplace
merge, and `4022057c13` with the first-trust file review. Its findings
F1, F3, F3b, F5 (the downgrade gap, fixed after Codex raised it too) and
the test gaps F4 and F6 (X3, X4) are fixed in this PR. The rest are
listed under Follow-ups.
- Each guard added after the first review has a test that fails with the
guard removed. These include the exit 127 command marking, the side-chat
flag, the 64 KiB check on valid JSON, the runnable filter, the warning
marks, the first-trust digest, and the "trusted" and current-hook halves
of the first-trust trigger.
- Live proof on a dev-server sandbox: the install preview with deceptive
file names, the hooks panel, the exit 127 notice once per hook, and the
update review. The stop-loop repro
`tests/bugbash/repros/cursorStopHookLoop.e2e.ts` passes 4/4 with
`BUGBASH_AI=mock`, and it trusts its hooks through the first-trust UI.
- The bug-bash sandbox image now installs `jq`, which the ralph-loop
plugin's hooks run, so the stop-loop repro also runs in `Test / Bug-bash
sandbox`.
- At a 390 px viewport, the hooks panel (a 300-character command, a 2 KB
declared entry, the Files list), the install preview and the update
review show no horizontal overflow. This PR adds no Storybook snapshots.

## Risks

- **Severity high if wrong, scope narrow:** this is the first plugin
code that runs shell commands on the host. Every start condition is
checked per call, and each has a test. Codex hooks keep their behavior,
except that the hook service now registers even without plugin MCP; the
Codex gate still requires it.
- The file review runs for every install and update preview of a plugin
with a runnable Cursor command hook. A large plugin can hit the 3 MB
limit and get the existing "too large" error.

## Release note

Cursor plugins: Xum runs `stop`, `afterAgentResponse` and
`afterFileEdit` command hooks in local and worktree workspaces after you
trust each hook in Settings → Plugins, and reviews every plugin file at
install (and at the first trust of a plugin's hooks) and every changed
file at update. This PR has no row in RFC section 8: nothing changes for
users without a Cursor plugin.

## Follow-ups

- **F2:** a Stop does not shorten the wait for a hook child that left
its process group (at most timeout + 2 s).
- **Update recovery and trust:** when Xum crashes during an update and
journal recovery finishes it, the registry gets the new commit but the
trust binding does not move. The trusted Cursor hooks then read
"changed" and need the file review again. This fails closed.
- **Unreadable trust store at registration:** when the trust file cannot
be read at workspace hook setup, no Cursor hook registers and none runs
(fail closed), but the user gets no notice. The fix reads the store with
`readPluginHookTrustChecked` during registration and shows one notice.
- **Revoke during exec:** the hook gate decides trust after its last
await, but `runtime.exec` then awaits its working-folder check before
the spawn. A trust revoke in that window still starts the process.
Closing it needs a trust generation the runtime checks before the spawn.
- **Codex Stop hooks and the Stop signal:** the `turn.stop` abort signal
stops Cursor command hooks (RFC 5.4). Codex Stop hooks still run their
MCP calls to the end after a user Stop, as before this PR. Passing the
signal into them changes Codex hook behavior, so it is a separate
change.
- **F6 X8:** no test fails when the first-trust review skips
`assertReviewFits` (the size cap). The cap is in the code.
- **"Show full text" is enforced only in the renderer.** The server
checks the digest of the rows it returned, not that the user expanded
each cut text.
- **Test gaps the verifier listed** (each guard is present in the code):
the F1 label when only the old side is hidden, the tree-walk race
guards, the mode comparison, link-text marking, event and matcher
marking, the unreadable-store notice, the reread failure and the `#`
path refusal.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`xhigh` • Cost: `$91.77`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh
costs=91.77 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant