Overview
Auto-snapshots are silent, background snapshots that capture your work state automatically when you run certain DevDaily commands or git operations. They run without blocking your workflow and never crash your commands.How Auto-Snapshots Work
The auto-snapshot mechanism is a fire-and-forget system that:- Runs in the background without blocking the main command
- Never throws or crashes the parent command
- Respects the
journal.autoSnapshotconfig flag - Takes a “light” snapshot (no PRs/tickets) for speed
- Logs quietly (or not at all) depending on
journal.quiet
When Snapshots Trigger
Auto-snapshots are triggered by the following sources:standup
When you run
devdaily standuppr
When you run
devdaily prweek
When you run
devdaily weekcontext
When you run
devdaily contextpost-commit
After each git commit (if git hooks installed)
post-checkout
When switching branches (if git hooks installed)
What’s Stored
Each auto-snapshot captures:- Current branch and branch status
- Today’s commits (commits made on the snapshot date)
- Recent commits (last 7 days for context)
- Uncommitted changes (modified files)
- Diff statistics (files changed, insertions, deletions)
- Auto-generated tags based on the trigger source
- Pull requests (not fetched)
- Tickets/issues (not fetched)
- Remote branch information
Light snapshots are faster than full snapshots because they don’t make network calls to GitHub, Jira, or Linear.
Git Hook Integration
You can install git hooks to automatically snapshot your work state after commits and branch switches.Installing Git Hooks
- post-commit hook: Captures work state after each commit
- post-checkout hook: Captures work state when switching branches
How Hooks Work
The hooks run snapshots in the background so they don’t slow down your git operations:&) and suppress output (2>/dev/null) to avoid interfering with your workflow.
Existing Hooks
If you already have git hooks installed, DevDaily will append its snapshot calls instead of overwriting them. The hooks include a# DevDaily auto-snapshot marker for safe identification.
Removing Hooks
To remove DevDaily git hooks:Configuration
Enable/Disable Auto-Snapshots
Control auto-snapshots in your config file (~/.config/devdaily/config.json):
Force a Snapshot
You can force a snapshot even ifautoSnapshot is disabled:
Verbose Mode
Show snapshot confirmations even whenquiet mode is enabled:
Implementation Details
Fromsrc/core/auto-snapshot.ts:71:
The
try-catch wrapper ensures that even if the snapshot fails, your command continues running normally.Tags
Each auto-snapshot is tagged withauto:{source} where source is the triggering command. This makes it easy to filter snapshots by how they were created:
auto:standupauto:prauto:weekauto:post-commitauto:post-checkout