Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

docs(desktop): record a real Cursor conversation and its capture gap

AkitaOnRailse5837c1a9c6f
diff --git a/docs/desktop/cursor.md b/docs/desktop/cursor.md
index 06731625..f2ae9473 100644
--- a/docs/desktop/cursor.md
+++ b/docs/desktop/cursor.md
@@ -71,18 +71,52 @@ the empty window the app loaded only its built-in servers
operator's `~/.claude.json`: the third-party import brought the Claude
hooks in but, at least there, not the Claude MCP servers.
+## A real desktop conversation (verified 2026-10-08)
+
+Two conversations were run in the desktop app's empty window ("run ls then
+say OK"). Through the operator's Claude Code hooks, Cursor delivered:
+
+- per conversation, `sessionStart` then `beforeSubmitPrompt` (sent to the
+ Claude `UserPromptSubmit` hook), then `preToolUse`/`postToolUse` and
+ `stop` when the agent ran; no `sessionEnd` while the window stayed open;
+- Claude-compatible fields on top of Cursor's own: `session_id` (equal to
+ `conversation_id`), `prompt` and `attachments`, `tool_name` (`"Shell"`),
+ `tool_input` (`{"command": "ls", "cwd": "", "timeout": 30000}`),
+ `tool_output` (a JSON string, not Claude's `tool_response`),
+ `tool_use_id`, `duration`, and on `stop` `status`, `loop_count` and token
+ counts; `hook_event_name` keeps Cursor's names (`beforeSubmitPrompt`,
+ `preToolUse`);
+- `cwd` `""` and `workspace_roots` `[]` in an empty window, and
+ `transcript_path` only on `stop`:
+ `~/.cursor/projects/<workspace-slug>/agent-transcripts/<id>/<id>.jsonl`
+ (`empty-window` here), a JSONL of `role: user|assistant` messages with
+ `tool_use` blocks and `turn_ended` markers. A conversation the plan
+ refused (a named model on the free plan) recorded only
+ `turn_ended: error` and fired no tool or stop hook.
+
+Replayed against a scratch server, both conversations became `cursor`
+sessions in `default/scratch` (no cwd) with their prompts captured, but
+**the tool events were stored with empty bodies and the generic titles
+`pre-tool-use`/`post-tool-use`**, while this session's Claude Code tool
+events replayed to the same server got their capture-policy summaries
+(`tool non-file`). Giving the Cursor event a real `cwd` did not change it,
+and `Shell` classifies as a non-file tool, so neither is the cause; the
+remaining differences are `tool_output` instead of `tool_response`, the
+camelCase `hook_event_name`, and no `cwd` query parameter. Not yet
+isolated; a failing test is the next step.
+
## Open questions (live tests)
-1. The payload and event set of a real desktop conversation for both the
- native `.cursor/hooks.json` and the Claude-format hooks, including what
- `session_id`/`cwd` the Claude-format copy gets once a workspace is open.
+1. The native `.cursor/hooks.json` payloads (only the Claude-format copy
+ has been observed) and the `cwd` a conversation gets once a workspace
+ folder is open — needs a prompt inside the probe workspace.
2. ~~What the `empty-state-draft` session start does on the server.~~
Measured 2026-10-08 by replaying the spooled event against a scratch
server: it creates one `cursor` session with no `cwd` in the
`default/scratch` project, and every later launch (a new ingest key, the
same placeholder id) adds another `session-start` observation to that
same session. Clutter, not loss; whether to drop it is a product call.
-3. Where a desktop conversation's transcript lands (`transcript_path` once
- set) and whether the `cursor-agent` CLI loads the Claude-format hooks
- (it needs `cursor-agent login` here first).
+3. Whether the `cursor-agent` CLI loads the Claude-format hooks (it needs
+ `cursor-agent login` here first).
+5. Why Cursor tool events reach the store with empty bodies (above).
4. Whether a workspace window imports Claude MCP servers.
diff --git a/docs/desktop/verification-2026-10.md b/docs/desktop/verification-2026-10.md
index 72162216..c397db92 100644
--- a/docs/desktop/verification-2026-10.md
+++ b/docs/desktop/verification-2026-10.md
@@ -156,7 +156,14 @@ needs `--config-file ~/.config/Claude/claude_desktop_config.json`.
`session-start` observation to the same placeholder session.
- The empty window loaded only Cursor's built-in MCP servers, not the
Claude config's `ai-memory`.
-- No conversation has run yet; `cursor-agent` is not logged in.
+- Two real conversations in the empty window arrived through the Claude
+ hooks with `session_id`, `prompt`, `tool_name`, `tool_input` and
+ `tool_output` alongside Cursor's fields; the transcript lands under
+ `~/.cursor/projects/<slug>/agent-transcripts/<id>/<id>.jsonl` and its path
+ appears only on `stop`. Replayed to a scratch server, the prompts are
+ stored but the tool events get empty bodies, unlike Claude Code's; the
+ cause is not yet isolated (`cursor.md`).
+- `cursor-agent` is not logged in.
## Still unverified
@@ -165,5 +172,6 @@ needs `--config-file ~/.config/Claude/claude_desktop_config.json`.
| Does the Codex desktop app pass anything at `thread/start` that disables hooks? | One prompt in the desktop app with the trusted ai-memory hooks in place, then check the hook spool or server for a `codex` session whose rollout originator is the desktop's |
| Does the Antigravity IDE run `.agents/hooks.json` / `~/.gemini/config/hooks.json`, with the same payload as the CLI? | One IDE prompt in a scratch workspace carrying a recorder `.agents/hooks.json` |
| Do host hooks and MCP servers reach Cowork's VM on Linux (and on macOS/Windows)? | One Cowork task after the VM images download, then look for hook output in its transcript |
-| Cursor: the hook set and payloads of a real desktop conversation (native and Claude-format), and where its transcript lands | One prompt in the probe workspace, which carries recorder `.cursor/hooks.json` and `.claude/settings.json` files |
+| Cursor: the native `.cursor/hooks.json` payloads and the `cwd` inside an open folder | One prompt in the probe workspace, which carries recorder `.cursor/hooks.json` and `.claude/settings.json` files |
+| Cursor: why tool events reach the store with empty bodies | A failing test that posts the captured payload, then bisect the field differences |
| Is a per-turn Antigravity session-start acceptable, or should it be gated per conversation? | A product decision once the server-side effect of repeated session-start posts is measured |