Skip to content

Add Cursor Agent session indexing (Closes #9) - #10

Open
driftfox wants to merge 2 commits into
arjunkmrm:mainfrom
driftfox:feat/cursor-agent-support
Open

Add Cursor Agent session indexing (Closes #9)#10
driftfox wants to merge 2 commits into
arjunkmrm:mainfrom
driftfox:feat/cursor-agent-support

Conversation

@driftfox

Copy link
Copy Markdown

Summary

This PR adds indexing and search for Cursor Agent transcripts (Cursor IDE and agent CLI) stored under ~/.cursor/projects/**/agent-transcripts/<uuid>/<uuid>.jsonl.

Closes #9.

Changes

  • scripts/recall.py

    • New parse_cursor_session() parser for Cursor JSONL format
    • Glob and index canonical uuid/uuid.jsonl files only
    • Project path from Shell working_directory in tool_use blocks, with slug decode fallback
    • Session timestamp from file mtime
    • New --source cursor filter
    • --project matches path prefix or substring (helps names like quick-gtasks)
    • Skip numeric-only project slugs during decode
  • scripts/read_session.py

    • Detect Cursor transcripts by path (/.cursor/projects/ and /agent-transcripts/)
    • Pretty-print user and assistant text blocks
  • tests/test_cursor_parser.py

    • Synthetic JSONL fixtures for parser, slug decode, and format detection
    • Optional integration test against real ~/.cursor/projects/ when present
  • Docs

    • SKILL.md, README.md, and CHANGELOG.md updated for v0.5.0
    • Resume instructions: agent --resume <session-uuid>

Upgrade note

Existing users should run once after upgrading:

python3 ~/.claude/skills/recall/scripts/recall.py --reindex "test"

Test plan

  • python -m unittest discover tests -v (35 tests, 1 skipped when no pi sessions on host)
  • recall "sorting" --project quick-gtasks --source cursor returns Cursor sessions on a host with transcripts
  • read_session.py <cursor-transcript.jsonl> prints user and assistant turns

Notes

  • Cursor JSONL has no per-message timestamps; mtime is used for recency sorting
  • Slug decode cannot recover hyphens inside folder names (e.g. quick-gtasks); working_directory from Shell tool calls is preferred when available
  • Transcript layout verified on Cursor 3.4.x (Windows); macOS and Linux paths should be confirmed by maintainers if needed

driftfox and others added 2 commits May 30, 2026 12:07
Index Cursor IDE and agent CLI transcripts from ~/.cursor/projects/, with parse_cursor_session, --source cursor, substring project matching, read_session detection, and unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cursor encodes Windows workspace paths in project folder names; use
backslashes for drive-letter slugs on all platforms so tests and
--project matching behave consistently.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Feature: index Cursor Agent (IDE + CLI) transcripts from ~/.cursor/projects/

1 participant