fix: support Claude Code session log format in readCursorTranscripts#350
Open
pickmemory wants to merge 1 commit intoEvoMap:mainfrom
Open
fix: support Claude Code session log format in readCursorTranscripts#350pickmemory wants to merge 1 commit intoEvoMap:mainfrom
pickmemory wants to merge 1 commit intoEvoMap:mainfrom
Conversation
Three changes to make evolver properly read Claude Code .jsonl session logs: 1. formatSessionLog: handle Claude Code format (top-level type "user"/"assistant") alongside existing OpenClaw format (type "message"). Skip thinking blocks and meta messages. Extract content from Claude Code's array-of-content-blocks. 2. readCursorTranscripts: widen time window from 24h to 7 days since Claude Code session logs are write-once (mtime never updates after session ends). 3. readCursorTranscripts: dispatch to formatSessionLog for .jsonl files and formatCursorTranscript for .txt files (Cursor agent-transcripts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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
formatSessionLognow handles Claude Code's JSONL format (type: "user"/"assistant") alongside the existing OpenClaw format (type: "message"). Extracts content from Claude Code's array-of-content-blocks, skips thinking blocks and meta messages.readCursorTranscriptswidens the time window from 24h to 7 days. Claude Code session logs are write-once —mtimenever updates after the session ends, so the 24h filter left 0 usable files (only the current session, which gets skipped byRECENCY_GUARD_MS).readCursorTranscriptsdispatches.jsonlfiles toformatSessionLog(JSON-aware) and.txtfiles toformatCursorTranscript(plain-text). Previously all files went through the plain-text formatter, returning raw JSON lines for.jsonlinput.Motivation
When using
EVOLVER_CURSOR_TRANSCRIPTS_DIRto point evolver at Claude Code's session log directory (~/.claude/projects/<project>/*.jsonl), evolver produced[NO SESSION LOGS FOUND]because:formatSessionLogonly matched OpenClaw'stype: "message"envelope, not Claude Code'stype: "user"/"assistant"Test plan
EVOLVER_VERBOSE=true node index.js run— session log size increased from 23 chars to 1975 charsdata.type === 'message'check preserved)🤖 Generated with Claude Code