Overview
Git hooks allow DevDaily to silently record your work state at key moments:- post-commit: Captures a snapshot after every commit
- post-checkout: Captures a snapshot when switching branches
Git hooks are opt-in and respect existing hooks by appending DevDaily calls instead of overwriting.
Installation
Interactive Setup
The easiest way to install git hooks is via the interactive setup:- Check if you’re in a git repository
- Detect existing hooks in
.git/hooks/or your customcore.hooksPath - Install or append DevDaily hooks
- Set
journal.gitHooks: truein your config
Manual Installation
You can also manually create hook files:Configuration
Control git hooks behavior in your.devdaily.json:
.devdaily.json
Master switch for all automatic snapshots (including hooks)
Enable git hooks for automatic snapshots. Set to
true after running devdaily init --git-hooks.Capture snapshot after each commit
Capture snapshot when switching branches
Suppress snapshot messages (recommended for hooks to avoid noise)
How It Works
Post-Commit Hook
After everygit commit, DevDaily captures:
- Current branch and commit hash
- Commit message and author
- Files changed and diff stats
- Timestamp and tags (
auto:post-commit)
Post-Checkout Hook
When you switch branches (git checkout or git switch), DevDaily captures:
- Previous and new branch names
- Current working state
- Uncommitted changes
- Timestamp and note (“Switched branch”)
The post-checkout hook only runs for branch checkouts, not file checkouts (like
git checkout -- file.txt).Existing Hooks
If you already have git hooks, DevDaily will append its calls instead of overwriting:Before Installation
.git/hooks/post-commit
After Installation
.git/hooks/post-commit
Uninstalling Hooks
To remove DevDaily git hooks:- Remove standalone DevDaily hooks completely
- Remove appended DevDaily sections from mixed hooks
- Leave other hook logic intact
- Set
journal.gitHooks: falsein config
Manual Removal
If hooks were fully managed by DevDaily:Custom Hooks Path
If you use a custom git hooks directory (viacore.hooksPath):
Performance
Git hooks use light snapshots (--light flag) which:
- Skip PR and ticket fetching (fast, local-only)
- Run in the background (non-blocking)
- Capture only essential data (commits, branches, files)
- Complete in ~50-200ms on average repositories
git commit or git checkout.
Snapshot Storage
Snapshots are stored in your local journal:Use Cases
Context Recovery
When you return to a project after days or weeks:- What branch you were on
- What you were working on
- Uncommitted changes
- Related tickets
Work History Search
Find when you worked on specific features:Cross-Project Summaries
Aggregate work across multiple repositories:Disabling Auto-Snapshots
If you want to keep hooks installed but temporarily disable snapshots:.devdaily.json
Troubleshooting
Hooks Not Running
-
Check if hooks are executable:
-
Check if DevDaily is in PATH:
-
Test manually:
Hooks Slow Down Commits
This shouldn’t happen because snapshots run in the background. If you experience slowdown:-
Check that hooks use the background syntax:
-
Ensure
journal.quiet: trueto suppress output - Check for other hooks that might be slow
Snapshots Not Appearing
Check journal directory:Best Practices
Start with manual snapshots
Use
devdaily snapshot manually for a few days to understand what’s captured.Security & Privacy
- Snapshots contain commit messages, file names, and diff stats (no file contents)
- Stored in
~/.config/devdaily/journal/with user-only permissions - No network calls during snapshot capture
- Safe to use in private/proprietary repositories
Related Configuration
Configuration Overview
Learn about all configuration options
Project Management
Integrate ticket data into snapshots