⚠️ Deprecated — use clockify-deskThis tool deleted local autotracker rows from SQLite. That is destructive and breaks multi-profile workflows (one profile's blacklist removed data another profile needed).
Use clockify-desk instead:
review— read-only report per profile (include / skip / undecided)sync— push to Clockify API with that profile's filters only- Never deletes local autotracker data
Running
clockify-cleannow prints a warning and exits without deleting anything.
Intelligently clean up Clockify autotracker entries by removing non-work time tracking data
# Was: clockify-clean -d 60 -y (deleted rows)
clockify-desk review --profile tale -d 60
# Was: ~/clockify/sync
clockify-desk sync --profile taleSee clockify-desk/docs/migration.md.
Clockify Clean is a powerful command-line tool that helps you maintain clean and accurate time tracking data in Clockify Desktop by intelligently removing unwanted autotracker entries. Perfect for developers and professionals who want to keep only work-related time entries.
✨ Smart Filtering
- Whitelist/blacklist apps and domains automatically
- Group similar entries by domain for bulk decisions
- Interactive review for undecided entries
🎯 Flexible Modes
- Dry-run mode: Preview what would be deleted
- Batch mode: Review all entries, then delete in one go
- Auto mode: Skip confirmation prompts
⚡ Performance
- Direct SQLite database access for speed
- Efficient entry grouping and processing
- Handles hundreds of entries quickly
- macOS (tested on macOS Sonoma and later)
- Clockify Desktop app installed
sqlite3(pre-installed on macOS)zshshell (default on modern macOS)
# Download the script
curl -o ~/.local/bin/clockify-clean https://raw.githubusercontent.com/Israeltheminer/clockify-clean/main/clockify-clean
# Make it executable
chmod +x ~/.local/bin/clockify-clean
# Ensure ~/.local/bin is in your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc-
Clone this repository:
git clone https://github.com/Israeltheminer/clockify-clean.git cd clockify-clean -
Copy the script to your local bin:
cp clockify-clean ~/.local/bin/ chmod +x ~/.local/bin/clockify-clean
-
Ensure
~/.local/binis in your PATH (add to~/.zshrcif needed)
# Preview what would be deleted (last 7 days)
clockify-clean --dry-run
# Review and delete entries interactively
clockify-clean
# Check last 30 days
clockify-clean -d 30
# Batch mode: review all at once
clockify-clean --batch| Option | Description |
|---|---|
-d, --days <num> |
Number of days back to check (default: 14) |
--idle-minutes <num> |
Delete unsaved entries with idle time ≥ this many minutes (default: 60) |
--dry-run |
Show what would be deleted without actually deleting |
--batch |
Show all entries first, then confirm batch deletion |
-y, --yes |
Skip confirmation prompts (use with caution!) |
-v, --verbose |
Show detailed output for all operations |
-h, --help |
Show help message |
# Preview last 7 days without deleting
clockify-clean --dry-run
# Interactively review and delete entries from last 14 days
clockify-clean -d 14
# Batch mode: see all entries first, then decide
clockify-clean --batch --verbose
# Auto-delete last 30 days (skips prompts - be careful!)
clockify-clean -d 30 -yThe script uses a three-tier filtering approach:
- Apps: Cursor, Figma, Microsoft Teams, Tor Browser, Docker Desktop
- Domains: github.com, localhost, vercel.com, console.cloud.google.com, etc.
These entries are automatically kept as they're considered work-related.
- Apps: Spotify, Netflix, Mail, Finder, Clockify Desktop, Messages, Preview
- Domains: x.com, linkedin.com, youtube.com, coinmarketcap.com, tradingview.com, etc.
These entries are automatically deleted as they're typically non-work activities.
Entries with Clockify ZIDLETIME ≥ 60 minutes (configurable via --idle-minutes) are deleted even if the app/domain is whitelisted. This drops “parked on a page/app” segments that inflate totals.
Entries not in whitelist, blacklist, or idle are grouped by domain/app and presented for your decision:
- Review grouped entries
- See how many entries share the same domain
- Choose to delete all or keep all from that domain
The script directly accesses the Clockify Desktop SQLite database located at:
~/Library/Application Support/Clockify Desktop/Clockify_*.sqlite
Note: Close the Clockify Desktop app before running to avoid database locks.
Personal app/domain lists belong in config.local.sh next to the script. That file is gitignored and never committed.
cp config.local.example.sh config.local.sh
# edit config.local.sh with your apps and domains# config.local.sh — only this file, never commit
WHITELIST_APPS=("Cursor" "Code" ...)
BLACKLIST_APPS=("Spotify" "Netflix" ...)
WHITELIST_DOMAINS=("github.com" "localhost" ...)
BLACKLIST_DOMAINS=("youtube.com" "reddit.com" ...)The script ships generic defaults; config.local.sh overrides them when present. See config.local.example.sh for the format.
Do not put personal lists in the tracked clockify-clean script if you push to a public repo.
- Clockify must be closed: Blocks if Clockify Desktop is running, shows a macOS dialog + notification, and prints a rerun command; click Continue after quitting to proceed
- Dry-run mode: Test before deleting
- Confirmation prompts: Asks before each deletion (unless
-yis used) - Batch review: See everything before committing
- Verbose logging: Track what's happening with
-vflag
[ERROR] Clockify Desktop is running.
Solution: Quit Clockify (⌘Q). A dialog will prompt you to click Continue once it's closed. You can also copy and rerun the printed command.
[ERROR] Database is locked - please close Clockify Desktop app and try again
Solution: Quit the Clockify Desktop application before running the script.
zsh: command not found: clockify-clean
Solution: Ensure ~/.local/bin is in your PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc[INFO] No unsaved autotracker entries found in the specified date range
This is normal - it means all your autotracker entries have already been added to time entries or there are no entries in the date range.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Support for Linux/Windows
- Configuration file support (YAML/JSON)
- Pattern matching for descriptions
- Export deleted entries before removal
- Undo/restore functionality
- GUI interface
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for the Clockify time tracking platform
- Inspired by the need for clean, accurate time tracking data
This tool directly modifies the Clockify Desktop database. While it includes safety features, always:
- Backup your Clockify data before use
- Test with
--dry-runfirst - Close Clockify Desktop before running
Use at your own risk. The author is not responsible for any data loss.
Made with ❤️ by Israel Iyanda
Star this repo if you find it useful! ⭐