Year-End Cleanup for Developers: Prune Dotfiles, Snippets, and Scratch Files
A developer year end cleanup is four small passes: audit your dotfiles, move editor junk into a global gitignore, preview deletions with git clean, and prune your snippets and scratch files. The rule for all four is the same: look first, back up second, delete last.
The quiet days at year end suit it. Nothing is on fire, and you have a full year of clutter to sort through.
Audit your dotfiles with ls -a
Your home folder hides more than you think. ls skips any name that starts with a dot unless you pass -a or -A, and shell wildcards don't match a dotfile unless the pattern itself starts with a dot, as the Wikipedia entry on hidden files explains. So old config for tools you dropped years ago can sit there unnoticed.
List everything, newest changes last:
ls -lAtr ~ | lessLook for three kinds of entry: config for tools you no longer use, caches and history files that grew without anyone asking, and files that belong under ~/.config. The same article notes that the XDG Base Directory Specification aims to move user configuration into non-hidden files inside the hidden $HOME/.config directory, so a newer tool is more likely to keep its settings there than directly in ~.
Two cautions. Hiding a file is not a security measure, so don't treat a dotfile as private just because ls skips it. And don't delete anything you can't name. Move it into a backup folder first:
mkdir -p ~/dotfiles-archive-2026
mv ~/.old-tool-rc ~/dotfiles-archive-2026/If nothing breaks in a few weeks, delete the archive. If you want the files you keep to survive the next laptop, keep your dotfiles in a Git repository.
Move editor junk into a global gitignore
Every repository on your machine probably has the same stray files: .DS_Store, swap files, scratch folders. Skip adding those to every project's .gitignore. Git's gitignore documentation says patterns that should apply in all situations belong in the file named by core.excludesFile. Its default is $XDG_CONFIG_HOME/git/ignore, or $HOME/.config/git/ignore if XDG_CONFIG_HOME is unset.
A short personal file is enough:
# ~/.config/git/ignore
.DS_Store
*.swp
*~
scratch/Patterns that only matter in one repository and shouldn't be committed go in .git/info/exclude instead. Precedence runs from command-line patterns, to .gitignore files in the same or parent directories, to info/exclude, to the global file, so a project's own .gitignore still wins.
An ignore rule never affects files Git already tracks. If a junk file got committed, ignoring it won't remove it. Run git rm --cached <file> to stop tracking it, then add the pattern. For the syntax details, see gitignore wildcard and negation rules.
Preview deletions with git clean
Build output and untracked experiments pile up inside repositories too. git clean removes them, and it is also the easiest way to delete something you wanted. Use the dry run first. Per the git-clean documentation, -n shows what would be removed without deleting anything, and Git refuses to delete unless you pass -f (the default clean.requireForce is true).
git clean -nd # preview untracked files and directories
git clean -ndX # preview only ignored files
git clean -i # interactive: confirm items one by oneThe flags matter:
-dincludes untracked directories.-Xremoves only ignored files, which keeps manually created ones. That makes it good for build products.-xremoves ignored files as well as untracked ones, so it can take things you meant to keep.-istarts interactive mode, where the "ask each" option has you confirm items individually.
Read the dry-run list line by line. If it matches what you expect, run the same command again with -f instead of -n.
Gather scratch files into one folder
Scratch files are the quiet part of the mess: test2.py, notes-final.txt, a half-written query. They get created in whatever folder was open at the time. Pick one home for them and stop making new ones elsewhere:
mkdir -p ~/Scratch/2027Use dated names so a sweep is a matter of looking at the date. At year end, move last year's folder into an archive and start a fresh one. For more on why a disposable buffer helps, see throwaway plain-text buffers. Anything worth keeping gets a real name and a real location. Everything else leaves with the archive.
Prune your snippet library
Snippet libraries grow by addition. Run through yours once and sort every entry into one of three piles:
- [ ] Keep: you used it this year, or it is hard to rederive.
- [ ] Merge: it duplicates another snippet with small differences.
- [ ] Retire: the language, API or tool it targets is gone.
Add a one-line comment to each keeper saying what it is for and when it last worked. A snippet with no context is a puzzle for next year's you. If the library is plain Markdown files, you can search it, diff it and keep it in Git. Our snippet workflow covers one way to set that up.
How Carets fits in
Everything above lives in plain text: dotfiles, ignore files, scratch notes and snippet libraries. Carets is a native notes and code editor for iPhone, iPad and Mac that opens Markdown, plain text and code in one place, with syntax highlighting for config files, so you can review a .gitconfig or a snippet file without opening a full IDE. Files are organized into projects and tags, which suits a Scratch folder or a snippets project, and they stay plain text, so they remain portable and easy to back up.
Get Carets on the App Store for iPhone, iPad and Mac.
Conclusion
Pick one pass and do it today. Start with ls -lAtr ~ and an archive folder, because it is the safest. Then add the global ignore file, run git clean -nd in a repository or two, and gather the scratch files. None of it has to be finished in a day.
Frequently Asked Questions
Is it safe to delete dotfiles I don't recognize?
Not blindly. Many dotfiles belong to tools that are still installed. Check the tool name and the modified date, and move the file to a backup folder instead of deleting it. If nothing breaks after a few weeks, remove it for good.
What does git clean -n do?
It is a dry run. It lists the untracked files Git would remove and deletes nothing. Git requires -f to actually delete by default, so run -n first and only then repeat with -f.
Where should a global gitignore live?
In the file named by core.excludesFile. If that is unset, Git reads $XDG_CONFIG_HOME/git/ignore, or ~/.config/git/ignore when XDG_CONFIG_HOME is not set.