Use ctx with Cursor

Import Cursor agent transcript history and ask Cursor to search cited prior work before editing.

Install ctx on the machine where Cursor has written local agent history:

curl -fsSL https://ctx.rs/install | sh

See Install for setup and data-root details.

ctx can import Cursor agent transcript history when it is present locally. After import, Cursor can use the same ctx search, ctx show, ctx locate, and ctx export commands as any shell-capable agent.

Import Cursor history

The installer runs ctx setup by default. To refresh Cursor history directly, run:

ctx import --provider cursor
ctx sources --json

Use ctx sources --json to confirm whether Cursor history is importable on this machine.

Prompt Cursor to search first

Paste this into Cursor before a follow-up task:

Before editing, use ctx to search prior local agent sessions for related Cursor or cross-agent work.

Run:
ctx search "<focused query>" --provider cursor --json

Inspect the best hit before relying on it:
ctx show event <ctx-event-id> --window 3
or:
ctx show session <ctx-session-id> --mode lite

If the result affects the edit, cite the `ctx_event_id` or `ctx_session_id` in your response.

Use a provider filter when you specifically want Cursor history. Omit --provider cursor when prior work may have happened in another agent.

Inspect and cite

For a specific command, error, or decision:

ctx show event <ctx-event-id> --window 3

For a broader task thread:

ctx show session <ctx-session-id> --mode lite

When Cursor needs the original source path or a transcript export:

ctx locate event <ctx-event-id>
ctx export session <ctx-session-id>

Ask Cursor to include the ctx ID in its summary when retrieved history changes the implementation plan.