Overview
The Analog WakaTime Desktop Agent is a background program that tracks which desktop application is focused and how long it stays in focus. Unlike the VS Code extension (which tracks coding inside the editor), the agent covers the whole desktop session: browsers, terminals, IDEs, design tools, chat apps, and anything else that owns an active window.
It runs as a small local worker, stores activity offline when the network is down, and syncs batches to the Analog WakaTime gateway when you are authenticated.
| Desktop Agent | VS Code Extension | |
|---|---|---|
| Scope | Entire desktop (active window) | Files inside VS Code |
| Metrics | Program name, path, focused time | Keystrokes, lines, language, project |
| Runtime | Standalone binary / daemon | Extension host inside the editor |
| Login | CLI device flow or email/password | Browser device flow / API token |
You can use both at the same time. They report different kinds of activity to the same account.
What the agent does
- Detects the currently focused window on a supported OS / desktop stack.
- Samples focus every few seconds and buckets time by program, date, and hour.
- Writes unfinished activity into a local SQLite queue (
data/agent.db). - Uploads pending rows to the gateway in batches.
- Keeps running in the background until you stop it.
Architecture at a glance
┌────────────────────┐
│ CLI (start/stop/ │
│ login/status) │
└─────────┬──────────┘
│ spawns / signals
▼
┌────────────────────┐ poll active window
│ Background worker │──────────────────────────► OS / compositor backend
│ (--worker) │
└─────────┬──────────┘
│ flush buckets
▼
┌────────────────────┐
│ Local SQLite │ data/agent.db
│ offline queue │
└─────────┬──────────┘
│ sync batches + auth token
▼
┌────────────────────┐
│ Analog gateway │
│ + dashboard │
└────────────────────┘
On Linux Wayland sessions where the compositor does not expose focus APIs to normal apps (GNOME, KDE Plasma), the agent installs a small helper (GNOME Shell extension or KWin script) so it can still read the focused window. Details are in Linux desktops.
When to use it
- You want desktop-wide productivity stats, not only editor time.
- You work across multiple apps (browser + IDE + terminal + Figma, etc.).
- You need offline collection with automatic retry when the API is back.
- You run Linux (GNOME / KDE / Hyprland / Sway / X11), Windows, or macOS.
Next steps
- Installation — build or place the binary and start tracking
- Supported platforms — what works today and what does not
- What it collects — exact fields and privacy boundary
- CLI reference — every command the agent exposes