Supported platforms
Claude Code
Desktop CLI with JSONL session traces
Codex CLI
Command-line agent with JSONL traces
Cursor
VS Code fork with SQLite storage
OpenCode
Open-source CLI with SQLite database
More agents coming soon — PRs welcome! See
src/lerim/adapters/ for examples.Platform details
Claude Code
Session format: JSONL (JSON Lines) Default storage path:- One
.jsonlfile per session - Each line is a JSON object with
type,message,timestamp, and optionalgitBranchandcwd - Message types:
user,assistant,system,summary - Tool calls embedded in
message.contentblocks
Codex CLI
Session format: JSONL (JSON Lines) Default storage path:- One
.jsonlfile per session - Two entry types:
response_item(actual messages) andevent_msg(lifecycle events) - Response item types:
message,function_call,custom_tool_call,function_call_output,custom_tool_call_output - Token usage tracked in
event_msgentries withtype: token_count
Codex CLI tracks reasoning tokens separately from input/output tokens. Lerim sums all three for total token count.
Cursor
Session format: SQLite database (exported to JSONL cache) Default storage path:- macOS
- Linux
- Single
state.vscdbSQLite database - Table:
cursorDiskKV - Session metadata in rows with key
composerData:<composerId> - Messages (“bubbles”) in rows with key
bubbleId:<composerId>:<bubbleId> - Values are JSON-encoded (sometimes double-encoded)
- Lerim exports each session to
~/.lerim/cache/cursor/{composerId}.jsonl - First line: composer metadata (session info)
- Remaining lines: one bubble per line
- Cached JSONL files are reused across syncs (hash-based change detection)
type: 1= user messagetype: 2= assistant message- Other types = tool calls or system events
OpenCode
Session format: SQLite database (exported to JSONL cache) Default storage path:- Single
opencode.dbSQLite database - Tables:
session,message,part - Session metadata in
sessiontable - Messages in
messagetable with foreign keysession_id - Message parts (text, tool calls) in
parttable with foreign keymessage_id - Timestamps are millisecond-epoch integers
- Lerim exports each session to
~/.lerim/cache/opencode/{session_id}.jsonl - First line: session metadata (cwd, title, tokens, etc.)
- Remaining lines: one message per line (text or tool)
- Cached JSONL files are reused across syncs
role:user,assistant, ortool- Text parts:
{"role": "user", "content": "...", "timestamp": "...", "model": "..."} - Tool parts:
{"role": "tool", "tool_name": "...", "tool_input": {...}, "tool_output": "...", "timestamp": "..."}
Adapter architecture
All platform adapters implement a common protocol defined insrc/lerim/adapters/base.py:
Session normalization
Each adapter normalizes platform-specific session formats into a commonViewerSession structure:
- The extraction pipeline (to analyze transcripts)
- The dashboard (to render session viewers)
- The sync process (to generate summaries)
Connecting platforms
Auto-detect all platforms
The simplest way to connect platforms is auto-detection:Connect specific platforms
Connect one platform at a time:Custom session paths
If your agent stores sessions in a non-default location, use--path:
Paths are expanded (
~ is resolved) and must exist on disk. Custom paths override the auto-detected defaults.List connected platforms
Disconnect platforms
Session formats compared
| Platform | Format | Storage | Change Detection | Tool Calls | Token Tracking |
|---|---|---|---|---|---|
| Claude Code | JSONL | File per session | File hash | In message content | Usage per message |
| Codex CLI | JSONL | File per session | File hash | Separate response items | Event messages |
| Cursor | SQLite → JSONL cache | Single DB | JSONL file hash | Bubble types | No built-in tracking |
| OpenCode | SQLite → JSONL cache | Single DB | JSONL file hash | Part entries | Per-message tokens |
Troubleshooting
Platform not detected
Check default path
Check default path
Verify that sessions exist at the default path:
Use custom path
Use custom path
If sessions are stored elsewhere, use
--path:Check platform spelling
Check platform spelling
Platform names must be exact:
claude, codex, cursor, opencode (lowercase).No sessions synced
Verify platform is connected
Verify platform is connected
Check session count
Check session count
The
connect list output shows session counts. If it shows 0 sessions, verify that session files exist.Check project registration
Check project registration
Sessions are only synced if they match a registered project’s Register your project if it’s not listed:
repo_path:Check session metadata
Check session metadata
For sessions to be matched to a project, they must include working directory metadata (
cwd or repo_path). Some agent sessions may lack this metadata.Cursor database locked
Close Cursor before syncing
Close Cursor before syncing
Cursor locks
state.vscdb while running. Close Cursor, then run:Use cached JSONL exports
Use cached JSONL exports
Once sessions are exported to
~/.lerim/cache/cursor/, Lerim uses those cached files instead of reading the DB directly.OpenCode database not found
Check default path
Check default path
OpenCode stores its database at
~/.local/share/opencode/opencode.db on Linux. On macOS, the path may differ.Verify OpenCode has been used
Verify OpenCode has been used
The database is only created after you’ve used OpenCode at least once. Run OpenCode and complete a session first.
Adding new adapters
Want to add support for a new coding agent? Adapters are simple Python modules:- Create a new file in
src/lerim/adapters/(e.g.,my_agent.py) - Implement the
Adapterprotocol functions - Add the adapter to
src/lerim/adapters/registry.py - Submit a PR!
What’s next?
Sync and maintain
Learn how to sync sessions and maintain memories
CLI reference
Explore all connect and sync commands
Contributing
Add support for a new agent platform
Troubleshooting
Debug connection and sync issues