Add Cursor Agent session indexing (Closes #9) - #10
Open
driftfox wants to merge 2 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds indexing and search for Cursor Agent transcripts (Cursor IDE and
agentCLI) stored under~/.cursor/projects/**/agent-transcripts/<uuid>/<uuid>.jsonl.Closes #9.
Changes
scripts/recall.pyparse_cursor_session()parser for Cursor JSONL formatuuid/uuid.jsonlfiles onlyworking_directoryin tool_use blocks, with slug decode fallback--source cursorfilter--projectmatches path prefix or substring (helps names likequick-gtasks)scripts/read_session.py/.cursor/projects/and/agent-transcripts/)tests/test_cursor_parser.py~/.cursor/projects/when presentDocs
SKILL.md,README.md, andCHANGELOG.mdupdated for v0.5.0agent --resume <session-uuid>Upgrade note
Existing users should run once after upgrading:
Test plan
python -m unittest discover tests -v(35 tests, 1 skipped when no pi sessions on host)recall "sorting" --project quick-gtasks --source cursorreturns Cursor sessions on a host with transcriptsread_session.py <cursor-transcript.jsonl>prints user and assistant turnsNotes
quick-gtasks);working_directoryfrom Shell tool calls is preferred when available