DEV Community

An Rodriguez
An Rodriguez

Posted on • Originally published at writing.preferredframe.com on

Introducing 'git snooze', a timed 'git stash'

git snooze: git stash with a timer.

One-Sentence Summary. git snooze lets you defer local Git changes for a fixed time, and forces them to come back so they can’t be forgotten.

Abstract. git snooze is a small Git tool that temporarily hides local changes for a fixed number of days. Unlike git stash, snoozed changes automatically reappear after their deadline and warn you, making forgotten work impossible.

Table of Contents

  • Like git-stash with a timer
  • The idea
  • What is git snooze?
  • How it works (briefly)
  • Installation (30 seconds)
  • Basic usage
  • Unsnoozing
  • Seeing what’s snoozed
  • Automatic reminders (the important part)
  • Extra safety
  • Why this exists
  • Source & license

1 Like git-stash with a timer

git stash is useful.

It’s also a graveyard.

People stash things “for later”… and later never comes.

Changes disappear. Context is lost. Work is forgotten.

That’s not a Git problem. That’s a human workflow problem.

2 The idea

What if stashed work had a timer?

  • Hide changes for N days
  • Automatically bring them back
  • Warn you when they reappear
  • Never rely on memory

That’s git snooze.

3 What is git snooze?

git snooze is a small Git-side tool for time-based deferral of local changes.

Think of it as:

A timed alternative to git stash that resets automatically.

3.1 Core properties

  • ⏱ Time-based (default: 4 days)
  • 👀 Always visible (git snooze -l)
  • ⚠ Automatically reappears
  • 🧠 Impossible to forget
  • 🏠 Local-only (no history, no remotes)

4 How it works (briefly)

  • Tracked files (\to) hidden usinggit update-index --skip-worktree

  • Untracked files (\to) renamed to*.Nd.snoozed.* and ignored via.gitignore

  • State (\to)stored locally in .git/snooze.db

  • Automation (\to) a pre-commit hook runsgit snooze sweep (\to)expired snoozes are automatically undone (\to) a warning is printed to stdout

No commits. No branches. No magic.

5 Installation (30 seconds)

5.1 Download link (raw script)

👉 Download:** https://gist.githubusercontent.com/siran/3640fd147e26c88ea9db0dbe01c15d6c/raw/git-snooze.py**

5.2 One-line install (recommended)


curl -fsSL
"https://gist.githubusercontent.com/siran/3640fd147e26c88ea9db0dbe01c15d6c/raw/git-snooze.py"
-o /tmp/git-snooze \ && python3 /tmp/git-snooze install --global \ && rm -f
/tmp/git-snooze
Enter fullscreen mode Exit fullscreen mode

That’s it.

  • Installs git-snooze to~/.local/bin

  • Sets one alias only :

6 Basic usage

6.1 Snooze a file (default: 4 days)


git snooze notes.md
Enter fullscreen mode Exit fullscreen mode

6.2 Snooze for a specific duration


git snooze notes.md 7
Enter fullscreen mode Exit fullscreen mode

6.3 Snooze everything(stash-like, but timed)


git snooze all git snooze all 14
Enter fullscreen mode Exit fullscreen mode

7 Unsnoozing

7.1 Unsnooze one file


git snooze -u notes.md
Enter fullscreen mode Exit fullscreen mode

7.2 Unsnooze everything immediately


git snooze -u all
Enter fullscreen mode Exit fullscreen mode

Unsnoozing is idempotent and index-authoritative. Even if metadata is missing, the index is always restored.

8 Seeing what’s snoozed


git snooze -l
Enter fullscreen mode Exit fullscreen mode

Output is grouped by days remaining , so you can see what’s about to reappear.

9 Automatic reminders (the important part)

On every commit:

  • git snooze sweep runs automatically
  • Expired snoozes are undone
  • A warning is printed if anything wakes up

You cannot accidentally forget snoozed work.

10 Extra safety

  • The tool refuses to snooze itself unless forced
  • git snooze all never breaks your setup
  • git snooze doctor --repair can rebuild metadata if needed
  • git snooze uninstall cleans up cleanly (and asks before deleting state)

11 Why this exists

I kept losing work in git stash.

Not because Git is bad — but because humans forget.

git snooze doesn’t trust memory. It trusts time.

That’s the whole idea.

12 Source & license

  • Provided as-is, use at your own risk.
  • Single-file script (Python 3.6+)
  • Readable, hackable, local-only
  • MIT-style, do what you want

👉 Source / download: https://gist.githubusercontent.com/siran/3640fd147e26c88ea9db0dbe01c15d6c/raw/git-snooze.py


✅ 100% vibe-code “certified”! 💯

git snooze -h
git snooze -h


DOI: https://writing.preferredframe.com/doi/10.5281/zenodo.18370930

Top comments (0)