lore hooks
Install git hooks to integrate Lore into your commit workflow.
Commands
Section titled “Commands”| Command | Description |
|---|---|
lore hooks install | Install hooks in current repository |
lore hooks uninstall | Remove hooks from current repository |
lore hooks status | Check hook installation status |
Installing Hooks
Section titled “Installing Hooks”cd /path/to/your/repolore hooks installInstalling git hooks... Created .git/hooks/post-commit Created .git/hooks/prepare-commit-msg Created .git/hooks/pre-push
Hooks installed successfully.Hook Behavior
Section titled “Hook Behavior”post-commit
Section titled “post-commit”Runs after each commit. Currently displays a reminder about linking:
Commit created: a1b2c3d
To link an AI session to this commit: lore link <session-id>
Recent sessions: c9731a91 2025-12-25 17:52 claude-code myapp 8b2f1c3d 2025-12-25 16:30 aider myappprepare-commit-msg
Section titled “prepare-commit-msg”Runs before the commit message editor opens. Can add session references to commit messages.
pre-push
Section titled “pre-push”Runs on git push and syncs your reasoning history alongside your code by running lore sync (quietly, best-effort). It never blocks the push, and a re-entry guard prevents the sync’s own ref push from re-triggering the hook.
If sync is not set up for the repository, or no key is stored, the hook does nothing and never prompts. Run lore sync setup first to activate it.
Checking Status
Section titled “Checking Status”lore hooks statusGit Hooks Status
Repository: /Users/dev/myapp
post-commit: Installed (lore) prepare-commit-msg: Installed (lore) pre-push: Installed (lore) pre-commit: Not installedIf hooks exist from other tools, Lore will warn before overwriting:
Warning: post-commit hook already exists Current: #!/bin/bash\nhusky run...
Overwrite? [y/N]Uninstalling Hooks
Section titled “Uninstalling Hooks”lore hooks uninstallRemoving git hooks... Removed .git/hooks/post-commit Removed .git/hooks/prepare-commit-msg Removed .git/hooks/pre-push
Hooks removed successfully.Manual Linking
Section titled “Manual Linking”You can also link sessions manually without hooks:
# Link to HEADlore link <session-id>
# Link to specific commitlore link <session-id> --commit a1b2c3dPer-Repository
Section titled “Per-Repository”Hooks are installed per-repository, not globally. Run lore hooks install in each repository where you want automatic linking prompts.
See Also
Section titled “See Also”- lore link - Manual linking
- Linking Sessions Guide - Linking strategies
- lore sync - Sync reasoning history over git
- Syncing Guide - How the pre-push hook fits in