Lore
Lore captures AI coding sessions and links them to git commits.
When you use AI coding tools like Claude Code or Aider, the conversation history contains valuable context. This includes everything from the prompts you wrote, the approaches you tried, and the decisions you made. Git captures the final code, but does not contain reasoning history for your commits. Lore preserves both.
Use Cases
- Code review: See the AI conversation that produced a PR, not just the diff
- Debugging: Understand why code was written a certain way by reading the original discussion
- Knowledge transfer: When someone leaves a project, their AI conversations stay with the code
- Learning: Study how problems were solved by browsing linked sessions
- Search: Find that conversation where you solved a similar problem - search by keyword, project, tool, or date
How It Works
Lore reads session data from AI coding tools, stores it in a local SQLite database, and creates links between sessions and git commits.
Capture
Lore includes parsers for each supported tool:
| Tool | Format |
|---|---|
| Claude Code | JSONL |
| Codex CLI | JSONL |
| Gemini CLI | JSON |
| Amp | JSON |
| Aider | Markdown |
| Continue.dev | JSON |
| Cline | JSON |
| Roo Code | JSON |
| Kilo Code | JSON |
| OpenCode | JSON |
Import existing sessions with lore import, or run lore daemon start to watch for new sessions in real-time.
Storage
Sessions and messages are stored in a SQLite database at ~/.lore/lore.db. The schema includes:
- sessions: ID, tool, timestamps, working directory, message count
- messages: ID, session ID, role (user/assistant), content, timestamp
- session_links: Maps session IDs to git commit SHAs
Full-text search uses SQLite FTS5 to index message content.
Linking
Links connect sessions to commits. You can create them:
- Manually:
lore link <session-id> --commit <sha> - Via hooks:
lore hooks installadds a post-commit hook that prompts for linking
Links are bidirectional: given a session, find its commits; given a commit, find its sessions.
Installation
From crates.io
From Releases
Download the latest binary from GitHub Releases and add it to your PATH.
From Source
Quick Start
# First time? Run init for guided setup
# Or just start using lore - it will prompt for setup automatically
# View a session
# Link a session to the current commit
# Later, view what sessions informed a commit
Example Workflow
# You're reviewing a PR and want to understand a change
# View the full conversation
Search
Find any conversation across all your AI coding sessions:
# Basic search
# Filter by tool
# Filter by date range
# Filter by project or branch
# Combine filters
# Show more context around matches
Search matches message content, project names, branches, and tool names. Results show surrounding context so you can understand the conversation flow.
Commands
| Command | Description |
|---|---|
lore init |
Guided first-run setup (auto-detects AI tools) |
lore status |
Show daemon status, watchers, and recent sessions |
lore sessions |
List sessions (supports --repo, --limit, --format) |
lore show <id> |
View session details |
lore show --commit <ref> |
View sessions linked to a commit |
lore import |
Import sessions from all enabled watchers |
lore link <id> |
Link session to HEAD |
lore unlink <id> |
Remove a session-commit link |
lore search <query> |
Full-text search with filters and context |
lore hooks install |
Install git hooks for automatic linking |
lore hooks status |
Check installed git hooks |
lore hooks uninstall |
Remove installed git hooks |
lore daemon start |
Start background watcher for real-time capture |
lore daemon stop |
Stop background watcher |
lore daemon logs |
View daemon logs |
lore daemon install |
Install daemon as a system service |
lore daemon uninstall |
Remove daemon service |
lore config |
View configuration |
lore config get <key> |
Get a config value |
lore config set <key> <val> |
Set a config value |
Supported Tools
Lore targets Linux, macOS, and WSL2. Windows native support is planned for a
future release. For WSL2, CLI-based tools work as long as the sessions live in
the Linux filesystem. VS Code extension sessions are only discovered when the
extensions run in WSL (Remote - WSL); if you run VS Code natively on Windows,
those sessions live under %APPDATA% and are not detected today.
| Tool | Status | Storage Location |
|---|---|---|
| Claude Code | Supported | ~/.claude/projects/ |
| Codex CLI | Supported | ~/.codex/sessions/ |
| Gemini CLI | Supported | ~/.gemini/tmp/*/chats/ |
| Amp | Supported | ~/.local/share/amp/threads/ |
| Aider | Supported | .aider.chat.history.md |
| Continue.dev | Supported | ~/.continue/sessions/ |
| Cline | Supported | VS Code extension storage |
| Roo Code | Supported | VS Code extension storage |
| Kilo Code | Supported | VS Code extension storage |
| OpenCode | Supported | ~/.local/share/opencode/storage/ |
Building an AI coding tool? We welcome contributions to support additional tools. Open an issue with your tool's session storage location and format, or submit a PR adding a watcher. See CONTRIBUTING.md for details.
Background Daemon
The daemon watches for new sessions in real-time and imports them automatically.
Manual Start
Run as a Service
Install the daemon as a system service to start automatically on login:
This uses launchd on macOS and systemd on Linux. The service restarts automatically on failure.
Manual systemd Setup (Linux)
If you prefer to configure systemd yourself:
Create ~/.config/systemd/user/lore.service:
[Unit]
Description=Lore AI session capture daemon
After=default.target
[Service]
Type=simple
ExecStart=%h/.cargo/bin/lore daemon start --foreground
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
Then enable and start:
macOS with Homebrew
Once a Homebrew formula is available:
Until then, use lore daemon install or manage launchd manually.
Git Hooks
Install hooks to automatically record session links on commit:
Output Formats
Commands support --format for scripting and integration:
Configuration
On first run, Lore prompts for setup automatically. You can also run lore init manually.
The init wizard:
- Detects installed AI coding tools
- Shows which tools have existing sessions
- Lets you choose which watchers to enable
- Offers to import existing sessions
Configure which tools to track:
For scripting, use --no-init to skip the first-run prompt:
Data Location
~/.lore/
├── lore.db # SQLite database
├── config.yaml # Configuration
└── logs/ # Daemon logs
All data stays on your machine. There is no cloud sync or external service.
License
Apache 2.0
Contributing
See CONTRIBUTING.md.