TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lerim-dev/lerim-cli/llms.txt
Use this file to discover all available pages before exploring further.
lerim connect command registers agent platforms so Lerim knows where to find their session data. This is how Lerim discovers coding agent transcripts to extract memories from.
This is a host-only command - it runs locally and does not require a Lerim server.
Syntax
Supported platforms
Lerim supports these coding agent platforms:| Platform | Session Store | Format |
|---|---|---|
claude | ~/.claude/projects/ | JSONL files |
codex | ~/.codex/sessions/ | JSONL files |
cursor | ~/Library/Application Support/Cursor/User/globalStorage/ (macOS) | SQLite state.vscdb, exported to JSONL cache |
opencode | ~/.local/share/opencode/ | SQLite opencode.db, exported to JSONL cache |
Commands
lerim connect list
Show all currently connected platforms with their paths, session counts, and status.Syntax
Examples
ok- Path exists and is accessiblemissing- Path doesn’t exist or isn’t readable
lerim connect auto
Auto-detect and connect all supported platforms by checking their default paths.Syntax
What it does
-
Checks default paths for each supported platform:
- Claude:
~/.claude/projects - Codex:
~/.codex/sessions - Cursor:
~/Library/Application Support/Cursor/User/globalStorage - OpenCode:
~/.local/share/opencode
- Claude:
- Connects platforms where the path exists
- Skips platforms where the path is missing
-
Updates
~/.lerim/config.tomlwith detected platforms
Examples
lerim connect <platform>
Connect a specific agent platform. Uses the default session store path unless--path is provided.
Syntax
Parameters
Platform name:
claude, codex, cursor, or opencode.Custom filesystem path to the platform’s session store. Overrides the auto-detected default path.Use this when:The path is expanded (
- Your agent stores sessions in a non-standard location
- You have multiple agent installations
- You’re syncing from a backup or external drive
~ is resolved) and must exist on disk.Examples
Connect with default path:If you reconnect a platform with the same path, Lerim detects this and skips reindexing. If the path changes, sessions are re-scanned on the next sync.
lerim connect remove
Disconnect a platform. Removes the platform from~/.lerim/config.toml but does not delete any session data or memories.
Syntax
Parameters
Platform name to disconnect:
claude, codex, cursor, or opencode.What it does
- Removes the platform from
~/.lerim/config.toml - Stops scanning that platform’s sessions during future syncs
- Preserves existing memories extracted from that platform
- Preserves the platform’s session store (nothing is deleted from
~/.claude/projects, etc.)
Examples
Configuration
Connected platforms are stored in~/.lerim/config.toml:
Examples
Initial setup
Connect specific platforms
Custom paths
Sync from backup
Remove unused platforms
How sessions are discovered
After connecting a platform, Lerim scans its session store duringlerim sync:
- JSONL platforms (Claude, Codex) - Lerim reads
.jsonlfiles directly - SQLite platforms (Cursor, OpenCode) - Lerim exports SQLite data to JSONL cache, then reads the cache
run_id (unique session identifier). Already-processed sessions are skipped unless you use --force.
Exit codes
| Code | Meaning |
|---|---|
0 | Success (connected, listed, or removed) |
1 | Path not found or platform unknown |
2 | Usage error (missing platform name) |
Related commands
lerim init- Initial setup (detects agents automatically)lerim sync- Sync sessions from connected platformslerim status- See which platforms have indexed sessionslerim project add- Register projects to track
Troubleshooting
”Path not found”
The session store path doesn’t exist. Check:- Is the agent installed?
- Have you used it at least once (to create the session directory)?
- Is the path correct for your OS?
--path to specify the correct location:
“Unknown platform”
You tried to connect a platform Lerim doesn’t support yet. Supported platforms:claudecodexcursoropencode
src/lerim/adapters/ for examples and submit a PR!
Sessions not syncing
If sessions aren’t being indexed:-
Verify the platform is connected:
-
Check the path status:
-
Run sync with verbose output:
-
Check session format: