Linking Sessions to Commits
Links connect sessions to commits, creating a bridge between your AI conversations and your code history.
Manual Linking
Section titled “Manual Linking”Link a session to a commit:
# Link to the most recent commit (HEAD)lore link <session-id>
# Link to a specific commitlore link <session-id> --commit abc123Viewing Links
Section titled “Viewing Links”# See sessions linked to a commitlore show --commit HEADlore show --commit abc123
# See commits linked to a sessionlore show <session-id>Automatic Linking
Section titled “Automatic Linking”If you run the Lore daemon, sessions are automatically linked when they end. No manual intervention needed.
Retroactive Linking
Section titled “Retroactive Linking”Auto-link a Single Commit
Section titled “Auto-link a Single Commit”Use --auto to find sessions that likely produced a commit:
# Preview suggestionslore link --auto
# Apply suggestionslore link --auto --yesBackfill All Sessions
Section titled “Backfill All Sessions”Use --backfill to scan all ended sessions and link commits from their time windows:
# Preview all backfill suggestionslore link --auto --backfill
# Apply all suggestionslore link --auto --backfill --yesThis is a one-time migration tool for when you first install Lore and want to link your existing session history. Once you have the daemon running, it handles linking automatically and backfill is no longer needed.
Git Hooks
Section titled “Git Hooks”Install hooks to prompt for linking after each commit:
lore hooks installlore hooks statuslore hooks uninstallThe post-commit hook will prompt you to link recent sessions to your commit.
Best Practices
Section titled “Best Practices”- Run the daemon: Automatic linking is the easiest approach
- Backfill on install: Run
lore link --auto --backfillafter firstlore import - Use session prefixes: First 8 characters are usually enough
- Link generously: One session can link to multiple commits (and vice versa)